Skip to content
Home » Oracle Database » How to Clean Fast Recovery Area by RMAN (2/8) - Delete Expired Backup or Copy

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

How to Clean Fast Recovery Area by RMAN (1/8) - Delete Expired Archivelog
The order of deleting expired backup or copy is the same as the deleting expired archivelog. That is, crosschecking first, then deleting.

Crosscheck backup, the backup could be database, datafiles or controlfile including spfile.
RMAN> crosscheck backup;

using channel ORA_DISK_1
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/tmp/database_backups/07npvr1c_1_1.bak RECID=1 STAMP=799009837
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/tmp/database_backups/08npvr5r_1_1.bak RECID=2 STAMP=799009979
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/tmp/database_backups/09npvr60_1_1.bak RECID=3 STAMP=799009984
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/tmp/database_backups/0anpvr62_1_1.bak RECID=4 STAMP=799009989
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+DATA/primdb/backupset/2012_12_17/nnndf0_tag20121217t113005_0.1094.802265461 RECID=5 STAMP=802265460
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=+DATA/primdb/autobackup/2012_12_17/s_802265992.1095.802266029 RECID=6 STAMP=802266027
Crosschecked 6 objects

Delete all kinds of backup which are marked as expired.
RMAN> delete expired backup;

using channel ORA_DISK_1

List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
1       1       1   1   EXPIRED     DISK        /tmp/database_backups/07npvr1c_1_1.bak
2       2       1   1   EXPIRED     DISK        /tmp/database_backups/08npvr5r_1_1.bak
3       3       1   1   EXPIRED     DISK        /tmp/database_backups/09npvr60_1_1.bak
4       4       1   1   EXPIRED     DISK        /tmp/database_backups/0anpvr62_1_1.bak

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/tmp/database_backups/07npvr1c_1_1.bak RECID=1 STAMP=799009837
deleted backup piece
backup piece handle=/tmp/database_backups/08npvr5r_1_1.bak RECID=2 STAMP=799009979
deleted backup piece
backup piece handle=/tmp/database_backups/09npvr60_1_1.bak RECID=3 STAMP=799009984
deleted backup piece
backup piece handle=/tmp/database_backups/0anpvr62_1_1.bak RECID=4 STAMP=799009989
Deleted 4 EXPIRED objects

Crosscheck copy, the copy could be database image copy, controfilecopy, archivelog or datafiles.
RMAN> crosscheck copy;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 instance=primdb1 device type=DISK
specification does not match any datafile copy in the repository
validation failed for control file copy
control file copy file name=/tmp/standby.ctl RECID=15 STAMP=799009657
validation failed for control file copy
control file copy file name=/tmp/standbycontrolfile.ctl RECID=2 STAMP=795098423
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 119 objects

Delete all kinds of copy which are marked as expired.
RMAN> delete expired copy;

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 instance=primdb1 device type=DISK
specification does not match any datafile copy in the repository
specification does not match any archived log in the repository
List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
15      X 10-NOV-12       2866404    10-NOV-12
        Name: /tmp/standby.ctl
        Tag: TAG20121110T190733

2       X 27-SEP-12       1644990    27-SEP-12
        Name: /tmp/standbycontrolfile.ctl
        Tag: TAG20120927T124020


Do you really want to delete the above objects (enter YES or NO)? yes
deleted control file copy
control file copy file name=/tmp/standby.ctl RECID=15 STAMP=799009657
deleted control file copy
control file copy file name=/tmp/standbycontrolfile.ctl RECID=2 STAMP=795098423
Deleted 2 EXPIRED objects

How to Clean Fast Recovery Area by RMAN (3/8) - Delete Obsolete by Configuring More Restrictive Policies

Leave a Reply

Your email address will not be published. Required fields are marked *