I am trying to restore a database to an older DBID and I am trying to figure out the right point to place the 'set dbid <dbid>' command.
Here is the scenario:
Database A is backed up (using recovery catalog) and has a dbid of 565656. Database A is then duplicated (from a recent copy of prod) and it now has a dbid of 787878.
Now we want to restore Database A to its previous backup which has a dbid of 565656. What would be the correct sequence to do this to prevent the 'RMAN-20001: target database not found in recovery catalog' error? At what point would we place the 'set dbid' command?
connect target /
connect catalog rman@catdb set dbid 565656
alter database mount
Do a point in time recovery of Database A. Then just change the DBID number. ( DBNEWID utility )
Restrictions and Usage Notes for the SET DBID Command
You should only run the SET DBID command in the following specialized circumstances:
You are not connected to a recovery catalog and want to restore the control file or server parameter file.
You are connected to a recovery catalog and want to restore the control file, but the database name is not unique in the recovery catalog.
The server parameter file is lost and you want to restore it.