catalog

Oracle Database “RMAN-20216: backup piece is missing”

Got dizzy the other day when, after moving around backup files, a final “restore database preview summary;” got me a :

A web search straight away pointed me to Restore Database Preview Not Working (Doc ID 2652539.1) on metalink, proposing a solution. First off, rman needs to be started in debug/trace mode as follows (credits to https://oraclespin.com/2010/11/28/how-to-turn-on-debugtrace-when-running-rman) :

We’ll now need to identify the backup piece causing the problem by looking out for some pattern like “... getBackupPiece with error 20216“. In this case, a backup piece in backup set 6803 was incorrectly registered obviously :

ID 2652539.1 now recommends to do a crosscheck on the backup piece by tag name, followed by an uncatalog and a (re-)catalog. The tag name can be found by executing a "list backup of database;", the “select * from RC_BACKUP_PIECE where BS_KEY = 6803;” from the document didn’t work for me.

Now the crosscheck and the uncatalog :

The (re-)catalog, as given, failed due to a language error, maybe the document is already out of date in that respect :

I instead just did the well-known cataloging by file pattern and succeeded :

Yet another “crosscheck …” of the backup piece only returned one file, as compared to the output above :

And now, finally, the “restore … preview …” is working again :

Enjoy

Uncataloging a backupset from the rman repository

Ever seen this error message?

RMAN-06122: CHANGE .. UNCATALOG not supported for BACKUPSET

Seems you’re trying the get clean of backup sets that still exists on disk or tape but should no longer be regarded as a part of this database. What for? Well, this is quite a common requirement for rman-cloned or -duplicated databases where the rman repository (controlfile copy) originates from a seed database. Think of a standby database creation for example.

Since uncataloging backupsets is not allowed, one may test drive a change backupset ... delete;. Uurgh, this will also delete the files physically, which is clearly not the intention.

Another escape may be change backupset ... unavailable;, however, this attempt may result in ORA-19813: cannot have unavailable file ... in DB_RECOVERY_FILE_DEST. Great!

(more…)