1

I am trying to restore a RMAN backup to a different server. I needed some clarifications/guidance.

This is the location for datafiles in database 1:

/u01/app/oracle/oradata/db1/datafile

This is the location for datafiles in database 2:

/u01/app/oracle/oradata/db2/datafile

I have taken the backup from database 1, and I want to restore it to database 2; I have used the scp command to send the rman backup to the other server, I want to restore the database. Are there supposed to be any changes in the pfile for the location of datafiles for restoration?

1 Answer 1

1

Try using these init parameter file settings in the destination:

*.DB_FILE_NAME_CONVERT = "/u01/app/oracle/oradata/db1/datafile","/u01/app/oracle/oradata/db2/datafile"
*.LOG_FILE_NAME_CONVERT = "/u01/app/oracle/oradata/db1/datafile","/u01/app/oracle/oradata/db2/datafile"

More info here: https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/DB_FILE_NAME_CONVERT.html#GUID-E8B4E0EA-B073-4349-9EA9-E053F499FB9E This documentation mentions these settings in the context of copying a database to a standby, but IIRC this should also work when restoring to a standalone primary instance.

Burleson Consulting has some info with examples for cloning a database using different methods (backup-restore, duplicate, etc). http://www.dba-oracle.com/t_rman_77_cloning_remote_host.htm

Another option if you want to keep it all in RMAN is to use SET NEWNAME. Oracle Doc ID 549972.1 goes into detail on this. The drawback is you have to specify a SET NEWNAME for each file in the database. To make this a little easier, you can partially automate this by getting a list of the files in the database with

select 'set newname for datafile '||file#||' to '''||name||''';' from v$datafile;

and spooling this to a file. Then do a search/replace in the file to update the paths and add the resulting commands to your RMAN script to restore the database on the destination server.

OMF can complicate this because Oracle manages this stuff for you (so you’re giving up some control for convenience). I’ve always been strict about keeping paths the same so I don’t run into complications so if you are using OMF, this may not work 100% for you (but it should be a step in the right direction).

1
  • @S M, thanks! It works. Nov 20, 2023 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.