Pages

Restoring an RMAN Backup to Another Node (without duplicate command )

Overall   :

Using init.ora(with changed parameter like control_file etc.) ,
first instance is started in nomount then
C.F will be restored to control_file location then
mount the database
restore the datafiles. Location of D.F can be changed using set newname



Assumption:
===========

- target database is on host A

- Database is to be restored onto host B
- Directory structure on host B is different from host A
- ORACLE_SID will not change for the restored database
- recovery catalog is being used
- backups taken on disk


Steps :
===========

- backup the target on host A :
    backup tag whole_db_open format '' database;
    sql 'alter system archive log current';
    backup archivelog all format ''
    backup current controlfile tag cf format ''

- list the datafile, logfile and controlfile locations on host A


- make the backup available to host B through shared filesystem

- make a copy of the init.ora available to host B

- edit the init.ora to reflect directory structure changes of host B

Change adump,bdump,cdump,udump
Change control_file
Change log_archive_dest

- configure SQL*Net connectivity from host to the recovery catalog and duplicated database

configure listener.ora on host B to accept connections
configure tnsnames.ora on host B to connect to rman catalog


- set up a password file for the duplicated database

Copy the orapwd file from host A to B

- startup nomount the duplicated database on host B

startup nomount pfile=

- RMAN restore the controlfile(s)

RMAN> restore controlfile from '/path'

- mount the database

RMAN> alter database mount ;

- Catalog backups

RMAN> catalog backuppiece  '/path/backsetname.bkp'
or
RMAN> catalog start with '/path/'


- List the sequence(one with lowest scn) uptil which you can recover

RMAN > list backup of archivelog all;


- restore and rename the datafiles :
     
RMAN > run { set until sequence <seq_no> + 1
set newname for datafile 1 to '/oracle/datafiles/test/sys01.dbf';
.....
.....
restore database; 
switch datafile all;
recover database; 
alter database open resetlogs;
}

- [ rename logfile location alter database rename file '' to ''; ]

- recover and open the database : recover database using backup controlfile until cancel; alter database open resetlogs;