Oracle Database 11g Release 2 Data Guard deployment using Oracle Grid Control 10.2.0.
This article describes the creation of a standby database using Oracle Database 11g Release 2 and the Oracle Grid Control on the same server, how to perform a switchover from primary to standby database and a switchover from the ex-standby to the original primary. We will look at Data Guard configuration verification using OEM Grid Control and how to reconfigure the Data Guard for example set redo transport to SYNCH and setting up an active Data Guard open for read only. The article assumes the following software components are present, installed and configured. y y y Grid Control (10.2.0.5). An example installation can be found in previous posts. A primary database server, with Oracle Database 11g Release 2 software installed and an the existing database is present as a primary. In this article we look at creating a standby database with data guard on the same server for testing. To deploy the concept in real life the following prerequisites needs to be met. y y All servers need to have an Oracle EM Grid Control agent install All servers need to have the binaries (software only) for Oracle 11g R2 installed.
With this setup in place, the standby database is created and managed from Oracle Grid Control as follows. y y y y Standby Database Creation Switchover Data Guard Verification Data Guard Re-configuration
Standby Database Creation
As the Oracle 11g R2 databases are configured to listen to port 1522 we need to set up the local_listener initialization parameter on the existing Oracle 11g R2 database that will be designated for a primary database..
1. Set listener in $TNS_ADMIN/tnsnames.ora as follows. (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = linuxoel54.gj.com)(PORT = 1522)) ) (CONNECT_DATA = (SERVICE_NAME = db11gr2) ) ) 2. The parameter local_listener is a static parameter. After setting the parameter please bounce the instance. SQL>alter system set local_listener = µlistener¶ scope=spfile SQL>shutdown immediate; ««««««««««««««««««««««««.. SQL>startup open; SQL> show parameter local_listener NAME local_listener SQL> LISTENER = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = linuxoel54.gj.com)(PORT = 1522)) ) (CONNECT_DATA = (SERVICE_NAME = db11gr2) ) ) TYPE string VALUE listener LISTENER =
------------------------------------ ----------- ------------------------------
Navigate to the "Availability" tab of the primary database server (Targets > Databases > (Primary Database Name) > Availability). Click on the "Add Standby Database" link under the "Data Guard" section of the page.
On the resulting page, click on the "Add Standby Database" link.
Accept the "Create a new physical standby database" option by clicking the "Continue" button.
then click the "Next" button. if they have not already been defaulted as a preferred credentials.
Enter the "Primary Host Credentials".Accept the "Perform an online backup of the primary database" and "Use Recovery Manager (RMAN) to copy the files" options by clicking the "Next" button.
Enter the name of the standby host and its host credentials. then click the "Next" button.
Since we use a single server for both primary and standby database we keep the $ORACLE_HOME and $TNS_ANMES as the same Oracle 11g R2 binaries are shared and accept the suggested Oracle Optimal Flexible Architecture directory structure.
. then click the "Next" button.
then click the "Next" button.Enter a "Database Unique Name" and "Target Name" and select the "Use SYSDBA monitoring credentials" option.
. Notice the "Use Data Guard Broker" option is checked.
If you are happy with the information on the review page.
. then click the "Finish" button.
Wait while the first section of processing completes. The job will be submitted after completion of several preliminary steps.The standby database creation process runs as an Enterprise Manager job.
with the new standby database listed.Once the basic processing is complete. Towards the bottom of the screen is a list of available standby databases.
. you are presented with the Data Guard "Setup and Manage" screen. The status of the new database is "Creation in process". Clicking on this status link gives a breakdown of the current processing.
.Expand the "Task: DBClone" node for a more detailed status of the operation.
The image below shows an example of the expanded progress.
When the standby database creation is complete.
. the "Setup and Manage" screen will display a status of "Normal" for the standby database.
The "Availability" tab now includes several new links in the "Data Guard" section.
DATABASE_ROLE from v$database. CONTROL PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE
SQL> select CONTROLFILE_TYPE. INSTANCE_NAME ----------------
.-------------------. PROTECTION_LEVEL.---------------CURRENT MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PRIMARY SQL> select instance_name from v$instance. PROTECTION_MODE.-------------------.
PROTECTION_LEVEL. DATABASE_ROLE from v$database.-------------------. PROTECTION_MODE. then click the "Switchover" button. navigate to the "Setup and Manage" screen.---------------STANDBY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE PHYSICAL STANDBY SQL> select instance_name from v$instance. INSTANCE_NAME ---------------Db11gr2s SQL>
To perform a switchover. select the standby server you wish to become the new primary server.-------------------.
. CONTROL PROTECTION_MODE PROTECTION_LEVEL DATABASE_ROLE
SQL> select CONTROLFILE_TYPE.
.Accept the "Swap Monitoring Settings" and "Transfer Jobs" options by clicking the "OK" button.
Wait while the switchover processing takes place.
Once complete. the "Setup and Manage" screen shows the primary and standby roles have been reversed.
Select µSwap Monitoring Settings¶ and µTransfer Jobs¶ and press OK.
.Lets perform a switchover to db11gr2 and have make db11gr2 a primary database. Select db11gr2 and press Switchover button.
Data Guard Verification
Select µVerify configuration¶
Wait for the OEM Grid Control to perform checks of the various databases settings.
. Press OK to continue.Upon successful completion of the verification the detailed results are displayed.
.We are displayed the screen below.
. Select the link under Data Guard status.
Select Redo Apply Services and µApply on¶ and µEnable Read real-time query¶ and press OK.Data Guard re-configuration
Let¶s look at the features of OEM Grid Control for reconfiguring Data Guard.
.Wait until the database property changes get applied.
Lets¶ change the redo transport mode to SYNCH.
. Press Apply to continue.
.Wait until configuration completes.
.After completion we will notice that the changes have been implemented.
We also refreshed how to use the OEM Grid Control for Data Guard verification.Conclusion
I this article we looked at how easy and cost effective is to setup a Data Guard with OEM Grid Control.
. We performed switchover to the standby database and from new primary database to the original database using OEM Grid Control. We covered the additional reconfiguration of Data Guard by setting a SYNH redo log transport and setting an active standby database opened in read only mode while the redo keep on being applied.