RMAN Delete old archivelogs

delete force noprompt archivelog all completed before 'sysdate-7';
If you want to delete archive logs older than few hours:
Verify the time like how many hours older than you want to delete.
SQL> alter session set nls_date_format='MM/DD/YYYY HH24:MI:SS';
Session altered.
SQL> select sysdate-1/11 from dual;

SYSDATE-1/11
-------------------
12/08/2013 08:33:05
SQL> SQL>
SQL> select sysdate from dual;
SYSDATE
-------------------
12/08/2013 10:44:15
SQL>
So sysdate-1/11 will delete the files older than 8:30 am.
RMAN>connect target /
delete noprompt archivelog until time '(sysdate-1/11)' backed up 1 times to device type sbt_tape;
or
RMAN> delete force noprompt obsolete;
RMAN> delete force noprompt expired;

About tosasan

Just Me and my Bicycle
This entry was posted in ORACLE, RMAN and tagged . Bookmark the permalink.

Leave a comment