Saturday 7 April 2018

RMAN-20230: datafile copy not found in the repository - Oracle Database

RMAN-03002 RMAN-20230 RMAN-06015 Errors while performing switch database to copy in Oracle Database


RMAN-20230: datafile copy not found in the repository

While creating a Oracle Standby or performing a Roll Forward for a Standby database, after restoring the controlfile and datafiles, you need to make sure that you have modified the entries in the Controlfile for the path of all the datafiles and tempfiles as per the Standby. This is because when you create the controlfile backup for Standby from primary, it still has the file path entries as per the Primary only. The same you can verify by running the below mentioned query on RMAN.

RMAN> report schema;

It will show you all the datafiles and tempfiles with their path location. You need to make the changes in the standby controlfile to make sure they match the physical location of the datafiles and tempfiles in the standby. To achieve this, normally we use the below mentioned methods,

1) Use the DB_FILE_NAME_CONVERT parameter in Oracle Database.
2) Use SET NEWNAME while performing the RMAN RESTORE which will further require you to run the SWITCH DATABASE TO COPY command to actually make the changes in the controlfile.
3)  Use SWITCH DATAFILE TO DATAFILE COPY command to make the changes in the controlfile.

Now in my case I had done the restore and was performing the SWITCH DATABASE TO COPY to make the changes in the controlfile but got the below mentioned error.

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of switch command at 04/06/2018 15:54:57
RMAN-20230: datafile copy not found in the repository
RMAN-06015: error while looking up datafile copy name: /backup/drnhperp/ifsapp_data.328.915806215

Resolution:

The issue was that I hadn't cataloged the existing datafiles in the Standby RMAN repository. Since I was performing the Roll forward, my datafiles were already there and once I restored the new controlfile, the repository was gone. I needed to put the existing datafiles in the RMAN Catalog and then perform the SWITCH DATABASE TO COPY command to make the changes in the controlfile. I did the same and after that I was able to successfully run the command.

I hope this helps !!

No comments:

Post a Comment