0

We are running Oracle 12c SE. I need to duplicate an instance from the RMAN backups. However, this instance will be on a different server, with a different SID. And, the pathnames have the SID in them: /u01/<ORACLE_SID>/data_tbs, as such.

Not 100% sure how to do this, was hoping someone can give me some steps.

Many thanks

2 Answers 2

0

Option 1:

Example:

run
{
  set newname for datafile 1 to '/u01/NEW_PATH/system_tbs';
  set newname for datafile 2 to '/u01/NEW_PATH/undo_tbs';
  set newname for datafile 3 to '/u01/NEW_PATH/sysaux_tbs';
  set newname for datafile 4 to '/u01/NEW_PATH/users_tbs';
  ...
  set newname for tempfile 1 to '/u01/NEW_PATH/temp_tbs';
  ...
  duplicate target database to NEW_DB
  logfile
    group 1 ('/u01/NEW_PATH/redo01.log') size 1G,
    group 2 ('/u01/NEW_PATH/redo02.log') size 1G,
    group 3 ('/u01/NEW_PATH/redo03.log') size 1G
  ;
}

Option 2:

DB_FILE_NAME_CONVERT

LOG_FILE_NAME_CONVERT

On the new instance, set the parameters as required before starting the duplicate:

alter system set db_file_name_convert='/u01/OLD_PATH/', '/u01/NEW_PATH/' scope=spfile;
alter system set log_file_name_convert='/u01/OLD_PATH/', '/u01/NEW_PATH/' scope=spfile;

And restart the instance. You can skip all the above parts from duplicate command:

duplicate target database to NEW_DB;

Above needs to be done only once, these parameters can be set in advance in the SPFILE if you plan to do additional duplicates in the future.

3
  • Thank you Seems like Option #2 is a more straightforward was of doing this. One question: I also need to change the SID, aside from setting the environment value, is there anything else needed? Commented Jan 17, 2022 at 17:38
  • Just use the ORACLE_SID environment variable and instance_name, db_unique_name, db_name SPFILE parameters you need in the new environment, and RMAN will handle the rest. Commented Jan 17, 2022 at 17:43
  • Ok, and one last thing: Since the DB files are located on different mount points, would I issue one of the above commands for each mountpoint? /u01, /u02, /u03, etc..... Commented Jan 17, 2022 at 19:00
0

if the files can reside in one mountpoint or asm diskgroup on the new server, you can set db_create_file_dest in the spfile / pfile and all is fine. no need for set newname or db_file_name_convert.

example: target server db files shoud be under /u02/data/ set db_create_file_dest to /u02/data/

after dulicate you will find all datafiles unter: /u02/data/newsid/datafile/

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.