DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001

    Question rman restore to another database/node

    I have a full rman backup of a database called BMSDEP01.
    I want to restore this database(BMSDEP01) on another node with a different database name (IE. TEST01).
    I cannot find a note in metalink or the procedure that explains how to do this. Could someone please provide the doc ID or procedure.
    Thank you.

  2. #2
    Join Date
    Mar 2007
    Ft. Lauderdale, FL
    Quote Originally Posted by pascal01 View Post
    I want to restore this database(BMSDEP01) on another node with a different database name (IE. TEST01).
    ... please look at SET NEWNAME option.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Nov 2000
    Pittsburgh, PA
    Here is some dynamic SQL that you can run on your current database. You will need to change
    things like '||CHR(36)||'{DBPASS} to your password for sys and '/&oraclesid/' to the old database,
    as well as '||CHR(36)||'{TARGET_SID}/')||''' to your new database. Basically play with the queries
    until you get the right output.

    DEFINE oraclesid='&1'
    select '#!/bin/bash'                             from dual;
    select 'export TARGET_SID='||CHR(36)||'{1}'      from dual;
    select '. /oracle/bin/set_oracle_env.sh '||CHR(36)||'{TARGET_SID}' from dual;
    select '. /oracle/bin/getPwd.sh `'||CHR(36)||
    '{ORACLE_HOME}/bin/sqlplus -s -v | cut -d" " -f3 | cut -d"." -f1-2`'
    from dual;
    select 'echo "sid name      |${TARGET_SID}|"'    from dual;
    select 'rman << EOF'                             from dual;
    select 'connect catalog '||CHR(36)||'{DBPASS};'  from dual;
    select 'connect target /;'                       from dual;
    select 'set echo on;'                            from dual;
    select 'set dbid '||dbid||';'                    from v$database;
    select 'run {' from dual;
    select '   set command id to ''clone'';'         from dual;
    select '   SET NEWNAME FOR DATAFILE '||file_id||' TO '''||
    REPLACE(file_name, '/&oraclesid/', '/'||CHR(36)||'{TARGET_SID}/')||''';' line
    from dba_data_files
    order by file_id;
    select '   SET NEWNAME FOR TEMPFILE '||file_id||' TO '''||
    REPLACE(file_name, '/&oraclesid/', '/'||CHR(36)||'{TARGET_SID}/')||''';' line
    from dba_temp_files
    order by file_name;
    select '   restore controlfile;'                 from dual;
    select '   alter database mount;'                from dual;
    select '   restore database force;'
    from dual;
    select '   recover database;'
    from dual;
    select '}'                                       from dual;
    select 'EOF'                                     from dual;
    this space intentionally left blank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

By using this site, you agree to the Privacy Policy