Follow these steps outlined by Muhammad Abdul Jamil to configure a disaster recovery server in the form of a standby database of the SAP production server in your SAP landscape. You then can go to the standby database if your primary database goes down.
Key Concept
When companies buy SAP ERP with Oracle they can download Oracle from service.sap.com and use a utility called Data Guard. With the help of this software/utility you can create a standby database to use in case your production system goes down.
Note
Mount is a mode in the Oracle database in which the database is not open.
Note
This article is intended for SAP technical and Basis teams and Oracle database administrators.
Prerequisites
A Step-by-Step Guide to System Refresh on the Quality Assurance ServerDisaster Recovery Configuration
Note
In this configuration, the hostnames (also known as system names) and
database names of both systems are the same, while the database unique
name must be changed on the target system.
Source System
Note
The term set refers to setting the parameters of PRD and DRP.
PFILE of Source System
LISTENER.ORA of Source System
TNSNAMES.ORA of Source System
You also need to replace the hostname with an IP address. Open the TNSNAME.ORA and put IP address against HOST in below code of TNSNAMES.ora as mentioned in Figure 1. This file exists in ORACLE_HOMEnetworkadmin and SAP profile folderoracle. You also need to replace the IP in file TNSNAMES.ORA.
DRP.WORLD=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = SAP.WORLD)(PROTOCOL = TCP)(HOST = 172.20.0.2)(PORT = 1527))
)
(CONNECT_DATA =
(SID = PRD)
(SERVER = DEDICATED)
)
Figure 1
Replace the IP in TNSNAMES.ora
You need to alter the database with the help of command number 16 to move the data files from the source system to the target system. The files exist under oraclePRD.
Target System
LISTENER.ORA of the Target System
TNSNAMES.ora of the Target System
Figure 2
DRP.WORLD=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (COMMUNITY = SAP.WORLD)(PROTOCOL = TCP)(HOST = 172.20.0.2)(PORT = 1527))
)
(CONNECT_DATA =
(SID = PRD)
(SERVER = DEDICATED)
)
Figure 2
Replace the IP in TNSNAMES
Replace the (SERVER = DEDICATED) with (GLOBAL_NAME = PRD.WORLD) in TNSNAMES.ORA.
Log into sqlplus via the following command on the target system.
Run > sqlplus / as sysdba
Now you need to create an SPFILE from the PFILE you have already created (that you copied from the source system with the help of command number 15) and copy it from the source system.
When you create the SPFILE from the PFILE then all parameters of PFILE are copied in the SPFILE because the database starts with SPFILE. You can create this file via command number 19.
SQL>create spfile from pfile;
Command 19 [Create SP file From P File]
Replace that control file in the origA and origB sapdata1 folders that you created with the help of command number 17. Rename the file with the target name of congrtolfile because the name of control file in origA is different from origB and sapdata1. You can also delete the log files from origA, origB, and MirrorA,B.
Next, start up the database in mount mode with command number 20.
SQL> startup mount
Command 20 [Startup database in mount]
Now you need to create the orig and mirror logs with the help of command number 21. You select the text and copy and paste it in SQL. Press Enter and all orig and mirror logs files are created.
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 ('G:ORACLEPRDORIGLOGALOG_G15M1.DBF','G:ORACLEPRDMIRRLOGALOG_G15M2.DBF') SIZE 200M, GROUP 6 ('G:ORACLEPRDORIGLOGBLOG_G16M1.DBF','G:ORACLEPRDMIRRLOGBLOG_G16M2.DBF') SIZE 200M, GROUP 7 ('G:ORACLEPRDORIGLOGALOG_G17M1.DBF','G:ORACLEPRDMIRRLOGALOG_G17M2.DBF') SIZE 200M, GROUP 8 ('G:ORACLEPRDORIGLOGBLOG_G18M1.DBF','G:ORACLEPRDMIRRLOGBLOG_G18M2.DBF') SIZE 200M, GROUP 9 ('G:ORACLEPRDORIGLOGBLOG_G19M1.DBF','G:ORACLEPRDMIRRLOGBLOG_G19M2.DBF') SIZE 200M;
Restarting the System
Read-Only Mode
Switch-Over System/UP
Muhammad Abdul Jamil
Muhammad Abdul Jamil is an SAP Basis Administrator at the Orient Group of Companies. He has more than four years of SAP Basis experience. He has a degree in computer science and has worked in industries such as Beverages, Home Appliances, Food, and Chemicals. Previously, he worked at Siemens Pakistan Consulting and he completed four SAP projects (E2E) as a SAP technical (Basis) consultant at Siemens Pakistan Consulting.
You may contact the author at majamil1@hotmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.