Restore and recover the Database to a new host with a same directory structure
In this case DBID of the database will be the same as of original database.
Source Configuration:
Host Name SUN1
DB Name PROD
Database Location /DB/PROD
Backup Location /RMAN_BKP
Archive Location /archive
Target Configuration:
Host Name SUN2
DB Name PROD
Database Location /DB/PROD
Backup Location /RMAN_BKP
Archive Location /archive
Step 1 Take a full backup of Source Database
RMAN> backup database plus archivelog;
RMAN>backup spfile; – if you are using spfile , other wise take backup of pfile by using os command.
Step 2 Transfer these backup pieces to target machine (/RMAN_BKP location)
Step 3 Determine the DBID of source machine
SQL> select dbid from v$database;
DBID
———-
142618240
Step 4 Now perform task on target machine
First set ORACLE_SID, ORACLE_HOME and PATH then connect to rman
Step 5 Set DBID and restore spfile or pfile.
RMAN> set dbid 142618240
executing command: SET DBID
RMAN> startup nomount
Step 6 Restore pfile.
RMAN> restore spfile to pfile ‘/export/home/oracle/oracle/product/10.2.0/db_1/dbs/initPROD.ora’ from ‘/RMAN_BKP/c-142618240-20100927-01’;
Step 7 Start the instance with pfile.
RMAN> STARTUP FORCE NOMOUNT
Step 8 Restore and Mount the Control file on Target Instance
RMAN> restore controlfile from ‘/RMAN_BKP/c-142618240-20100927-01’;
RMAN> ALTER DATABASE MOUNT;
Step 9 Restore the database
RMAN> restore database;
Step 10 Recover the database
RMAN > recover database;
Step 11 Open the Database resetlogs option.
RMAN> alter database open resetlogs;
Responses