Beginners Guide to Oracle Data Guard Broker

The Oracle Data Guard broker is a distributed management framework. The broker automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations.

Oracle Data Guard Broker: Features

The following are some of the operations that the broker automates and simplifies:

  • Automated creation of Data Guard configurations incorporating a primary database, a new or existing standby database, redo transport services, and log apply services. Note: Any of the databases in the configuration can be a Real Application Clusters (RAC) database.
  • Adding new or existing standby databases to each existing Data Guard configuration, for a total of one primary database and from one to 30 standby databases in the same configuration
  • Managing an entire Data Guard configuration (including all databases, redo transport services, and log apply services) through a client connection to any database in the configuration
  • Invoking switchover or failover with a single command to initiate and control complex role changes across all databases in the configuration
  • Monitoring the status of the entire configuration, capturing diagnostic information, reporting statistics (such as the log apply rate and the redo generation rate), and detecting problems quickly with centralized monitoring testing and performance tools

Data Guard Broker: Components

The Oracle Data Guard broker consists of both client-side and server-side components.

On the client, you can use the following Data Guard components to define and manage a configuration:

  • Oracle Enterprise Manager Cloud Control
  • DGMGRL, which is the Data Guard command-line interface (CLI)

On the server, the Data Guard monitor is a broker component that is integrated with the Oracle database. The Data Guard monitor comprises the Data Guard monitor (DMON) process and broker configuration files, with which you can control the databases of that configuration, modify , g ,p their behavior at run time, monitor the overall health of the configuration, and provide notification of other operational characteristics.

The configuration file contains profiles that describe the current state and properties of each database in the configuration. Associated with each database are various properties that the DMON process uses to control the database’s behavior. The properties are recorded in the configuration file as a part of the database’s object profile that is stored there. Many database properties are used to control database initialization parameters related to the Data Guard environment.

Data Guard Broker: Configurations

A Data Guard configuration consists of one primary database and up to 30 standby databases or Far Sync locations. The databases in a Data Guard configuration are typically dispersed geographically and are connected by Oracle Net.

A Data Guard configuration consists of one primary database and up to 30 standby databases or Far Sync locations. The databases in a Data Guard configuration are typically dispersed geographically and are connected by Oracle Net.

Data Guard Broker: Management Model

The Data Guard broker performs operations on the following logical objects:

  • Configuration of databases
  • Single database

A broker configuration consists of:

  • Configuration object: A named collection of database profiles. A database profile is a description of a database object, including its current state, current status, and properties.
  • Database objects: Objects corresponding to primary or standby databases.
  • Instance objects: Instance objects: A database object may comprise one or more instance objects if it is A database object may comprise one or more instance objects if it is a RAC database

The broker supports one or more Data Guard configurations, each of which includes a profile for one primary database as well as profiles for up to 30 physical, logical, RAC or non-RAC standby databases. Far Sync destinations are also counted towards the limit of 30 locations.

Data Guard Broker: Architecture

The Data Guard broker helps you create, control, and monitor a Data Guard configuration. This configuration consists of a primary database that is protected by one or more standby databases. After the broker has created the Data Guard configuration, the broker monitors the activity, health, and availability of all systems in that configuration.

The Data Guard monitor process (DMON) is an Oracle background process that runs on every instance that is managed by the broker, including Far Sync instances. When you start the Data Guard broker, a DMON process is created.

When you use Enterprise Manager or the Data Guard command-line interface (CLI), the DMON process is the server-side component that interacts with the local instance and the DMON processes that are running on other sites to perform the requested function The processes that are running on other sites to perform the requested function. The DMON process is also responsible for monitoring the health of the broker configuration and for ensuring that every instance has a consistent copy of the configuration files in which the DMON process stores its configuration data. There are two multiplexed versions of the configuration file on each database.

Data Guard Monitor: DMON Process

The Data Guard monitor comprises two components: the DMON process and the configuration file.

The DMON process is an Oracle background process that is part of each database instance managed by the broker. When you start the Data Guard broker, a portion of the SGA is allocated and a DMON process is created. The amount of memory allocated is typically less than 50 KB per site; the actual amount on your system varies.

When you use Enterprise Manager or the CLI, the DMON process is the server-side component that interacts with the local instance and the DMON processes running on other sites to perform the requested function.

The DMON process is also responsible for monitoring the health of the broker configuration and for ensuring that every database has a consistent copy of the broker configuration files in which the DMON process stores its configuration data.

The DIAGNOSTIC_DEST parameter defines the location for diagnostic files such as trace files and core files. The structure of the directory specified by DIAGNOSTIC_DEST is as follows:

[diagnostic_dest]/diag/rdbms/[dbname]/[instance_name]/

This location is known as the Automatic Diagnostic Repository (ADR) Home. The DMON trace files are located in the /trace subdirectory.

In Summary:

  • A server-side background process
  • A part of each database instance in the configuration
  • Created when you start the broker
  • Performs requested functions and monitors the resource Performs requested functions and monitors the resource
  • Communicates with other DMON processes in the configuration
  • Updates the configuration file
  • Creates the drc trace file in the location set by the DIAGNOSTIC_DEST initialization parameter
  • Modifies initialization parameters during role transitions as necessary

Benefits of Using the Data Guard Broker

  • Enhances the high-availability, data protection, and disaster protection capabilities inherent in Oracle Data Guard by automating both configuration and monitoring tasks
  • Streamlines the process for any one of the standby databases to replace the primary database and take over production processing
  • Enables easy configuration of additional standby databases
  • Provides simplified centralized and extended management Provides simplified, centralized, and extended management
  • Automatically communicates between the databases in a Data Guard configuration by using Oracle Net Services
  • Provides built-in validation that monitors the health of all databases in the configuration

By automating the tasks required to configure and monitor a Data Guard configuration, the broker enhances the high-availability, data protection, and disaster protection capabilities that are inherent in Oracle Data Guard. If the primary database fails, the broker streamlines the process for any one of the standby databases to replace the primary database and take over production processing.

The broker enables easy configuration of additional standby databases. After creating a Data Guard configuration consisting of two databases—a primary and standby—you can add up to 29 additional standby databases to the existing two for each Data Guard configuration.

Comparing Configuration Management With and Without the Data Guard Broker

The table below provides an overview of configuration management with and without the Data Guard broker.

Feature With the Broker Without the Broker
General Manage databases as one Manage databases separately
Creation of the standby database Use Enterprise Manager (EM) Cloud Control wizards Manually create files
Configuration and management Configure and manage from single interface Set up services manually for each database
Monitoring Monitor continuously, Unified status and reports, Integrate with EM events Monitor each database individually through views
Control Invoke role transitions with a single command. Coordinate sequences of multiple commands across database sites for role transitions.

Data Guard Broker Interfaces

  • Command-line interface (CLI): – Is started by entering DGMGRL at the command prompt where the Oracle server or an Oracle client is installed – Enables you to control and monitor a Data Guard configuration from the prompt or in scripts
  • Oracle Enterprise Manager Cloud Control: – Provides wizards to simplify creating and managing standby databases

DGMGRL Command line interface

Command-line interface (CLI) is started by entering DGMGRL at the command prompt where the Oracle server or an Oracle client is installed. It enables you to control and monitor a Data Guard configuration from the prompt or in scripts.

The DGMGRL command-line interface includes:

  • Configuration and setup tasks
  • Management and control of the configuration
  • Commands to check the status and health of the configuration
  • Commands to execute role changes

Oracle Enterprise Manager Cloud Control

Oracle Enterprise Manager Cloud Control provides wizards to simplify creating and managing standby databases.

Oracle Enterprise Manager (EM) Cloud Control includes the following Data Guard features:

  • Wizard-driven creation of standby databases
  • Wizard-driven creation of a broker configuration based on an existing databases
  • Complete monitoring and proactive event reporting through email or pagers
  • Simplified control of the databases through their potential states. For example, with Enterprise Manager you can start or stop the redo transport services, start or stop the log apply services, and place a standby database in read-only mode.
  • “Pushbutton” switchover and failover. EM enables you to execute a switchover or failover between a primary and a standby database by simply clicking a button.

Broker Controlled Database Initialization Parameters

The broker controls the following parameters:

  • 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
  • LOG_FILE_NAME_CONVERT
  • STANDBY_FILE_MANAGEMENT
  • MAX_EVENTS_RECORDED
  • MAX_SERVERS
  • MAX_SGA

The Data Guard broker directly controls the database initialization parameters listed above. After defining a Data Guard broker configuration, you should use DGMGRL or Enterprise Manager Cloud Control to manage your configuration. You should not use SQL commands to manage the databases, because you could cause a conflict with the broker. The broker also uses configurable property settings to manage how redo apply and SQL apply are started. Therefore, the following SQL statements are managed automatically by the broker:

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

Using the Command-Line Interface of the Data Guard Broker

DGMGRL Commands

The following commands are available in DGMGRL (the Data Guard CLI). Many of these commands have additional arguments that are not described here.

DGMGRL> connect sysdg/password
Connected.

DGMGRL> show configuration
Configuration - DRSolution
  Protection Mode: MaxPerformance
  Databases:
  boston - Primary database
    bostonFS - Far Sync
      london - Physical standby database
      london2 - Logical standby database
    londonFS - Far Sync (inactive) Far Sync (inactive)

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS
  • 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 for which a fast-start failover should be performed 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 EDIT CONFIGURATION RESET (Property): Resets the specified configuration property (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 EDIT DATABASE RESET (Property): Resets the specified property for the named (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 SHOW INSTANCE: Displays information about the specified 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 mounting and opening a database
  • STOP OBSERVER: Stops the observer