RMAN Duplicate with new SID / Path



  • 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//data_tbs, as such.

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

    Many thanks



  • 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:

    https://docs.oracle.com/database/121/REFRN/GUID-E8B4E0EA-B073-4349-9EA9-E053F499FB9E.htm#REFRN10038

    https://docs.oracle.com/database/121/REFRN/GUID-3D5894EF-C33D-4687-978F-F640174F6FCC.htm#REFRN10098

    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.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2