October 01, 2012

Delete Archive Log Scedulled

Log time no blogging

just want to share about managing archive log using crontab, delete and leave the archive log two days back only

- First time you can make file contain below script

# dont foeget to set profile in your script as below
export ORACLE_HOSTNAME=hostname
export ORACLE_BASE=/apps/oracle
export GRID_HOME=/apps/11.2.0/grid
export DB_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=ORACLE_SID
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$GRID_HOME/bin:$BASE_PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib


$ORACLE_HOME/bin/rman <connect target /
delete noprompt archivelog all completed before 'sysdate-2';
crosscheck archivelog all;
exit
EOF


- Then you can put your script to the crontab, to adjust as per needed


okay may this help you all :)