Restoring a Database to an Alternate Server
When restoring a database to an alternate server, you need to first prepare for Restore and then restore the parameter file, restore the control file to default location and then restore datafile.
To restore a database to an alternate server, perform the following steps:
- Preparing for Restore - Perform the following steps:
- Record the DBID for your source database
- Verify that backups used for the restore are accessible on the restore host. For example, if the backups were made with a media manager, then make sure the tape device is connected to the alternate host.
- Perform the following steps on the alternate server (Server-B):
- Install the same version of Oracle as source server.
- Install theArcserve Backup Oracle Agent and run “./orasetup” on Server-B under /opt/Arcserve/ABoraagt
- Modify the sbt.cfg file on Server-B under /opt/Arcserve/ABoraagt folder by removing the "#" part as shown below and enter the hostname of Server-A
- Verify that you can ping by the hostname to the backup server and from the backup server.
- From the backup server, ping Server-B by hostname and IP address from command prompt. Also try nslookup Server-B.
- From the Oracle Server-B, ping the backup server using hostname and IP address from command prompt. Also try nslookup Windows-Backup-Server.
- Verify that Server-B instance can communicate with the RMAN Catalog Server
- Set the below environment variables for the Oracle User on Server-B.
- Export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:
- Export SHLIB_PATH=$SHLIB_PATH:
- Create a caroot equivalency for the Oracle user on Server-B from the Arcserve Backup server.
- Restore parameter file -
- Copy the spfile/pfile file from Server-A to Server-B to the desired location or you may restore from the autobackup/rman backup performing the following steps:
- If taking a backup of these files as flat files, restore them to the alternate server.
- Restore SPfile from autobackup and to default location.
- Restore spfile to the alternate server from the specific backup item.
- Restart the instance with the restored file.
- Restore the control file to default location
- Use command line to perform the following steps:
- Alternatively, you can also restore control file from a specific backup item to perform a point in time restore.
- Restore datafiles - Perform the following steps:
- Mount the database.
- Restore the database.
- After successful restore and recovery of the database, open the database with resetlogs.
SQL> select DB_ID from v$database;
Path of Oracle database files (Datafiles/Control files/redo logs) of the source and alternate host are similar.
# Node where the original backup was made from
SBT_ORIGINAL_CLIENT_HOST=<hostname of Server-A>
$tnsping <RMAN_CATALOG_DB>
Example, tnsping rmanDB (considering RMAN_CATALOG_DB instance is rmanDB)
Note: If tnsping fails, add details of catalog database in the Server-B tnsnames.ora file and try to perform tnsping again.
Note: You may choose to set them either for this specific session or you can also set it up in the profile for that specific user.
/opt/Arcserve/ABoraagt/lib:/opt/Arcserve/ABcmagt/lib:/opt/Arcserve/ABcmagt:/opt/Arcserve/ABoraagt
/opt/Arcserve/ABoraagt/lib:/opt/Arcserve/ABcmagt
Launch the below command prompt on the backup server and change the path to the ARCserve installation folder. For example, for 64-bit Server cd X:\Program Files (x86) \CA\ARCserve Backup and 32-bit Server cd X:\Program Files\CA\ARCserve Backup.
ca_auth -cahost <Backup-Server-Name> -equiv add <oracle-user> <oracle-server-name> caroot carrot <caroot's password>
RMAN> set dbid=<dbid>;
RMAN> STARTUP FORCE NOMOUNT;
RMAN> run
{
Allocate channel dev1_1 device type sbt parms=’SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so’;
restore spfile from autobackup;
release channel dev1_1;
}
RMAN> set dbid=<dbid>;
RMAN> STARTUP FORCE NOMOUNT;
RMAN> list backup of spfile;
RMAN> run
{
Allocate channel dev1_1 device type sbt
parms=’SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so’;
restore spfile TO ‘PATH_TO_RESTORE_SPFILE’ from 'X';
release channel dev1_1;
}
where ‘X’ denotes the backup piece information.
Use one of the following procedures:
$rman catalog rman/rman@rmandb trace=/tmp/rmantrace.log
RMAN> set dbid=<source database db_id value>
RMAN> STARTUP FORCE NOMOUNT;
RMAN> connect target <username>/<password>;
RMAN> run {
Allocate channel dev1_1 device type sbt
parms=’SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so’;
restore controlfile;
release channel dev1;
}
[oratest@backuptest ~]$ rman catalog rman/rman@rmandb trace=/tmp/rmantrace.log
RMAN> set dbid=<source database db_id value>
RMAN> STARTUP FORCE NOMOUNT;
RMAN> list backup of controlfile;
RMAN> connect target <username>/<password>;
RMAN> run {
Allocate channel dev1_1 device type sbt parms=’SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so’;
restore controlfile;
release channel dev1;
}
Where ‘Y’ denotes the backup piece.
SQL> alter database mount;
RMAN> connect target <username>/<password>;
RMAN> run {
Allocate channel dev1_1 device type sbt
parms=’SBT_LIBRARY=/opt/Arcserve/ABoraagt/libobk64.so’;
Restore database;
Recover database until “cancel|sequence <archive-log-sequence>”
release channel dev1;
}
SQL> alter database open resetlogs;
The database is restored to an alternate host.