Disaster Recovery Oracle
Disaster Recovery Oracle
April 2008
SAP AG Neurottstrae 16 69190 Walldorf Germany T +49/18 05/34 34 24 F +49/18 05/34 34 20 www.sap.com
Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, R/3, xApps, xApp, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML, and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology.
are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
Where to Find this Documentation You can find this documentation at the following address: http://www.sdn.sap.com/irj/sdn/ora
Typographic Conventions
Type Style Example Text Represents Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Cross-references to other documentation. Example text Emphasized words or phrases in body text, graphic titles, and table titles. Technical names of system objects. These include report names, program names, transaction codes, table names, and key concepts of a programming language when they are surrounded by body text, for example, SELECT and INCLUDE. Output on the screen. This includes file and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Exact user entry. These are words or characters that you enter in the system exactly as they appear in the documentation. Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. Keys on the keyboard, for example, F2 or ENTER.
Icons
Icon Meaning Caution Example Note Recommendation Syntax
EXAMPLE TEXT
Example text
Example text
<Example text>
EXAMPLE TEXT
Contents
Introduction ...............................................................................................................5 Restoring the Hardware and Operating System .....................................................5 Installing the Database and SAP Software .............................................................5 Creating the File Systems ........................................................................................6 I. Disaster Recovery with BRRECOVER ..................................................................6
Disaster Recovery Phases with BRRECOVER ......................................................................... 6 Performing Disaster Recovery with BRRECOVER................................................................... 7
April 2008
Introduction
If you lose your entire system (possibly including hardware) and you have not taken any special precautions against this (for example, an Oracle standby configuration), you must restore the system step-by-step. This document describes how to reinstall your system and how to keep data loss to a minimum by using the SAP tools BRRECOVER and BRRESTORE.
You can automatically perform the most important disaster recovery steps, especially the restore of profiles and log files, with BRRECOVER. We strongly recommend you to use BRRECOVER for disaster recovery. The procedures described here explain the interconnections. Only use these procedures in an exceptional situation. Note the following: UNIX Environment variables Windows
$ORACLE_HOME $SAPDATA_HOME
sqlplus $ORACLE_HOME/dbs
The default values for these variables are as follows: UNIX Windows
Windows: If the SAPARCH, SAPBACKUP, or SAPREORG directories are not located under %SAPDATA_HOME%, use the corresponding environment variables %SAPARCH%, %SAPBACKUP% or %SAPREORG%. The separator character used in UNIX / must be replaced with \ for Windows.
April 2008
BRRECOVER
Disaster recovery consists of these phases: 1. Select restore from BRBACKUP or BRARCHIVE backup. You select the BRBACKUP or BRARCHIVE backup that contains the required profiles and logs. 2. Select restore device type phase
April 2008
You select the device to be used from the following possibilities: o o o o o Local tape Remote tape Local disk Remote disk Backup utility
3. Specify restore parameters phase Depending on your choice of restore device type, you specify appropriate restore parameters. 4. Select profiles and log files phase You select the profiles and log files that you want to restore from the following: Backup profile Oracle profile BACKINT / mount profile util_par_file Detail log from one of the following: o o BRARCHIVE detail Log BRBACKUP detail Log
Summary log from one of the following o o o o o BRARCHIVE summary Log BRBACKUP summary Log BRSPACE summary Log BRSPACE structure Change Log BRSPACE parameter Change Log
The control file must only be reloaded here when the offline redo log files were saved with RMAN after the last run of BRBACKUP was started. 5. Restore selected profiles and log files phase BRRECOVER directly restores the selected profiles and log files without calling BRRESTORE. 6. Select detail logs for restore phase You select the detail logs that you want to restore. You can only select logs on the selected restore device type, such as a disk or external backup tool (BACKINT). For tape device type, the details logs are determined by the mounted tape volume. 7. Restore selected detail logs phase BRRECOVER directly restores the selected detail logs from the disk, tape, or external backup tool without calling BRRESTORE.
April 2008
You use this process if either of the following is true: You have lost the entire database, including the profiles and the BRBACKUP logs or the BRARCHIVE logs.
You have only lost the profiles and the BRBACKUP or BRARCHIVE logs. This process does not actually restore data files or recover redo log files. It only restores the profiles and BRBACKUP or BRARCHIVE logs from copies that you made during previous backups. Therefore, it prepares the database for you to perform one of the following guided BR*Tools options: Database point-in-time (PIT) recovery Whole database reset Complete database recovery and database PIT recovery are not possible after disaster recovery because the current control file (required for complete database recovery) is missing and the database cannot be opened (required for tablespace PIT recovery).
Only perform this process if you are an expert in Oracle database administration. Even as an expert, we recommend that you first try other types of recovery supported by BR*Tools. If you are not an expert, you might severely damage the database with this procedure. You might lose data and cause downtime to fix the problem. Prerequisites Since this function is designed for experts, the usual safeguards are not present: o o o There is no database status check. You have less guidance than otherwise, since BRRECOVER cannot offer you default choices in all situations. You can choose individual actions independently.
For all procedures, the backup medium with the required backup files must obviously be present. You need to know exactly which file to restore and where it is. You are effectively performing a copy at operating-system level. BRRECOVER restores the profiles and logs to the standard directory. If you choose device type Backup utility for the restore, note the following: o o The BACKINT repository with the latest backup must be available because the tapes are administered using this repository in the backup utility. The BACKINT parameter file must normally exist, depending on the specific implementation that you are using. If it is required but is unavailable, you must first try and recreate it before performing disaster recovery. BRRECOVER calls BACKINT to perform the restore. BACKINT performs the restore of the profiles or logs from the latest backup.
o o Process
1. You start BRGUI or BRTOOLS. 2. You choose Restore and recovery 3. You choose the required procedure: o Restore profiles and logs files from BRBACKUP backup Disaster recovery.
April 2008
BRRECOVER starts the restore and displays the menu Device Type.
4. You choose the device tape where the backups of the profiles or logs are stored. BRRECOVER displays the parameters for restoring the profiles or logs, depending on what kind of device type you specified. The default parameters are taken from the current profile, initialization profile init<DBSID>.sap, if available. 5. For a disk backup or a utility backup, you note the following: o For a disk backup, you can specify the backup directory. BRRECOVER looks in the subdirectory <DBSID> of the specified directory to find the summary log for BRBACKUP or BRARCHIVE. It uses the information there for the restore. For a utility backup, check Prerequisites above.
6. You choose Continue to continue the restore with the displayed parameters. BRRECOVER warns you that the profiles and logs might be overwritten. BRRECOVER displays the restore menu where you can specify which profiles and logs to restore: o o If a log or profile already exists on disk, the recommendation is No to avoid overwriting it. If a log or profile does not exist on disk, the recommendation is Yes to let you restore it.
7. If required, you change the recommended values for restoring the profiles and logs. You can select several profiles or logs to restore. 8. You choose Continue to start restoring the selected profiles or logs. 9. You check the results in the BRRECOVER logs: o o The summary log recov<DBSID>.log displays the return code. The detail log v<encoded timestamp>.drv displays the progress.
April 2008
UNIX cd $ORACLE_HOME/dbs mt -f /dev/ rewind mt -f dev/ fsf 2 cpio -ivuB < /dev/
If you have configured a different block size in the init<DBSID>.sap parameter cpio_flags, you must use this same block size when restoring.
Alternatively you can quickly restore all logs from the BRBACKUP tape into the current directory using a single BRRESTORE command: brrestore n all_log Then copy the individual logs into the correct directories.
April 2008
10
Remove the BRBRACKUP tape from the tape drive and replace it with the BRARCHIVE tape of the last backup of the offline redo log files. Now restore the BRARCHIVE summary log, $SAPDATA_HOME/saparch/arch<DBSID>.log, from the BRARCHIVE tape by entering the following commands: OS> cd $SAPDATA_HOME/saparch OS> brrestore -n sum_log OS> cd $SAPDATA_HOME/sapreorg OS> brrestore n control_file
The last command above, which reloads the control file, is only necessary when the offline redo log files were saved with RMAN after the last run of BRBACKUP was started. If the control file is reloaded, you must copy it to all the original locations defined in the Oracle parameter control_files. Remove the BRARCHIVE tape from the tape drive and replace it with the BRBACKUP tape.
April 2008
11
$SAPDATA_HOME/sapreorg/cntrl<DBSID>.dbf
The last item above, for the control file, is only necessary when the offline redo log files were saved with RMAN after the last run of BRBACKUP was started. If the control file is reloaded, you must copy it to all the original locations defined in the Oracle parameter control_files. The procedure described above is complex. Alternatively, you can use the external tool's restore function.
If you want to perform further recovery, do not open the database at this point. This can happen after the restore of an offline backup.
Recovery Procedure
Remove the BRBRACKUP tape from the tape drive and replace it with the BRARCHIVE tape. Restore the required offline redo log files: OS> brrestore -a <log_seg_No_A>-<log_seg_No_B> <Log_Seg_No_A> is the current log sequence number found in the header of the BRBACKUP log. <Log_Seg_No_B> corresponds to the sequence number of the last offline redo log file backed up (that is, the last entry in the summary BRARCHIVE log: arch<DBSID>.log). You can perform database recovery using the Oracle SQLPLUS as follows (mount the database only if not yet done): SQL> connect / as sysdba SQL> set autorecovery off SQL> startup mount SQL> recover database using backup controlfile until cancel
April 2008
12
You must confirm every recovery step with ENTER. After the entire recovery procedure is finished, complete this step with cancel.
Additional Information
SAP Library
You can find more information on Oracle database administration and the contents of this document in the SAP Library as follows:
All paths refer to Release SAP NetWeaver Process Integration 7.1 of the SAP Library. 1. Call up the SAP Help Portal at help.sap.com/nwpi71 KNOWLEDGE CENTER FOR SAP NETWEAVER PROCESS INTEGRATION 7.1 SAP NetWeaver Process Integration Library English. 2. Choose Administrators Guide Technical Operations for SAP NetWeaver Administration of Databases Database Administration for Oracle SAP Database Guide: Oracle Approach to Oracle DBA Restore and Recovery Disaster Recovery.
You can also find this plus selected extracts from the SAP Library at: www.sdn.sap.com/irj/sdn/ora Documentation in Help Portal SAP on Oracle Knowledge Center SAP
SAP Notes
You can find SAP Notes at: service.sap.com/notes
April 2008
13