How to configuring Data Guard Broker

We will see how we can configure Data Guard Broker to monitor standby database. With the help of Broker, we can create and monitor databases in the data guard configuration.

Step 1

Ensure that database parameter dg_broker_start is set to false. Remove existing broker configuration files. See here how to remove the existing broker configuration files safely.

The below show parameter dg_broker_config_file shows how we can identify the existing broker configuration files.

SQL> show parameter dg_broker_config_file

NAME                      TYPE       VALUE
------------------------- ---------- ----------------------------------------------------
dg_broker_config_file1     string    /u03/app/oracle/product/11.2.0/db3/dbs/dr1voice.dat
dg_broker_config_file2     string    /u03/app/oracle/product/11.2.0/db3/dbs/dr2voice.dat

Remove both the configuration files

$ rm /u03/app/oracle/product/11.2.0/db3/dbs/dr1voice.dat
$ rm /u03/app/oracle/product/11.2.0/db3/dbs/dr2voice.dat
Step 2

Now, enable data guard broker process. It is done using below command :

SQL> alter system set dg_broker_start = TRUE scope = both;

Once we set dg_broker_start to TRUE, we can see the process dmon running

$ ps -eaf | grep -i dmon
oracle 18466 1 0 Nov15 ? 00:05:02 ora_dmon_orcl
Step 3

Stop the listener to edit listener.ora entries to add static entry GLOBAL_DBNAME = <DB_UNIQUE_NAME>_DGMGRL

$ lsnrctl stop LISTENER_VOICE

Edit listener.ora to add GLOBAL_DBNAME = <DB_UNIQUE_NAME>_DGMGRL

   (sid_list =
      (sid_desc =
           (GLOBAL_DBNAME = voice_dgmgrl)
           (ORACLE_HOME = /u03/app/oracle/product/11.2.0/db3)
           (SID_NAME = voice)
      (ADDRESS =
          (HOST =
          (PORT = 1522)
          (PROTOCOL = tcp)

Start the listener

$ lsnrctl start LISTENER_VOICE

We notice that the value of GLOBAL_DBNAME appears as the the service name

Services Summary...
Service "voice_dgmgrl" has 1 instance(s).
  Instance "voice", status UNKNOWN, has 1 handler(s) for this service...
Step 4

Change in listener.ora calls for a change in soure tnsname.ora entry as below

voice =
   (description =
      (address =
         (host= = 1522)(protocol=tcp)
      (connect_data =
         (server = dedicated)
           (service_name= voice_dgmgrl)
Step 5

Start dgmgrl

$ . oraenv 
$ dgmgrl 
DGMGRL for Linux: Version - 64bit Production 

Copyright (c) 2000, 2009, Oracle. All rights reserved. 

Welcome to DGMGRL, type "help" for information. 

Create configuration using create configuration command as below :

dgmgrl> create configuration "<configuration name>"
primary database is "<DB_UNIQUE_NAME of primary database>"
connect identifier is <connect identifier to primary database>;

Now, lets add physical standby database to the broker configuation :

dgmgrl> add database "<DB_UNIQUE_NAME of standby database>"
as connect identifier is "<connect identifier to standby database>";

Setting up the configuration is not sufficient for the broker to work. We need to enable the confuguration with below command :

dgmgrl> enable configuration;

To see the configuration settings, use the below command :

dgmgrl> show configuration;