Thursday 4 October 2012

RMAN Restore on another machine with different file system - same database name In Oracle Apps



Please Visit http://www.conacent.com/?page_id=218

RMAN Restoration on different Server as well as different Mount Point for Oracle APPS

1. Copy db backup file system from source server to target server as well as rman backup files.

2. Clone the database technology Stack.
    $su - oracln
    $cd $ORACLE_HOME/appsutil/clone/bin
    $perl adcfgclone.pl dbTechStack

3. Connect to RMAN utility.
    $RMAN target /


     Recovery Manager: Release 11.1.0.7.0 - Production on Fri Oct 5 14:03:49 2012
     Copyright (c) 1982, 2007, Oracle.  All rights reserved.
     connected to target database (not started)


4. Startup Database to nomount state.
    RMAN>startup nomount;


    Oracle instance started
    Total System Global Area    1068937216 bytes
    Fixed Size                                 2166536 bytes
    Variable Size                         427819256 bytes
    Database Buffers                   624951296 bytes
    Redo Buffers                           14000128 bytes


5. Restore controlfile from the rman backup file system. Before changing the path of the RMAN backup change the owner of the directory.

    RMAN> restore controlfile from '/data2/rman_archive/autobackup_control_filec-147839628-20120930-00';  [Latest control file]


                  Starting restore at 05-OCT-12
                  using channel ORA_DISK_1
                  channel ORA_DISK_1: restoring control file
                  channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
                  output file name=/d01/CLONE/db/apps_st/data/cntrl01.dbf
                  output file name=/d01/CLONE/db/apps_st/data/cntrl02.dbf
                  output file name=/d01/CLONE/db/apps_st/data/cntrl03.dbf
                  Finished restore at 05-OCT-12


6. Database need to be startup to mount state.
    RMAN> alter database mount;

                using target database control file instead of recovery catalog
               database mounted

7. if mount point is different then start with catalog command
    RMAN> catalog start with '/d01/CLONE/db';

                   File Name: /d01/CLONE/db/tech_st/11.1.0/opmn/conf/ons.config
                   File Name: /d01/CLONE/db/tech_st/11.1.0/opmn/conf/ons.config.ouibak.2
                   File Name: /d01/CLONE/db/tech_st/11.1.0/opmn/conf/ons.config.ouibak.3
                   File Name: /d01/CLONE/db/tech_st/11.1.0/opmn/conf/ons.config.ouibak.5
                   File Name: /d01/CLONE/db/tech_st/11.1.0/opmn/lib/ons.jar
                   File Name: /d01/CLONE/db/tech_st/11.1.0/opmn/lib/onc.jar
                   File Name: /d01/CLONE/db/tech_st/11.1.0/root.sh.old.1
                   File Name: /d01/CLONE/db/tech_st/11.1.0/root.sh.old

                   Do you really want to catalog the above files (enter YES or NO)? YES
                   cataloging files...


8. if redo logfile is in different mount point
    $ sqlplus '/as sysdba'
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log03a.dbf' to '/d01/CLONE/db/apps_st/data/log03a.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log03b.dbf' to '/d01/CLONE/db/apps_st/data/log03b.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log04a.dbf' to '/d01/CLONE/db/apps_st/data/log04a.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log04b.dbf' to '/d01/CLONE/db/apps_st/data/log04b.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log05a.dbf' to '/d01/CLONE/db/apps_st/data/log05a.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log05b.dbf' to '/d01/CLONE/db/apps_st/data/log05b.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log06a.dbf' to '/d01/CLONE/db/apps_st/data/log06a.dbf';
    SQL> alter database rename file '/oracle/OBA/obaora/db/apps_st/data/log06b.dbf' to '/d01/CLONE/db/apps_st/data/log06b.dbf';


9. if tempfile is in different mount point
    RMAN> run {
    2> set newname for tempfile '/oracle/OBA/obaora/db/apps_st/data/temp01.dbf' to '/d01/CLONE /db/apps_st/data/temp01.dbf';
     3> set newname for tempfile '/oracle/OBA/obaora/db/apps_st/data/temp02.dbf' to '/d01/CLONE/db/apps_st/data/temp02.dbf';
     4> switch tempfile all;
     5> }

      executing command: SET NEWNAME
      using target database control file instead of recovery catalog

       executing command: SET NEWNAME

        renamed tempfile 1 to /d01/CLONE/db/apps_st/data/temp01.dbf in control file
        renamed tempfile 2 to /d01/CLONE/db/apps_st/data/temp02.dbf in control file

  

10. if datafile is in different mount point

    RMAN> run {
          set newname for datafile 1 to '/d01/CLONE/db/apps_st/data/system01.dbf';
          set newname for datafile 2 to '/d01/CLONE/db/apps_st/data/system02.dbf';
          set newname for datafile 3 to '/d01/CLONE/db/apps_st/data/system03.dbf';
          set newname for datafile 4 to '/d01/CLONE/db/apps_st/data/system04.dbf';
          set newname for datafile 5 to '/d01/CLONE/db/apps_st/data/system05.dbf';
          set newname for datafile 6 to '/d01/CLONE/db/apps_st/data/ctxd01.dbf';
          set newname for datafile 7 to '/d01/CLONE/db/apps_st/data/owad01.dbf';
          set newname for datafile 8 to '/d01/CLONE/db/apps_st/data/a_queue02.dbf';
          set newname for datafile 9 to '/d01/CLONE/db/apps_st/data/odm.dbf';
          set newname for datafile 10 to '/d01/CLONE/db/apps_st/data/olap.dbf';
          set newname for datafile 11 to '/d01/CLONE/db/apps_st/data/sysaux01.dbf';
          set newname for datafile 12 to '/d01/CLONE/db/apps_st/data/apps_ts_tools01.dbf';
          set newname for datafile 13 to '/d01/CLONE/db/apps_st/data/system12.dbf';
          set newname for datafile 14 to '/d01/CLONE/db/apps_st/data/a_txn_data04.dbf';
          set newname for datafile 15 to '/d01/CLONE/db/apps_st/data/a_txn_ind06.dbf';
          set newname for datafile 16 to '/d01/CLONE/db/apps_st/data/a_ref03.dbf';
          set newname for datafile 17 to '/d01/CLONE/db/apps_st/data/a_int02.dbf';
          set newname for datafile 18 to '/d01/CLONE/db/apps_st/data/sysaux02.dbf';
          set newname for datafile 19 to '/d01/CLONE/db/apps_st/data/sysaux03.dbf';
          set newname for datafile 20 to '/d01/CLONE/db/apps_st/data/a_txn_data05.dbf';
          set newname for datafile 21 to '/d01/CLONE/db/apps_st/data/a_txn_data06.dbf';
          set newname for datafile 22 to '/d01/CLONE/db/apps_st/data/a_txn_ind07.dbf';
          set newname for datafile 23 to '/d01/CLONE/db/apps_st/data/XXILL01.dbf';
          set newname for datafile 288 to '/d01/CLONE/db/apps_st/data/system10.dbf';
          set newname for datafile 295 to '/d01/CLONE/db/apps_st/data/system06.dbf';
          set newname for datafile 314 to '/d01/CLONE/db/apps_st/data/portal01.dbf';
          set newname for datafile 351 to '/d01/CLONE/db/apps_st/data/system07.dbf';
          set newname for datafile 352 to '/d01/CLONE/db/apps_st/data/system09.dbf';
          set newname for datafile 353 to '/d01/CLONE/db/apps_st/data/system08.dbf';
          set newname for datafile 354 to '/d01/CLONE/db/apps_st/data/system11.dbf';
          set newname for datafile 379 to '/d01/CLONE/db/apps_st/data/undo01.dbf';
          set newname for datafile 392 to '/d01/CLONE/db/apps_st/data/a_txn_data01.dbf';
          set newname for datafile 393 to '/d01/CLONE/db/apps_st/data/a_txn_ind01.dbf';
          set newname for datafile 394 to '/d01/CLONE/db/apps_st/data/a_ref01.dbf';
          set newname for datafile 395 to '/d01/CLONE/db/apps_st/data/a_int01.dbf';
          set newname for datafile 396 to '/d01/CLONE/db/apps_st/data/a_summ01.dbf';
          set newname for datafile 397 to '/d01/CLONE/db/apps_st/data/a_nolog01.dbf';
          set newname for datafile 398 to '/d01/CLONE/db/apps_st/data/a_archive01.dbf';
          set newname for datafile 399 to '/d01/CLONE/db/apps_st/data/a_queue01.dbf';
          set newname for datafile 400 to '/d01/CLONE/db/apps_st/data/a_media01.dbf';
          set newname for datafile 401 to '/d01/CLONE/db/apps_st/data/a_txn_data02.dbf';
          set newname for datafile 402 to '/d01/CLONE/db/apps_st/data/a_txn_data03.dbf';
          set newname for datafile 403 to '/d01/CLONE/db/apps_st/data/a_txn_ind02.dbf';
          set newname for datafile 404 to '/d01/CLONE/db/apps_st/data/a_txn_ind03.dbf';
          set newname for datafile 405 to '/d01/CLONE/db/apps_st/data/a_txn_ind04.dbf';
          set newname for datafile 406 to '/d01/CLONE/db/apps_st/data/a_txn_ind05.dbf';
          set newname for datafile 407 to '/d01/CLONE/db/apps_st/data/a_ref02.dbf';
          switch datafile all;
}

RMAN> catalog start with '/s01/rman_archive';


RMAN>run {
          restore database  /  restore database until time "to_date('01-OCT-2012 23:45:00','dd-mon-rrrr hh24:mi:ss')";
           recover database  /  recover database until time "to_date('01-OCT-2012 23:45:00','dd-mon-rrrr hh24:mi:ss')";
          }

RMAN> alter database open resetlogs;



Please give your feedback if any thing is not correct. Your feedback is valuable.

No comments:

Post a Comment