Perform a cross machine restore when the original database host has been damaged or destroyed, and you need to restore the data to a different host from the backup.
You can find the backup ID in the BRBACKUP and BRARCHIVE files.
Note: The examples in this procedure use the backup ID with the -b2 option. You can use the #NULL option instead, but you must enable that option on the CommCell Console. For more information, see Enabling Restores of Earlier Backups without Specifying the Job ID.
Example
The value after the #SAVED line is the backup ID.
In the following examples, the backup IDs are '10117894_7567' and '10117894_7568'
BR0280I BRBACKUP time stamp: 2016-03-07 13:17:10
#PFLOG.... /oraprdhome/app/ora11g/product/home1/PRD/sapbackup/besrellt.anf
#SAVED.... 10117894_7567
BR0280I BRARCHIVE time stamp: 2016-03-07 13:41:00
#PFLOG.... /oraprdhome/app/ora11g/product/home1/PRD/saparch/aesrenmf.cds
#SAVED.... 10117894_7568
When you use the rman_util interface with the following options, then the software might restore the control file from the latest brarchive job.
-
database point-in-time recovery option (-t dbpit)
-
last sequence number (-seq last)
To restore the control file from the point-in-time job, set the sUSEBKPIDFORCTRLRESTORE environment variable in the database user login session before you initiate the BRRECOVER command line restore.
Online_cons backups and offline backups are only for database resets. You cannot use these backup types for a point-in-time recovery operation.
Before You Begin
-
On the source host, locate the detail file name and the summary file name of the data and log backups to be restored.
-
On the destination host, create an instance for the database that you want to restore. For more information, see Creating an Instance.
-
On the destination host, verify the $sapdata_home directory structure exists. Create the directory structure if it does not exist.
-
Copy, or restore the init<SID>.ora and init<SID>.sap files from the host to the destination host.
-
On the destination host, edit the $ORACLE_HOME/dbs/init<SID>.utl file.
Substitute the CvInstanceName, srcCrossClient and srccrossdbname parameters.
For information on the supported parameters, see Supported SAP for Oracle Util File Parameters
numstreams number_streams CvInstanceName Instance001 CvClientName destination_client_name srcCrossClient source_client_name srccrossdbname source_database_name destdbname destination_database_name -
The specification of the
CONTROL_FILESparameter in the database initialization parameter file (init<SID>.ora) for the target database must correspond to the specification for the source database. All control file mirror locations for the target database must correspond to the similar specification for the source database.Control file locations specified in the source and target database init<SID>.ora files should be similar to the following example.
Source:
CONTROL_FILES = (/oracle/PRD/sapdata1/cntrl/cntrlPRD.dbf /oracle/PRD/origlogA/cntrl/cntrlPRD.dbf /oracle/PRD/mirrorA/cntrl/cntrlPRD.dbf)Target:
CONTROL_FILES = (/oracle/CER/sapdata1/cntrl/cntrlCER.dbf /oracle/CER/origlogA/cntrl/cntrlCER.dbf /oracle/CER/mirrorA/cntrl/cntrlCER.dbf) -
Optional: To have the CommCell Console authenticate the job, configure the parameters for CommCell Console third-party job authentication.
Procedure
-
Manually copy the init<SOURCE_SID>.sap file from the source host to the destination host, substituting the <SOURCE_SID> variable.
You can use the BRRESTORE command instead of manually copying the file. On the destination host command line, type the following.
D:\scripts>brrestore -d util_file -b2 backup_id -m D:oracleproduct10.2.0db_1databaseinitSOURCE_SID.sap==D:oracleproduct10.2.0db_1databaseBRRESTORE Sample Output
backintCmd=[backint -u TRD -f restore -i D:\oracle\TRD\sapbackup\.rehkylvd.lst -t file -p d:\param.txt ] CommServeHostName=satishp CommHostHostName=sde-sap1.idcprodcert.loc Galaxy CommCellID=2 Galaxy HostID=219 Src Cross Host=<sde-sap2> getInstanceId for InstanceName=[CER] host=[sde-sap1.prodcert.loc] hostId=219 AppType=61 Failed Instance=[CER] - May not have been configured. Galaxy SrcCrossHostID=218 Galaxy CrossHostInstanceID=559 Galaxy CrossHostAppType=61 Galaxy CrossHostAppID=2283 Number of streams desired=<1> Number of files to restore=<1> CMDLINE Job Restore has been requested SID=[CER] BkpSet=[default] AppType=[61] Success in getting Job id=14424 Token=<14424:2:1> Success in init with JM Cannot obtain the Index MediaAgent from the Archive Manager.. Attaching CommServer Session AfileNumber=19929, AcommCellId=2 AgroupNumber=23 archfilename=D:\oracle\product\10.2.0\db_1\database\initCER.sap copy=36 BID=13310 reqBID=13310 afileFlags=4d BR0280I BRRESTORE time stamp: 2011-12-14 08.42.27 #FILE..... D:\oracle\product\10.2.0\db_1\database\initCER.sap D:\oracle\product\10.2.0\db_1\database\initCER.sap #RESTORED. 1021752_13310 Successful restore; 1 File(s); total transferred bytes=12616 Success in sending JMSUCCESS to server Success in sending JMSUCCESS to server BR0280I BRRESTORE time stamp: 2011-12-14 08.42.27 BR0374I 1 of 1 file restored by backup utility BR0230I Backup utility called successfully BR0406I End of file restore: rehkylvd.rsf 2011-12-14 08.42.27 BR0280I BRRESTORE time stamp: 2011-12-14 08.42.27 BR0402I BRRESTORE completed successfully
-
On the destination host, move or rename the file init<SOURCE_SID>.sap to init<DESTINATION_SID>.sap.
-
On the destination host, edit the init<SID>.sap file and change the <SOURCE_SID> parameter to the <DESTINATION_SID>.
Source Host Example
backup_root_dir = D:oracleSOURCE_SIDsapbackup stage_root_dir = D:oracleSOURCE_SIDsapbackup compress_cmd = "D:usrsapSOURCE_SIDsysexerunmkszip -c $ $" uncompress_cmd = "D:usrsapSOURCE_SIDsysexerununcompress -c $ $" compress_dir = D:oracleSOURCE_SIDsapreorg archive_copy_dir = D:oracleSOURCE_SID.sapbackup archive_stage_dir = D:oracleSOURCE_SIDsapbackupDestination Host Example
backup_root_dir = D:oracleSOURCE_SIDsapbackup stage_root_dir = D:oracleSOURCE_SIDsapbackup compress_cmd = "D:usrsapDESTINATION_SIDsysexerunmkszip -c $ >" uncompress_cmd = "D:usrsapDESTINATION_SIDsysexerununcompress -c $ $" compress_dir = D:oracleDESTINATION_SIDsapreorg archive_copy_dir = D:oracleSOURCE_SIDsapbackup archive_stage_dir = D:oracleSOURCE_SIDsapbackup -
Manually copy the init<SOURCE_SID>.ora file from the source host to the destination host, substituting the <SOURCE_SID> variable.
You can use the BRRESTORE command instead of manually copying the file. On the destination host command line, type the following, substituting the <SOURCE_SID> variable.
D:\scripts>brrestore -d util_file -b2 backup_id -m $[D:oracleproduct10.2.0db_1databaseinit.ora]==$[D:oracleproduct10.2.0db_1database] -
On the destination host, move or rename the init<SOURCE_SID>.ora file to init<DESTINATION_SID>.ora.
-
On the destination host, edit the init<DESTINATION_SID>.ora file and update the following parameters with the new directory structure. Substitute the <SOURCE_SID> and <DESTINATION_SID> variables.
control_files = (D:oracleDESTINATION_SIDsapdata1cntrlctrl D:oracleDESTINATION_SIDsapdata2cntrlctrl D:oracleDESTINATION_SIDsaparchcntrlctrl background_dump_dest = D:oracleDESTINATION_SIDsaptracebackground user_dump_dest = D:oracleDESTINATION_SIDsaptraceusertrace log_archive_dest = D:oracleDESTINATION_SIDsaparch db_name = DESTINATION_SID -
On the destination host, create an SPFILE from the PFILE. On the command line, type the following:
sqlplus / as sysdba SQL> Shutdown abort; SQL> startup nomount; SQL> create spfile from pfile;Full Output
D:\oracle\product\10.2.0\db_1\database>sqlplus / as sysdba SQL*Plus: Release 10.2.0.4.0 - Production on Wed Dec 14 09:21:51 2011 Copyright (c) 1982, 2007, Oracle. All Rights Reserved. Connected to an idle instance. SQL> Shutdown abort; SQL> startup nomount; ORACLE instance started. Total System Global Area 138412032 bytes Fixed Size 2063992 bytes Variable Size 125829512 bytes Database Buffers 8388608 bytes Redo Buffers 2129920 bytes SQL> create spfile from pfile; File created. SQL> -
On the destination host, restore the <SOURCE_SID>.log file by using the BRRESTORE command. On the command line, type the following command to restore the file, substituting the <SOURCE_SID> and <DESTINATION_SID> variables.
brrestore -d util_file -b2 backup_id -m D:oracleSOURCE_SIDsapbackupbackSOURCE_SID.log==D:oracleSOURCE_SIDsapbackupExample BRRESTORE Output
BR0401I BRRESTORE 7.20 (1) BR0405I Start of file restore: rehkyqtz.rsf 2011-12-14 09.37.35 BR0484I BRRESTORE log file: D:\oracle\TRD\sapbackup\rehkyqtz.rsf BR0280I BRRESTORE time stamp: 2011-12-14 09.37.35 BR0407I Restore of database: TRD BR0408I BRRESTORE action ID: rehkyqtz BR0409I BRRESTORE function ID: rsf BR0415I File for restore using backup utility ID backup_ID: D:\oracle\CER\sapbackup\backCER.log=D:\oracle\TRD\sapbackup BR0416I 1 file found to restore, size 0.000 MB BR0421I Restore device type: util_file BR0280I BRRESTORE time stamp: 2011-12-14 09.37.35 BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRRESTORE: c BR0280I BRRESTORE time stamp: 2011-12-14 09.37.37 BR0257I Your reply: 'c' BR0259I Program execution will be continued... BR0280I BRRESTORE time stamp: 2011-12-14 09.37.37 BR0229I Calling backup utility with function 'restore'... BR0278I Command output of 'backint -u TRD -f restore -i D:\oracle\TRD\sapbackup\.rehkyqtz.lst -t file -p d:\param.txt': Setting the Number of streams desired=<1> for 1 File restore. -------------------------- Output of restore ------------------------- BI_BACKUP=<PARTIAL> BI_CALLER=<BRRESTORE> BI_REQUEST=<NEW> -------------------------- Parameter Specified ------------------------- CvInstanceName=<Instance001> CvHostName=<sde-sap1> numstreams=<1> srccrosshost=<sde-sap2> srccrossdbname=<CER> destdbname=<TRD> -------------------------- backint Command Line -----------backintCmd=[backint -u TRD -f restore -i D:\oracle\TRD\sapbackup\.rehkyqtz.lst -t file -p d:\param.txt ] CommServeHostName=satishp CommHostHostName=sde-sap1.idcprodcert.loc Galaxy CommCellID=2 Galaxy HostID=219 Src Cross Host=<sde-sap2> getInstanceId for InstanceName=[CER] host=[sde-sap1.idcprodcert.loc] hostId=219 AppType=61 Failed Instance=[CER] - May not have been configured. Galaxy SrcCrossHostID=218 Galaxy CrossHostInstanceID=559 Galaxy CrossHostAppType=61 Galaxy CrossHostAppID=2283 Number of streams desired=<1> Number of files to restore=<1> CMDLINE Job Restore has been requested SID=[CER] BkpSet=[default] AppType=[61] Success in getting Job id=14429 Token=<14429:2:1> Success in init with JM Cannot obtain the Index MediaAgent from the Archive Manager.. Attaching CommServer Session AfileNumber=19914, AcommCellId=2 AgroupNumber=22 archfilename=D:\oracle\CER\sapbackup\backCER.log copy=35 BID=13310 reqBID=13310 afileFlags=0d BR0280I BRRESTORE time stamp: 2011-12-14 09.38.00 #FILE..... D:\oracle\CER\sapbackup\backCER.log D:\oracle\TRD\sapbackup\backCER.log #RESTORED. 1021752_13310 Successful restore; 1 File(s); total transferred bytes=2912 Success in sending JMSUCCESS to server Success in sending JMSUCCESS to server BR0280I BRRESTORE time stamp: 2011-12-14 09.38.01 BR0374I 1 of 1 file restored by backup utility BR0230I Backup utility called successfully BR0406I End of file restore: rehkyqtz.rsf 2011-12-14 09.38.01 BR0280I BRRESTORE time stamp: 2011-12-14 09.38.01 BR0402I BRRESTORE completed successfully -
On the destination host, move or rename the back<SOURCE_SID>.log file to back<DESTINATION_SID>.log.
You can use the BRRESTORE command instead of manually copying the file. On the destination host command line, type the following, substituting the <SOURCE_SID> and <DESTINATION_SID> variables.
brrestore -d util_file -b2 backup_id -m D:\oracle\SOURCE_SID\saparch\archSOURCE_SID.log==D:\oracle\DESTINATION_SID\saparch -
On the destination host, copy the arch<SOURCE_SID>.log log summary file from the source host to the destination host.
You can use the BRRESTORE command instead of manually copying the file. On the destination host command line, type the following, substituting the <SOURCE_SID>, BRBACKUP_detail_file and <DESTINATION_SID> variables.
brrestore -d util_file -b2 backup_id -m D:\oracle\SOURCE_SID\sapbackupbrbackup_detail_file==D:\oracleDESTINATION_SID\sapbackup -
On the destination host, copy the detail files from the sapbackup and the saparch source host directory onto the destination host.
You can use the BRRESTORE command instead of manually copying the file. On the destination host command line, type the following, substituting the <SOURCE_SID>, BRBACKUP_detail_file and <DESTINATION_SID> variables.
brrestore -d util_file -b2 backup_id -m D:\oracle\SOURCE_SID\saparchbrarchive_detail_file==D:\oracleDESTINATION_SID\saparch -
Identify the corresponding detail file in $SAPDATA_HOME/sapbackup directory or the $SAPDATA_HOME/sapbackup directory from the source host and then restore it. On the destination host command line, type the following, substituting the <SOURCE_SID>, BRBACKUP_detail_file and <DESTINATION_SID> variables.
brrestore -d util_file -b2 backup_id -m D:\oracle\SOURCE_SID\saparchbrarchive_detail_file==D:\oracleDESTINATION_SID\saparch -
On the destination host, copy the all of the files from the sapbackup and the saparch source host directory to the destination host. On the command line, type the following, substituting the <SOURCE_SID> and <DESTINATION_SID> variables.
brrestore -d util_file -b2 backup_id -m D:oracleinitSOURCE_SIDsapbackupfile_name.aff==D:oracleSOURCE_SIDsapbackup -
On the destination host perform a restore from the offline backup. On the command line, type the following command, substituting the <DESTINATION_SID> variable.
brrecover -f DESTINATION_SID -t reset -c force -
On the destination host, recover the BRBACKUP detail file. On the command line, type the following command, substituting the device_type, BRBACKUP_detail_file, device_type and SID variables.
Note:You must specify the full path for the BRBACKUP_detail_file.
brrecover -d device_type -c force -t dbpit -b BRBACKUP_detail_file -f SID -seq last -
On the destination host, recover to a log number. On the command line, type the following command, substituting the log_number, and SID variables .
brrecover -f SID -n log_number -
On the destination host, recover the database to the recover time. On the command line, type the following command, substituting the time to recover the database to.
brrecover -f SID -m time YYYY-MM-DD HH.MM.SS -c force