Sunday 7 July 2013

Oracle Disaster Recovery setup for SAP

Data Guard Configuration


        A Data Guard configuration consists of one production database and one or more standby databases. The databases in a Data Guard configuration are connected by Oracle Net and may be dispersed geographically. There are no restrictions on where the databases are located, provided they can communicate with each other. For example, you can have a standby database on the same system as the production database, along with two standby databases on other systems at remote locations.

You can manage primary and standby databases using the SQL command-line interfaces or the Data Guard broker interfaces, including a command-line interface and a graphical user interface that is integrated in Oracle Enterprise Manager.

Primary Database


          A Data Guard configuration contains one production database, also referred to as the primary database that functions in the primary role. This is the database that is accessed by most of our applications. The primary database can be either a single-instance Oracle database or an Oracle Real Application Clusters database.

Standby Database


          A standby database is a transitionally consistent copy of the primary database. Using a backup copy of the primary database, you can create up to nine standby databases and incorporate them in a Data Guard configuration. Once created, Data Guard automatically maintains each standby database by transmitting redo data from the primary database and then applying the redo to the standby database. Similar to a primary database, a standby database can be either a single-instance Oracle database or an Oracle Real Application Clusters database.

A standby database can be either a physical standby database or a logical standby database:

Parameter Settings:


initPRD.ora parameters:


Parameter for Primary Database:-



Data Guard Parameter for Primary

*.db_name='PRD'
*.log_archive_dest_1='LOCATION=/oracle/PRD/oraarch'
*.log_archive_dest_2='service=PRD_STBY.WORLD reopen=1800'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.fal_server='PRD_STBY.WORLD'
*.fal_client='PRD_PRIM.WORLD'
*.standby_archive_dest='/oracle/PRD/oraarch'
*.standby_file_management='AUTO'
*.service_names='PRD.WORLD'

Parameter for Standby Database:-


Data Guard Parameter for Standby
*.db_name='PRD'
*.log_archive_dest_1='LOCATION=/oracle/PRD/oraarch'
*.log_archive_dest_2='service=PRD_PRIM.WORLD reopen=1800'
*.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='DEFER'
*.fal_server='PRD_PRIM.WORLD'
*.fal_client='PRD_STBY.WORLD'
*.standby_archive_dest='/oracle/PRD/oraarch/'
*.standby_file_management='AUTO'
*.service_names='PRD_STBY.WORLD'

Oracle-net Service Configuration.


TNS Names Entries for Primary: (tnsnames.ora)

PRD.WORLD =
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
                (COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = Primary host)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRD)
(GLOBAL_NAME = PRD.WORLD)
)
)
PRD_PRIM.WORLD =
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = Primary host)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRD)
(GLOBAL_NAME = PRD.WORLD)
)
)
PRD_STBY.WORLD=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = DR host)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRD)
(GLOBAL_NAME = PRD_STBY.WORLD)
)
)



TNS Names Entries for Standby: (tnsnames.ora)

PRD.WORLD =
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
                (COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = DR host)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRD)
(GLOBAL_NAME = PRD.WORLD)
)
)
PRD_PRIM.WORLD =
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = Primary host)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRD)
(GLOBAL_NAME = PRD.WORLD)
)
)
PRD_STBY.WORLD=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = DR host)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRD)
(GLOBAL_NAME = PRD_STBY.WORLD)
)
)

Listener.ora Paramaters:

Listner.ora entries for Primary:

LISTENER =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = PRD.WORLD)
)
(ADDRESS=
(PROTOCOL = IPC)
(KEY = PRD)
)
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = Primary host)
(PORT = 1527)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SDU = 32768)
(SID_NAME = PRD)
(ORACLE_HOME = /oracle/PRD/102_64)
)
)

Listner.ora entries for Standby:

LISTENER =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = PRD.WORLD)
)
(ADDRESS=
(PROTOCOL = IPC)
(KEY = PRD)
)
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = DR host)
(PORT = 1527)
)
)
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SDU = 32768)
(SID_NAME = PRD)
(ORACLE_HOME = /oracle/PRD/102_64)
)
)


Operational Procedures:


Start up and Shut down a Physical Standby Database:


The following steps are used to start a standby database:

1. Start the database:
SQL> STARTUP NOMOUNT;
2. Mount the standby database:
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
3. Start the managed recovery operation:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT
2> FROM SESSION;

The following steps show you how to shut down a standby database:
1. Find out if the standby database is performing managed recovery. If the 
MRP0 or MRP process exists, then the standby database is performing managed recovery.
SQL> SELECT PROCESS, STATUS FROM V$MANAGED_STANDBY;
2. Cancel managed recovery operations.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
3. Shut down the standby database.
SQL> SHUTDOWN IMMEDIATE;


Cheers !!!

SAP Webdispatcher Installation and configuration

Download SAP WEBDISPATCHER executables from service market place
http://service.sap.com/patches

SAP NETWEAVER --> SAP NETWEAVER 04 -->Binary Patches -->SAP KERNEL (32/64Bit, unicode/non-unicode) -->Database Independent.

Download the kernel packet DW.SAR, this contains the SAP Web dispatcher (sapwebdisp).

Create a new directory in D:\usr\sap as sapwebdispatcher

Copy files sapwebdisp and icmadmin.SAR into this directory from downloaded DW.SAR

Extract icmadmin.SAR using SAPCAR

Generation of profile for the first time run command

D:\usr\sap\sapwebdisp>sapwebdisp –bootstrap

Then provide input as prompted

rdisp/mshost=hostname1
ms/http_port=8112
Instance number for SAP Webdispatcher = 11
HTTP Port number for SAP WebDispatcher=8011

Create configuration for Small(S)

It will generate Auth file icmauth.txt

Note down the user name and password from that window itself

Sapwebdisp.pfl,Add another line for redirecting URLs(Example for EP)

icm/HTTP/admin_0= PREFIX/sap/wdisp/admin,DOCROOT=./admin,AUTHFILE=icmauth.txt

icm/http/redirect_0 = /prefix=/, TO=/irj/portal,port 51100,HOST=EPHOST

Start the WEBDISPATCHER using

sapwebdisp pf=sapwebdisp.pfl - auto_restart

Now we can access portal using webdispatcher server
http://hostname1:8011/irj/portal



Cheers !!!