What is Data Guard Broker

This article contains information about Data Guard Broker architecture, components, commands, configuration file, etc.

What is Data Guard Broker?

Broker is a distributed management framework that centralizes, simplifies and automates the creation, management and monitoring of Data Guard configurations.

Data guard broker has two components;

  1. Client Side
    • DGMGRL command interface
    • Enterprise Manager Cloud Control
  2. Server Side
    • DMON (Data Guard Monitor) Process
    • Configuration file

The working architecture of Data Guard Broker is as follows;

In summary; All commands run via DGMGRL or Cloud Control are written to the Configuration files in each instance as a result of the communication of all DMON processes in the environment with each other. Thus, the entire Data Guard Environment can be managed from a single center. It can be installed in a completely separate instance or via Primary Database.

What is Data Guard Broker DMON Process?

DMON is a background process of Oracle that allocates approximately 50 Kb of space in SGA when Data Guard Broker is started.

This process manages Data Guard by running on all instances including FAR SYNC instances in Data Guard configuration.

When a transaction is made with Enterprise Manager Cloud Control or DGMGRL, the DMON process running locally communicates with DMON processes running on instances on the remote side and performs the operations.

The DMON process is also responsible for monitoring whether the broker configuration is working properly and whether there are a consistent number of copies of the configuration file in all instances.

Configuration files are created in default as 2 files under ORACLE_HOME/dbs. These file’s names are dr1 <db_unique_name>.dat and dr2 <db_unique_name>.dat.

The DMON process uses only one of these files. The other is for backup. In RAC systems, these files should be located in a shared area (ASM).

In case of a problem, it creates trace and core files under ADR_HOME / trace in each instance.

Comparison of managing Data Guard in the presence and absence of the broker can be seen in the figure below.

Broker Startup Parameters

The database startup parameters controlled by the broker are below;

  • LOG_ARCHIVE_DEST_n
  • LOG_ARCHIVE_DEST_STATE_n
  • ARCHIVE_LAG_TARGET
  • PRESERVE_COMMIT_ORDER
  • RECORD_APPLIES_DDL
  • RECORD_SKIP_DDL
  • DB_FILE_NAME_CONVERT
  • LOG_ARCHIVE_FORMAT
  • LOG_ARCHIVE_MAX_PROCESSES
  • LOG_ARCHIVE_MIN_SUCCEED_DEST
  • LOG_ARCHIVE_TRACE
  • LOG_FILE_NAME_CONVERT
  • RECORD_SKIP_ERRORS
  • STANDBY_FILE_MANAGEMENT
  • MAX_EVENTS_RECORDED
  • MAX_SERVERS
  • MAX_SGA
  • PRESERVE_COMMIT_ORDER
  • RECORD_APPLIES_DDL
  • RECORD_SKIP_DDL
  • RECORD_SKIP_ERRORS

As soon as it is decided to continue the management of Data Guard using the Broker, even a single SQL command should not be run on databases in the environment.

Broker automatically uses the following Redo-Apply commands that are valid in Physical and Logical Standby.

  • ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
  • ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE

DGMRL Commands

The commands that can be run from DGMGRL are as follows;

  • ADD DATABASE: Adds a new standby database to the existing broker configuration
  • ADD FAR_SYNC: Adds an existing Far Sync instance to an Oracle Data Guard broker configuration
  • CONNECT: Connects to the specified database using the specified username
  • CONVERT DATABASE: Converts the specified database to either a snapshot standby database or a physical standby database
  • CREATE CONFIGURATION: Creates a broker configuration and adds a primary database to that configuration
  • DISABLE CONFIGURATION: Disables broker management of a configuration so that the configuration and all of its databases are no longer managed by the broker
  • DISABLE DATABASE: Disables broker management of the named standby database
  • DISABLE FAR_SYNC: Disables broker management of a Far Sync instance
  • DISABLE FAST_START FAILOVER: Disables fast-start failover
  • DISABLE FAST_START FAILOVER CONDITION: Allows a user to remove conditions for which a fast-start failover should be performed
  • EDIT CONFIGURATION (Property): Changes the value of a property for the broker configuration
  • EDIT CONFIGURATION (Protection Mode): Changes the current protection mode setting for the broker configuration
  • EDIT CONFIGURATION (RENAME): Changes the configuration name
  • EDIT CONFIGURATION RESET (Property): Resets the specified configuration property to its default value
  • EDIT DATABASE (Property): Changes the value of a property for the named database
  • EDIT DATABASE (Rename): Changes the name used by the broker to refer to the specified database
  • EDIT DATABASE (State): Changes the state of the specified database
  • EDIT DATABASE RESET (Property): Resets the specified property for the named database to its default value
  • EDIT FAR_SYNC: Changes the name, state, or properties of a Far Sync instance
  • EDIT FAR_SYNC RESET (Property): Resets the specified property for the named Far Sync instance to its default value
  • EDIT INSTANCE (AUTO PFILE): Sets the name of the initialization parameter file for the specified instance
  • EDIT INSTANCE (Property): Changes the value of a property for the specified instance
  • EDIT INSTANCE RESET (Property): Resets an instance-specific property for the specified instance(s) to its default value
  • ENABLE CONFIGURATION: Enables broker management of the broker configuration and all of its databases
  • ENABLE DATABASE: Enables broker management of the specified database
  • ENABLE FAR_SYNC: Enables broker management of the specified Far Sync instance
  • ENABLE FAST_START FAILOVER: Enables the broker to automatically fail over from the primary database to a target standby database
  • ENABLE FAST_START FAILOVER CONDITION: Allows a user to add conditions for which a fast-start failover should be performed
  • EXIT: Exits the Data Guard command-line interface
  • FAILOVER: Performs a database failover operation in which the standby database to which DGMGRL is currently connected fails over to the role of primary database
  • HELP: Displays online help for the Data Guard command-line interface
  • QUIT: Quits the Data Guard command-line interface
  • REINSTATE DATABASE: Reinstates the database after a failover
  • REMOVE CONFIGURATION: Removes the broker configuration and ends broker management of its members
  • REMOVE DATABASE: Removes the specified standby database from the broker configuration
  • REMOVE FAR_SYNC: Removes a Far Sync instance from an Oracle Data Guard broker configuration
  • REMOVE INSTANCE: Removes an instance from the broker configuration
  • SHOW CONFIGURATION: Displays information about the broker configuration
  • SHOW DATABASE: Displays information about the specified database
  • SHOW FAR_SYNC: Shows information about a Far Sync instance
  • SHOW FAST_START FAILOVER: Displays all fast-start failover–related information
  • SHOW INSTANCE: Displays information about the specified instance
  • SHUTDOWN: Shuts down a currently running Oracle database
  • SQL: Allows you to enter SQL statements from the Data Guard command-line interface (DGMGRL)
  • START OBSERVER: Starts the observer
  • STARTUP: Starts an Oracle instance with the same options as SQL*Plus, including mounting and opening a database
  • STOP OBSERVER: Stops the observer
  • SWITCHOVER: Performs a switchover operation in which the current primary database becomes a standby database, and the specified standby database becomes the primary database
  • VALIDATE DATABASE: Performs a comprehensive set of database checks prior to a role change

Data Guard Broker Requirements

  • Databases in Data Guard Environment must be in Enterprise Edition.
  • In order to benefit from the features provided by 12c, COMPATIBLE parameter should be minimum 12.1.
  • Oracle Net Services (listener.ORA) settings must be made completely. In this context, a listener in the format db_unique_name_DGMGRL.db_domain must be created for each instance.

Add an Instance to Data Guard Broker Environment

To add any instance in the Data Guard Broker Environment, the DG_BROKER_START start parameter must be set to TRUE.

Databases in the Broker Environment must be in MOUNT or OPEN mode.

In RAC systems, the DG_BROKER_CONFIG_FILEn parameter should be configured to point to a shared area. In default the configuration files are under $ORACLE_HOME/dbs. The files are in binary format. With the ALTER SYSTEM command, the default directory and name used are changed.

Before starting the Data Guard Broker configuration, all LOG_ARCHIVE_DEST_n parameter that has the SERVICE attribute used in all instances in the environment is deleted.

Another indispensable feature for Data Guard Broker is that all databases in the environment must be opened from SPFILE.

The work done by the DMON process is in the same location as ALERT LOG, and for each instance it is named drc <$ ORACLE_SID> .log.

Onur ARDAHANLI
Author: Onur ARDAHANLI

Leave a Reply

Your email address will not be published. Required fields are marked *