Tuesday, December 4, 2018

Restore RMAN Backup TO a Different Server


This blog will detail the steps to restore a database on a new host using RMAN. 

Step_1. Create Pfile

Step_2. Startup nomount:

SQL> startup nomount pfile='/rmanfs/pfile.ora';
----------------------------------------------------
Transfer the full backup with control file to the desired server.

Step_3. Restore Controlfile:

RMAN> restore controlfile from '/rmanfs/backup/o1_mf_s_99261014_.bkp';
RMAN> catalog start with '/rmanfs/backup';


Step_4: Mount Database

SQL> alter database mount;

Step_5: Restrore DB


ORACLE_UNQNAME=dbname; export ORACLE_UNQNAME
ORACLE_BASE=/orafs/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/11.2.0.3/db_1; export ORACLE_HOME
ORACLE_SID=dbname; export ORACLE_SID

PATH=$PATH:$ORACLE_HOME/bin; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

$ORACLE_HOME/bin/rman  target /

run
{
allocate channel disk1 device type disk;
allocate channel disk2 device type disk;

set newname for datafile 1 to '/dbsystemfs/oradata/system01.dbf';
set newname for datafile 2 to '/dbsystemfs/oradata/sysaux01.dbf';
set newname for datafile 3 to '/undofs/undo_tbs01.dbf';
set newname for datafile 4 to '/dbsystemfs/oradata/ababil/users/users01.dbf';
set newname for tempfile 1 to '/tempfs/oradata/temp/temp01.dbf';

restore database;
switch datafile all;
switch tempfile all;
release channel disk1;
release channel disk2;
}


Step_6: Recover Database;

RMAN> recover database;(RMAN> recover database until scn 21046745532;)
RMAN> alter database open resetlogs;



No comments:

Post a Comment