Unusual Use of the RMAN uncatalog Command

4 min read
Jan 18, 2022

A fresh year is the perfect time to learn something new. Recently, I have come across warning messages in the RMAN level 0 backup log file and this post describes how I dealt with them.

 

 

 

The file contents went as follows:

RMAN-06207: WARNING: 1 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Datafile Copy   +RECOC1/prod/snapcf_prod.f


specification does not match any backup in the repository

 

We took disk-level backups without a recovery catalog schema and the associated command failed with this error: “delete noprompt expired backup;”. So, I executed the commands like “crosscheck backup;” and “crosscheck copy;” but found no expired records. Finally, the control file copy pieces showed validation failed messages as follows:

 

RMAN> crosscheck copy of controlfile;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
released channel: ORA_DISK_6
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5663 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=6290 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=6601 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=6915 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=325 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=631 instance=PROD2 device type=DISK
validation failed for control file copy
control file copy file name=/backups/PROD/snapcf_prod.f RECID=60 STAMP=1025510159
Crosschecked 1 objects

validation failed for control file copy
control file copy file name=+RECOC1/prod/snapcf_prod.f RECID=65 STAMP=1055956089
Crosschecked 1 objects

 

So, I started the delete command with the “force” option, which was executed successfully. But I still saw those pieces in the list command as follows:

 

RMAN> delete force expired copy of controlfile;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
released channel: ORA_DISK_6
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5663 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=6290 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=6601 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=6915 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=325 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=631 instance=PROD2 device type=DISK
List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
65      X 08-NOV-20       281674038070 08-NOV-20
        Name: +RECOC1/prod/snapcf_prod.f
        Tag: TAG20201108T170807

60      X 28-NOV-19       253807915757 28-NOV-19
        Name: /backups/PROD/snapcf_prod.f
        Tag: TAG20191128T075552


Do you really want to delete the above objects (enter YES or NO)? YES
deleted control file copy
control file copy file name=/backups/PROD/snapcf_prod.f RECID=60 STAMP=1025510159
Deleted 1 EXPIRED objects

deleted control file copy
control file copy file name=+RECOC1/prod/snapcf_prod.f RECID=65 STAMP=1055956089
Deleted 1 EXPIRED objects

RMAN> list copy of controlfile;

List of Control File Copies
===========================

Key     S Completion Time Ckp SCN    Ckp Time
------- - --------------- ---------- ---------------
65      X 08-NOV-20       281674038070 08-NOV-20
        Name: +RECOC1/prod/snapcf_prod.f
        Tag: TAG20201108T170807

60      X 28-NOV-19       253807915757 28-NOV-19
        Name: /backups/PROD/snapcf_prod.f
        Tag: TAG20191128T075552

 

The individual delete commands were failing with “RMAN-06159: error while looking up backup set,” which is expected as these backup pieces are no longer available. To my surprise, the ‘change..uncatalog’ option helped here:

 

RMAN> delete backupset 65;

using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 01/02/2022 21:10:34
RMAN-20215: backup set not found
RMAN-06159: error while looking up backup set

RMAN> delete backupset 60;

using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of delete command at 01/02/2022 21:10:55
RMAN-20215: backup set not found
RMAN-06159: error while looking up backup set

RMAN> change controlfilecopy  '/backups/PROD/snapcf_prod.f' uncatalog;

uncataloged control file copy
control file copy file name=/backups/PROD/snapcf_prod.f RECID=60 STAMP=1025510159
Uncataloged 1 objects

RMAN> change controlfilecopy tag 'TAG20201108T170807' uncatalog;

uncataloged control file copy
control file copy file name=+RECOC1/prod/snapcf_prod.f RECID=65 STAMP=1055956089
Uncataloged 1 objects

RMAN> crosscheck copy of controlfile;

released channel: ORA_DISK_1
released channel: ORA_DISK_2
released channel: ORA_DISK_3
released channel: ORA_DISK_4
released channel: ORA_DISK_5
released channel: ORA_DISK_6
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=638 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=6290 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=4726 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=6286 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=6606 instance=PROD2 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=6915 instance=PROD2 device type=DISK
specification does not match any control file copy in the repository

RMAN> list copy of controlfile;

specification does not match any control file copy in the repository

 

I usually use this ‘change..uncatalog’ command while cloning/refreshing a database. So, this new usage clause was very surprising. I discovered more about this command from this URL:

 

https://docs.oracle.com/en/database/oracle/oracle-database/19/bradv/maintaining-rman-backups.html

 

I hope you found this post helpful. 

Feel free to drop any questions in the comments and don’t forget to sign up for the next post.

Get Email Notifications

No Comments Yet

Let us know what you think