Sunday, October 23, 2022

Oracle Database 11g -- RMAN DELETE OBSOLETE Fails with ORA-19606: Cannot copy or restore to snapshot control file

Problem

RMAN DELETE OBSOLETE command might fail with error like:

RMAN> delete noprompt obsolete device type disk;
...
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     2      2016-02-02 10:56:15 /ora01/app/oracle/product/11.2.0.4/dbhome_1/dbs/snapcf_<db_unique_name>.f
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 10/20/2022 21:58:16
ORA-19606: Cannot copy or restore to snapshot control file 

Solution

A workaround would be to temporary rename the snapshot controlfile in the RMAN configuration and remove the old one as expired:

1) Rename the snapshot controlfile copy:

RMAN> configure snapshot controlfile name to '/ora01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_<db_unique_name>.f_temp';

2) Crosscheck the snapshot controlfile by the old name and delete as expired:

RMAN> crosscheck controlfilecopy '/ora01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_<db_unique_name>.f';

RMAN> delete noprompt expired controlfilecopy '/ora01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_<db_unique_name>.f';

3) Rename the snapshot controlfile back to its original name:

RMAN> configure snapshot controlfile name to '/ora01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_<db_unique_name>.f';

No comments: