Simple Script to Delete Archive logs

Share via:

$ cat /u01/app/oracle/admin/SEPQA01/scripts/archiveclean.sh
#CURRDATETIME=date '+%Y%m%d-%H%M%S'
ORACLE_SID=ORCL1;export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/product/12102;export ORACLE_HOME
LOGDIR=/var/opt/monitoring/oracle/logs
LOGFILE=/var/opt/monitoring/oracle/logs/archiveclean.log

$ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.log
connect target
delete archivelog until time ‘sysdate-1’ ;
exit
EOF

ORACLE_SID=ORCL2;export ORACLE_SID
$ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.log
connect target
delete archivelog until time ‘sysdate-1’ ;
exit
EOF

ORACLE_SID=ORCL3;export ORACLE_SID
$ORACLE_HOME/bin/rman <<EOF | tee -a /var/opt/monitoring/oracle/logs/archiveclean.log
connect target
delete archivelog until time ‘sysdate-1’ ;
exit
EOF

###############
chmod 755 /u01/app/oracle/admin/ORCL/scripts/archiveclean.sh

0 03,07,11,15 * * * /u01/app/oracle/admin/ORCL1/scripts/archiveclean.sh > /var/opt/monitoring/oracle/logs/archiveclean1.log

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (12 votes, average: 5.00 out of 5)
Loading...

3 thoughts on “Simple Script to Delete Archive logs

  1. I came across your Simple Script to Delete Archive logs – KTEXPERTS.COM website and wanted to let you know that we have decided to open our POWERFUL and PRIVATE website traffic system to the public for a limited time! You can sign up for our targeted traffic network with a free trial as we make this offer available again. If you need targeted traffic that is interested in your subject matter or products start your free trial today: http://tdil.co/3p Unsubscribe here: http://tdil.co/5p

  2. I came across your Simple Script to Delete Archive logs – KTEXPERTS.COM website and wanted to let you know that we have decided to open our POWERFUL and PRIVATE website traffic system to the public for a limited time! You can sign up for our targeted traffic network with a free trial as we make this offer available again. If you need targeted traffic that is interested in your subject matter or products start your free trial today: http://aici.cf/2t1 Unsubscribe here: http://priscilarodrigues.com.br/url/11

Add Comment