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

1 comment:

  1. wow.. very nice.. complete information given on the oracle disaster recovery solutions, perfect blog. High quality content and very valuable for the information seeker. Really thanks for sharing.

    ReplyDelete