Loading...

BR*Tools Example: Performing a Cross-Machine Restore to a Different SAP on Oracle SID Using the BRRECOVER Command

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

  1. On the source host, locate the detail file name and the summary file name of the data and log backups to be restored.
  2. On the destination host, create an instance for the database that you want to restore. For more information, see Creating an Instance.
  3. On the destination host, verify the $sapdata_home directory structure exists. Create the directory structure if it does not exist.
  4. Copy, or restore the init<SID>.ora and init<SID>.sap files from the host to the destination host.
  5. 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

  6. The specification of the CONTROL_FILES parameter 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)

  7. Optional: To have the CommCell Console authenticate the job, configure the parameters for CommCell Console third-party job authentication.

Procedure

  1. 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:\oracle\product\10.2.0\db_1\database\init<SOURCE_SID>.sap==D:\oracle\product\10.2.0\db_1\database

    BRRESTORE Sample Output

  2. On the destination host, move or rename the file init<SOURCE_SID>.sap to init<DESTINATION_SID>.sap.
  3. On the destination host, edit the init<SID>.sap file and change the <SOURCE_SID> parameter to the <DESTINATION_SID>.

    Source Host Example

    Destination Host Example

    backup_root_dir = D:\oracle\<DESTINATION_SID>\sapbackup
    stage_root_dir = D:\oracle\<DESTINATION_SID>\sapbackup
    compress_cmd = "D:\usr\sap\<DESTINATION_SID>\sys\exe\run\mkszip -c $ > $"
    uncompress_cmd = "D:\usr\sap\<DESTINATION_SID>\sys\exe\run\uncompress -c $ > $"
    compress_dir = D:\oracle\<DESTINATION_SID>\sapreorg
    archive_copy_dir = D:\oracle\<DESTINATION_SID>\sapbackup
    archive_stage_dir = D:\oracle\<DESTINATION_SID>\sapbackup

  4. 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:\oracle\product\10.2.0\db_1\database\init<SOURCE_SID>.ora==D:\oracle\product\10.2.0\db_1\database

  5. On the destination host, move or rename the init<SOURCE_SID>.ora file to init<DESTINATION_SID>.ora.
  6. 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:\oracle\<DESTINATION_SID>\sapdata1\cntrl\ctrl
    D:\oracle\<DESTINATION_SID>\sapdata2\cntrl\ctrl
    D:\oracle\<DESTINATION_SID>\saparch\cntrl\ctrl
    background_dump_dest = D:\oracle\<DESTINATION_SID>\saptrace\background
    user_dump_dest = D:\oracle\<DESTINATION_SID>\saptrace\usertrace
    log_archive_dest = D:\oracle\<DESTINATION_SID>\saparch
    db_name = DESTINATION_SID

  7. 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

  8. 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:\oracle\SOURCE_SID\sapbackup\back<SOURCE_SID>.log==D:\oracle\<DESTINATION_SID>\sapbackup

    Example BRRESTORE Output

  9. 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\arch<SOURCE_SID>.log==D:\oracle\<DESTINATION_SID>\saparch

  10. 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>\sapbackup\<brbackup_detail_file>==D:\oracle\<DESTINATION_SID>\sapbackup

  11. 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>\saparch\<brarchive_detail_file>==D:\oracle\<DESTINATION_SID>\saparch

  12. 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>\saparch\<brarchive_detail_file>==D:\oracle\<DESTINATION_SID>\saparch

  13. 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:\oracle\init<SOURCE_SID>\sapbackup\file_name.aff==D:\oracle\<DESTINATION_SID>\sapbackup

  14. 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

  15. 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

  16.  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>

  17. 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

Last modified: 4/21/2019 6:43:44 PM