Skip to content

Building a Physical Standby Database (13/14) - Configure data guard broker

  • by
Building a Physical Standby Database (12/14) - Recover managed standby database

For 19c data guard broker, you may check the post: How to Configure 19c Data Guard Broker.

If you have ever used the broker to switchover, failover, switch apply instance, on and off transportation service or apply service, or fast-start failover, you would never miss the manual command. Therefore, the data guard broker is a nice-to-have function.

Before configuring the data guard broker, you must make sure two things:

  1. A static listener is added for the broker.
  2. The password files on 4 nodes are all the same.

We have done the above two things at step (02/14), if you are not familiar with these, you can check (02/14) for details.

Now, let's configure the broker.

  1. Make sure that both databases are started with spfile.
  2. Configure several initialization parameters on both databases.
  3. On primary database.
    SQL> alter system set DG_BROKER_START=false scope=memory;
    SQL> alter SYSTEM SET DG_BROKER_CONFIG_FILE1='+data/compdb/dr1primdb.dat';
    SQL> alter SYSTEM SET DG_BROKER_CONFIG_FILE2='+data/compdb/dr2primdb.dat';
    SQL> alter system set DG_BROKER_START=true scope=both;

    On standby database.
    SQL> alter system set DG_BROKER_START=false scope=memory;
    SQL> alter SYSTEM SET DG_BROKER_CONFIG_FILE1='+data/compdb/dr1standb.dat';
    SQL> alter SYSTEM SET DG_BROKER_CONFIG_FILE2='+data/compdb/dr2standb.dat';
    SQL> alter system set DG_BROKER_START=true scope=both;

  4. Configure the broker via DGMGRL.
  5. [oracle@primary01 ~]$ dgmgrl /
    ...
    DGMGRL> CREATE CONFIGURATION 'COMPDR' AS PRIMARY DATABASE IS 'primdb' CONNECT IDENTIFIER IS 'primdb';
    Configuration "COMPDR" created with primary database "primdb"
    DGMGRL> SHOW CONFIGURATION VERBOSE;

    Configuration - COMPDR

      Protection Mode: MaxPerformance
      Databases:
        primdb - Primary database

    Fast-Start Failover: DISABLED

    Configuration Status:
    DISABLED

    DGMGRL> ENABLE CONFIGURATION;
    Enabled.
    DGMGRL> ADD DATABASE standb AS CONNECT IDENTIFIER IS standb MAINTAINED AS PHYSICAL;
    Database "standb" added
    DGMGRL> ENABLE DATABASE standb;
    Enabled.
    DGMGRL> SHOW CONFIGURATION VERBOSE;

    Configuration - COMPDR

      Protection Mode: MaxPerformance
      Databases:
        primdb - Primary database
        standb - Physical standby database

    Fast-Start Failover: DISABLED

    Configuration Status:
    SUCCESS

    DGMGRL> SHOW DATABASE primdb;

    Database - primdb

      Role:            PRIMARY
      Intended State:  TRANSPORT-ON
      Instance(s):
        primdb1
        primdb2

    Database Status:
    SUCCESS

    DGMGRL> SHOW DATABASE standb;

    Database - standb

      Role:            PHYSICAL STANDBY
      Intended State:  APPLY-ON
      Transport Lag:   0 seconds
      Apply Lag:       0 seconds
      Real Time Query: OFF
      Instance(s):
        standb1
        standb2 (apply instance)

    Database Status:
    SUCCESS

The broker has been configured.

Building a Physical Standby Database (14/14) - Verify all settings are correct

Leave a Reply

Your email address will not be published.