Create Data Guard Broker Configuration

This notes shows process of creating broker configuration for a DR including a primary, physical standby and a logical standby. The DR system was previously established and demonstrated in note “Creating both physical and logical standby database in a DR environment“.

DR environment

  • Primary database
    • db_name=DB11R2;
    • db_unique_name=DB11R2;
    • fal_client=DB11R2;
    • fal_server=(DB11R2DR, DB11R2LS)
  • Physical standby database
    • db_name=DB11R2;
    • db_unique_name=DB11R2DR;
    • fal_client=DB11R2DR;
    • fal_server=(DB11R2, DB11R2LS)
  • Logical standby database
    • db_name=DB11R2;
    • db_unique_name=DB11R2LS;
    • fal_client=DB11R2LS
    • fal_server=(DB11R2, DB11R2DR)

Change initialization parameters related to Data Guard Broker

Connect to primary database, physical standby and logical standby, change the following initialization parameters

  • dg_broker_start (default is false, it will start a set of background processes – DMON, RSM, NSVn, DRCn, etc )
  • dg_broker_config_file1 (copy 1 of configuration file, by default it’s stored in $ORACLE_HOME/dbs)
  • dg_broker_config_file2 (copy 2 of configuration file, by default it’s stored in $ORACLE_HOME/dbs)

On the primary database

sys@db11r2> alter system set dg_broker_config_file1='/app/oracle/oradata/DB11R2/dr1DB11R2.dat';
sys@db11r2> alter system set dg_broker_config_file2='/app/oracle/oradata/DB11R2/dr21DB11R2.dat';
sys@db11r2> alter system set dg_broker_start=true;

On the physical standby database

sys@db11r2dr> alter system set dg_broker_config_file1='/app/oracle/oradata/DB11R2DR/dr1DB11R2.dat';
sys@db11r2dr> alter system set dg_broker_config_file2='/app/oracle/oradata/DB11R2DR/dr21DB11R2.dat';
sys@db11r2dr> alter system set dg_broker_start=true;

On the logical standby database

sys@db11r2ls> alter system set dg_broker_config_file1='/app/oracle/oradata/DB11R2LS/dr1DB11R2.dat';
sys@db11r2ls> alter system set dg_broker_config_file2='/app/oracle/oradata/DB11R2LS/dr21DB11R2.dat';
sys@db11r2ls> alter system set dg_broker_start=true;

Register Data Guard service to local listener

A specific service must be statically registered with a local listener on each database. The service has a value of format <db_unique_name>_DGMGRL.<db_domain>.

Listener.ora on the primary database

LISTENER =
 (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=gchen-pc.localdomain)(PORT=1521))
 )

SID_LIST_LISTENER =
  (SID_LIST =
        (SID_DESC =
        (GLOBAL_DBNAME = DB11R2)
        (ORACLE_HOME = /app/oracle/product/11.2.0/db)
        (SID_NAME = DB11R2)
        )
        (SID_DESC =
        (GLOBAL_DBNAME = DB11R2_DGMGRL)
        (ORACLE_HOME = /app/oracle/product/11.2.0/db)
        (SID_NAME = DB11R2)
        )
   )

Reload the listener configuratioin

[oracle@gchen-pc admin]$ lsnrctl reload

listener.ora on the physical standby database

LISTENER =
 (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=gchen-pc.localdomain)(PORT=1521))
 )

SID_LIST_LISTENER =
  (SID_LIST =
        (SID_DESC =
        (GLOBAL_DBNAME = DB11R2DR)
        (ORACLE_HOME = /app/oracle/product/11.2.0/db)
        (SID_NAME = DB11R2DR)
        )
        (SID_DESC =
        (GLOBAL_DBNAME = DB11R2DR_DGMGRL)
        (ORACLE_HOME = /app/oracle/product/11.2.0/db)
        (SID_NAME = DB11R2DR)
        )
   )

Reload the listener configuratioin

[oracle@gchen-pc admin]$ lsnrctl reload

listener.ora on the logical standby database

LISTENER =
 (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=gchen-pc.localdomain)(PORT=1521))
 )

SID_LIST_LISTENER =
  (SID_LIST =
        (SID_DESC =
        (GLOBAL_DBNAME = DB11R2LS)
        (ORACLE_HOME = /app/oracle/product/11.2.0/db)
        (SID_NAME = DB11R2LS)
        )
        (SID_DESC =
        (GLOBAL_DBNAME = DB11R2LS_DGMGRL)
        (ORACLE_HOME = /app/oracle/product/11.2.0/db)
        (SID_NAME = DB11R2LS)
        )
   )

Reload the listener configuratioin

[oracle@gchen-pc admin]$ lsnrctl reload

Create broker configuration

1. Invoke DGMGRL and connect to primary database

when connecting to primary database, give username/password. You can not enter “/ as sysdba”, since some operations are not executable, e.g. role change service.

[oracle@gchen-pc admin]$ export ORACLE_SID=DB11R2
[oracle@gchen-pc admin]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.

DGMGRL> connect sys/iamsys

2. Create Broker configuration with a profile of primary database


DGMGRL> create configuration 'DB11R2_DG_CONFIG' as
>       primary database is 'DB11R2'
>       connect identifier is DB11R2;

Configuration "DB11R2_DG_CONFIG" created with primary database "DB11R2"

3. Add a profile of physical standby database to Broker configuration


DGMGRL> add database 'DB11R2DR' as
>       connect identifier is DB11R2DR
>       maintained as physical;
Database "DB11R2DR" added

4. Add a profile of logical standby database to Broker configuration

 DGMGRL> add database 'DB11R2LS' as
>       connect identifier is DB11R2LS
>       maintained as logical;
Database "DB11R2LS" added

 

5. Check current configuration

 DGMGRL> show configuration;

Configuration - DB11R2_DG_CONFIG

 Protection Mode: MaxPerformance
 Databases:
 DB11R2   - Primary database
 DB11R2DR - Physical standby database
 DB11R2LS - Logical standby database

Fast-Start Failover: DISABLED

Configuration Status:
DISABLED

 

Enabling Broker configuration

1. Enable the Broker configuration. It may take a few minutes to complete.

 DGMGRL> enable configuration;
Enabled.

2 Check current status of the configuration


DGMGRL> show configuration;

Configuration - DB11R2_DG_CONFIG

Protection Mode: MaxPerformance
Databases:
DB11R2   - Primary database
DB11R2DR - Physical standby database
Error: ORA-16797: database is not using a server parameter file

DB11R2LS - Logical standby database
Error: ORA-16797: database is not using a server parameter file

Fast-Start Failover: DISABLED

Configuration Status:
ERROR

The Broker configuration complains that the physical standby and logical standby are not currently using spfiles. Correct these errors and try it again


DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;

Configuration - DB11R2_DG_CONFIG

 Protection Mode: MaxPerformance
 Databases:
 DB11R2   - Primary database
 DB11R2DR - Physical standby database
 DB11R2LS - Logical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: