Skip to content

How to Clean Fast Recovery Area by RMAN (1/8) - Delete Expired Archivelog

  • by
Go Back to Overview Page -How to Clean Fast Recovery Area by RMAN (0/8) - An Overview
Deleting expired archivelogs will clean the records of archivelog which are no longer accessible. After deleting expired archivelogs, the controlfile will recalculate the overall used space of FRA to resolve ORA-19809. But before deleting expired archivelogs, you should crosscheck all archivelogs first.

Crosschecking can find out the files which are no longer existed, and then mark them as "EXPIRED". These expired files could have been deleted by DBA on OS-level manually. If any archivelog shows "validation failed for archived log" in the process of crosschecking, it will be marked as expired.
RMAN> crosscheck archivelog all;

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 instance=primdb1 device type=DISK
validation failed for archived log
archived log file name=+DATA/compdb/archive/1_4_797940996.arc RECID=1 STAMP=797944474
validation failed for archived log
archived log file name=+DATA/compdb/archive/1_5_797940996.arc RECID=4 STAMP=797944494
...
validation succeeded for archived log
archived log file name=+DATA/primdb/archivelog/2012_10_30/thread_1_seq_24.947.798044585 RECID=58 STAMP=798044592
validation succeeded for archived log
archived log file name=+DATA/primdb/archivelog/2012_10_30/thread_1_seq_25.948.798044597 RECID=59 STAMP=798044597
...
validation succeeded for archived log
archived log file name=+DATA/primdb/archivelog/2013_01_24/thread_2_seq_76.1108.805564677 RECID=285 STAMP=805564680
validation succeeded for archived log
archived log file name=+DATA/primdb/archivelog/2013_01_24/thread_2_seq_77.1109.805564681 RECID=286 STAMP=805564682
Crosschecked 161 objects

Delete all the expired archivelog. In fact, this step is just to clean the records in the controlfile, not the files.
RMAN> delete expired archivelog all;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 instance=primdb1 device type=DISK
List of Archived Log Copies for database with db_unique_name PRIMDB
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
1       1    4       X 29-OCT-12
        Name: +DATA/compdb/archive/1_4_797940996.arc

4       1    5       X 29-OCT-12
        Name: +DATA/compdb/archive/1_5_797940996.arc
...
101     2    30      X 30-OCT-12
        Name: +DATA/compdb/archive/2_30_797940996.arc

107     2    31      X 30-OCT-12
        Name: +DATA/compdb/archive/2_31_797940996.arc


Do you really want to delete the above objects (enter YES or NO)? yes
deleted archived log
archived log file name=+DATA/compdb/archive/1_4_797940996.arc RECID=1 STAMP=797944474
deleted archived log
archived log file name=+DATA/compdb/archive/1_5_797940996.arc RECID=4 STAMP=797944494
...
deleted archived log
archived log file name=+DATA/compdb/archive/2_30_797940996.arc RECID=101 STAMP=798048432
deleted archived log
archived log file name=+DATA/compdb/archive/2_31_797940996.arc RECID=107 STAMP=798048834
Deleted 44 EXPIRED objects

How to Clean Fast Recovery Area by RMAN (2/8) - Delete Expired Backup or Copy

Leave a Reply

Your email address will not be published.