When restoring a database to an alternate server using RMAN directly, the following prerequisites are required:
For example, consider the following scenario:
Note: The scenario used in the following procedure assumes that the database backed up from <Server-A> will be restored to <Server-B>, and that the database name will be preserved. It also assumes that the directory structure of the original and destination hosts are the same. In addition, this scenario assumes you are using Oracle 10gR2.
To restore a database to an alternate server, perform the following steps:
src:/opt/oracle/10gR2:N
For example:
$cd $ORACLE_BASE/admin $mkdir src $mkdir adump bdump cdump dpdump pfile udump $mkdir -p $ORACLE_BASE/oradata/src $mkdir -p $ORACLE_BASE/flash_recovery_area/SRC
# /opt/Arcserve/ABoraagt/orasetup
When orasetup prompts you to use a Recovery Manager catalog to handle database backups, specify ‘y’.
Are you planning on using a Recovery Manager catalog to handle database backups (Recommended)? (Y/N) Y
When orasetup prompts you to specify the name of the Oracle instance, specify the original instance ID.
Oracle instance id to be used by this agent [<Enter> to end]: src ORACLE_HOME environment value for this Oracle instance: (default:/opt/oracle/10gR2):
When orasetup prompts you to specify the name of the Recovery Manager service name, specify the configured TNS name for the RMAN catalog database.
Since you have configured the Recovery Manager, please provide the Recovery Manager service name for database src. Recovery Manager service name : catdb
# Node where the original backup was made from SBT_ORIGINAL_CLIENT_HOST=Server-A.
Connect to the original database instance src as sysdba user.
$ sqlplus "/ as sysdba" Generate pfile from spfile. SQL>create pfile from spfile;
A file named init<$ORACLE_SID>.ora is created in the path $ORACLE_HOME/dbs, copy the file to the same path located on the alternate destination Server B.
Assuming the existing database name is 'tmpdb'.
Create pfile from spfile for database ‘tmpdb’.
Connect to the database instance ‘tmpdb’ as sysdba user.
$export ORACLE_SID=tmpdb $sqlplus "/ as sysdba" Generate pfile from spfile. SQL> create pfile from spfile;
The file "inittmpdb.ora" is created in the path ORACLE_HOME/dbs. Copy the file to "initsrc.ora" and from this file, replace all the SID names 'temdb' with 'src' and save the file.
$export ORACLE_SID=src $sqlplus /nolog SQL>conn sys/passw0rd as sysdba SQL>startup nomount pfile=$ORACLE_HOME/dbs/init$ORACLE_SID.ora SQL>exit
$rman catalog rman/rman@catdb RMAN> set dbid=<source database db_id value> RMAN> connect target system/passw0rd; RMAN>run { 2>allocate channel ch1 type sbt parms='SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so'; 3>restore spfile; 4>release channel ch1; 5>}
Note: For a 32-bit Oracle database, the SBT_LIBRARY uses libobk32.so. For a 64-bit Oracle database, the SBT_LIBRARY uses libobk64.so.
The restore job runs on the Arcserve Backup Server job queue. When the job completes, the spfile database restores to the $ORACLE_HOME/dbs path.
Shut down the database.
RMAN>shutdown immediate; RMAN>exit
Restart the database with the "nomount" option using the spfile you just restored.
$sqlplus /nolog SQL>conn sys/passw0rd as sysdba SQL>startup nomount SQL>quit
$rman catalog rman/rman@catdb RMAN> set dbid=<source database db_id value> RMAN> connect target system/passw0rd; RMAN> run { 2> allocate channel dev1 type 'sbt_tape' parms='SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so'; 3> restore controlfile; 4> release channel dev1; 5> }
Alternatively if you restore the control file from a specific backup piece to perform a point in time restore, then perform the following steps:
$ rman catalog rman/rman@catdb RMAN> set dbid=<source database db_id value> RMAN> connect target system/passw0rd; RMAN> run { 2> allocate channel dev1 type 'sbt_tape' parms='SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so'; 3> restore controlfile from ‘Y’; 4> release channel dev1; 5> }
To obtain ‘Y’, which denotes the backup piece information, perform the following:
RMAN> set dbid=<dbid>; RMAN> list backup of controlfile;
The restore job runs on the Arcserve Backup Server job queue. When the job completes, the database control files are restored to the $ORACLE_HOME/oradata/$ORACLE_SID path.
$sqlplus / as sysdba SQL>alter database mount; SQL>exit
$rman catalog rman/rman@catdb RMAN> set dbid=<source database db_id value> RMAN> connect target system/passw0rd; RMAN>run { 2>allocate channel ch1 type sbt parms='SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so'; 3>restore database; 4>restore archivelog all; 5>release channel ch1; 6>}
The restore job runs on the Arcserve Backup Server job queue. When the job completes, the database files and the archive logs are restored.
$sqlplus / as sysdba SQL> recover database using backup controlfile until cancel
SQL> alter database open resetlogs;
Copyright © 2016 |
|