Data Guard Broker Configuration
Here is an example on creating Data Guard Broker configuration using DGMGRL.
Primary and standby database server details:
Primary Server: ora1-1.mydomain Database: SRPRIM
Standby Server: ora1-2.mydomain Database: SRPSTB
Primary Database Details:
SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance; STATUS INSTANCE_NAME DATABASE_ROLE PROTECTION_MODE ------ ------------- ------------- --------------- OPEN srprim PRIMARY MAXIMUM AVAILABILITY SQL> select max(sequence#) from v$archived_log; MAX(SEQUENCE#) -------------- 350
Standby Database Details:
SQL> select status,instance_name,database_role,protection_mode from v$database,v$instance; STATUS INSTANCE_NAME DATABASE_ROLE PROTECTION_MODE ------- ------------- ---------------- -------------------- MOUNTED srpstb PHYSICAL STANDBY MAXIMUM AVAILABILITY SQL> select max(sequence#) from v$archived_log where applied='YES'; MAX(SEQUENCE#) -------------- 350
By default, the DG Broker configuration files are located at “$ORACLE_HOME/dbs” location. If you need to change it, then you can by using “alter system set dg_broker_config_file1=<required location>”. Similarly for “dg_broker_config_file2”.
Remember that, on a RAC system, the DG broker configuration files need to be placed on a shared location where in it can be accessed by all the nodes.
On both primary and standby databases, enable the dataguard broker process by setting the value of the parameter “DG_BROKER_START” to TRUE.
SQL> alter system set dg_broker_start=true;
Add a static entry for the DGMGRL in the listener.ora file on both the primary and standby servers.
On Primary:
(SID_DESC= (GLOBAL_DBNAME=srprim_dgmgrl) (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1) (SID_NAME=srprim) )
On Standby:
(SID_DESC= (SID_NAME=srpstb) (GLOBAL_DBNAME=srpstb_dgmgrl) (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1) )
Listener.ora file contents on primary server:
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ora1-1.mydomain)(PORT = 1 521)) ) ) SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=srprim_dgmgrl) (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1) (SID_NAME=srprim) ) (SID_DESC= (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1) (SID_NAME=krat) ) ) ADR_BASE_LISTENER = /u01/app/oracle ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
Listener.ora file contents on standby server:
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522)) (ADDRESS = (PROTOCOL = TCP)(HOST = ora1-2.mydomain)(PORT = 1 522)) ) ) SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (SID_NAME=srpstb) (GLOBAL_DBNAME=srpstb_dgmgrl) (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1) ) (SID_DESC= (SID_NAME=srpstb) (ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1) ) ) ADR_BASE_LISTENER = /u01/app/oracle ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
On the primary server, create the Dataguard Broker configuration.
[oracle@ora1-1 ~]$ dgmgrl DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production Copyright (c) 2000, 2009, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> connect sys/oracle@srprim Connected. DGMGRL> create configuration 'dgtest' > as primary database is 'srprim' > connect identifier is srprim; Configuration "dgtest" created with primary database "srprim" DGMGRL> DGMGRL> show configuration; Configuration - dgtest Protection Mode: MaxAvailability Databases: srprim - Primary database Fast-Start Failover: DISABLED Configuration Status: DISABLED
Add the standby database “SRPSTB” to the configuration created above.
DGMGRL> DGMGRL> add database 'srpstb' > as connect identifier is srpstb > maintained as physical; Database "srpstb" added DGMGRL> DGMGRL> show configuration; Configuration - dgtest Protection Mode: MaxAvailability Databases: srprim - Primary database srpstb - Physical standby database Fast-Start Failover: DISABLED Configuration Status: DISABLED
The configuration added, needs to be enabled.
DGMGRL> enable configuration; Enabled. DGMGRL> show configuration Configuration - dgtest Protection Mode: MaxAvailability Databases: srprim - Primary database srpstb - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS
Here we go !!
COPYRIGHT
© Shivananda Rao P, 2012 to 2018. Unauthorized use and/or duplication of this material without express and written permission from this blog’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Shivananda Rao and http://www.shivanandarao-oracle.com with appropriate and specific direction to the original content.
DISCLAIMER
The views expressed here are my own and do not necessarily reflect the views of any other individual, business entity, or organization. The views expressed by visitors on this blog are theirs solely and may not reflect mine.
Hi Shiva,
Thanks for your lovely topic which is very helpful.
Could you please write a topic on Flashback technology (some scenarios).
Sure Varun. Will be adding posts on Flashback as well.
Regards,
Shivananda