Configure DataGuard broker 19c
Oracle Data Guard Broker provides a centralized framework to manage and monitor an entire Data Guard configuration through a unified client interface. The broker simplifies complex administrative tasks, automates failover operations, and ensures configuration consistency across all databases in your Data Guard environment.
Table of Contents
- Data Guard Broker Overview
- Architecture and Configuration Files
- Key Benefits and Capabilities
- Prerequisites
- Removing Existing Broker Configuration
- Disabling Archive Destinations
- Enabling Data Guard Broker
- Creating Broker Configuration
- Enabling and Verifying Configuration
- Configuration Management
Data Guard Broker Overview
Data Guard Broker is Oracle’s enterprise-class management layer that sits above the core Data Guard infrastructure. It provides a unified interface for managing complex Data Guard topologies with multiple standby databases, automating routine tasks, and ensuring configuration consistency.
What is Data Guard Broker?
- Centralized Management Framework: Manage entire Data Guard configurations through a single client connection to any database in the configuration
- Command-Line Interface (DGMGRL) : Powerful CLI for configuration, monitoring, and management operations
- Automated Operations : Simplifies switchover and failover with single-command execution
- Unified Configuration : Eliminates the need for multiple SQL*Plus sessions across different databases
- Configuration Persistence : Maintains configuration details in binary flat files stored at each database location
Broker Limitations
DGMGRL (Command Line Interface) does not have the ability to create standby databases from scratch. Use RMAN Active Duplicate or Oracle Enterprise Manager Cloud Control GUI for standby database creation. The CLI is primarily used for configuration management and operational tasks after standby databases are established.
Architecture and Configuration Files
Configuration File Storage
The broker maintains its configuration metadata in binary flat files rather than within the database itself. This design ensures that configuration information remains accessible even when databases are not mounted or open.Configuration File Parameters
Two initialization parameters control the location of broker configuration files:- DG_BROKER_CONFIG_FILE1 – Primary configuration file location
- DG_BROKER_CONFIG_FILE2 – Secondary configuration file location (redundancy)
File Location Examples
SQL> SHOW PARAMETER dg_broker_config
NAME TYPE VALUE
———————————— ———– ———————-——————-—–——————-————-
dg_broker_config_file1 string +DATA/woravr/dr1woravr.dat
dg_broker_config_file2 string +DATA/woravr/dr2woravr.dat
Key Benefits and Capabilities
Simplified Switchover/Failover
Execute role transitions with a single command, minimizing downtime associated with planned maintenance or unplanned outages. The broker performs all pre-checks and validation automatically.
Unified Configuration Management
Replace multiple SQL*Plus statements across different databases with a single unified interface. All configuration changes are automatically propagated to all members.
Automated Monitoring
Continuous health monitoring of all databases in the configuration with automatic detection of lag, apply rate issues, and connectivity problems.
Fast-Start Failover
Optional automatic failover capability that detects primary database failures and initiates failover to a designated standby database without manual intervention.
Configuration Validation
Performs comprehensive pre-checks before role transitions to ensure all prerequisites are met, reducing the risk of failed switchover or failover operations.
Centralized Property Management
Manage Data Guard-related initialization parameters through broker properties, ensuring consistency across all databases in the configuration.
Prerequisites
Before configuring Data Guard Broker, ensure the following conditions are met:
- Data Guard Configuration: A functioning Data Guard configuration with at least one standby database
- Network Connectivity: TNS connectivity established between all databases in the configuration
- Matching Software Versions: All databases running the same Oracle Database version
- Unique DB_UNIQUE_NAME: Each database must have a unique DB_UNIQUE_NAME parameter
- Compatible Parameter: The COMPATIBLE parameter should be set consistently across all databases
- Valid TNS Entries: Properly configured tnsnames.ora entries on all nodes
Step 1: Removing Existing Broker Configuration
If you have an existing broker configuration that needs to be reconfigured or removed, start by cleanly removing the current configuration.
1. Connect to DGMGRL and Remove Configuration
[oracle@west01 ~]$ dgmgrl DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 20 15:51:38 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> remove configuration; Removed configuration DGMGRL> show configuration; ORA-16532: Oracle Data Guard broker configuration does not exist Configuration details cannot be determined by DGMGRL
Step 2: Disabling LOG_ARCHIVE_DEST_2
Before enabling Data Guard Broker, clear the LOG_ARCHIVE_DEST_2 parameter on both primary and standby databases. The broker will manage this parameter automatically once enabled.Disable on Primary Database
2Clear Archive Destination on Primary
SQL> SHOW PARAMETER log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- -----------------
log_archive_dest_2 string SERVICE=woravrdr LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,
PRIMARY_ROLE)
DB_UNIQUE_NAME=woravrdr
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='' SCOPE=BOTH;
System altered.
SQL> SHOW PARAMETER log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- -----------------
log_archive_dest_2 string
Disable on Standby Database
3. Clear Archive Destination on Standby
SQL> SHOW PARAMETER log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- -----------------
log_archive_dest_2 string SERVICE=woravr LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,
PRIMARY_ROLE)
DB_UNIQUE_NAME=woravr
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='' SCOPE=BOTH;
System altered.
SQL> SHOW PARAMETER log_archive_dest_2
NAME TYPE VALUE
------------------------------------ ----------- -----------------
log_archive_dest_2 string
Step 3: Enabling Data Guard Broker
The DG_BROKER_START parameter controls whether the Data Guard Broker is active on each database. This must be set to TRUE on all databases that will participate in the broker configuration.Enable Broker on Primary Database
4. Enable DG Broker Process on PrimarySQL> SHOW PARAMETER dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ----------------- dg_broker_start boolean TRUE -- If not already TRUE, reset the broker process SQL> ALTER SYSTEM SET dg_broker_start=FALSE SCOPE=BOTH; System altered. SQL> ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH; System altered. SQL> SHOW PARAMETER dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ----------------- dg_broker_start boolean TRUE
Enable Broker on Standby Database
5. Enable DG Broker Process on StandbySQL> SHOW PARAMETER dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ----------------- dg_broker_start boolean TRUE -- If not already TRUE, reset the broker process SQL> ALTER SYSTEM SET dg_broker_start=FALSE SCOPE=BOTH; System altered. SQL> ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH; System altered. SQL> SHOW PARAMETER dg_broker_start NAME TYPE VALUE ------------------------------------ ----------- ----------------- dg_broker_start boolean TRUE
Step 4: Creating Data Guard Broker Configuration
Connect to DGMGRL and create a new broker configuration. The configuration is named and includes the primary database as the initial member. 6Connect to DGMGRL on Primary Database[oracle@west01 ~]$ dgmgrl DGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Apr 20 15:51:38 2021 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> connect / Connected to "woravr" Connected as SYSDG.
- connect / – Uses operating system authentication (requires DBA group membership)
- connect sys/password@tns_name as sysdg – Uses password authentication
Create Broker Configuration with Primary Database
7. Create Configuration and Add PrimaryDGMGRL> create configuration 'woravr' as
primary database is 'woravr'
connect identifier is woravr;
Configuration "woravr" created with primary database "woravr"
Add Standby Database to Configuration
8. Add Physical Standby Database
DGMGRL> add database 'woravrdr' as
connect identifier is woravrdr
maintained as physical;
Database "woravrdr" added
Verify Configuration Creation
9. Display Configuration StatusDGMGRL> show configuration; Configuration - woravr Protection Mode: MaxPerformance Members: woravr - Primary database woravrdr - Physical standby database Fast-Start Failover: DISABLED Configuration Status: DISABLED
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Configuration Not Yet Active At this stage, the configuration exists but is not yet enabled. The DISABLED status means the broker is not actively managing the Data Guard environment. You must explicitly enable the configuration for the broker to take control.
Step 5: Enabling and Verifying Configuration
Reconfigure Archive Destinations
Before enabling the broker configuration, ensure that LOG_ARCHIVE_CONFIG and LOG_ARCHIVE_DEST_2 are properly configured on both databases.
10. Configure Archive Parameters on Primary
SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG=
'DG_CONFIG=(woravr,woravrdr)'
SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2=
'SERVICE=woravrdr LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=woravrdr'
SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG=
'DG_CONFIG=(woravr,woravrdr)'
SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2=
'SERVICE=woravr LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=woravr'
SCOPE=BOTH;
System altered.
Enable the Broker Configuration
12. Activate Broker Management .DGMGRL> enable configuration; Enabled
Verify Configuration Status
13. Check Configuration HealthDGMGRL> show configuration; Configuration - woravr Protection Mode: MaxPerformance Members: woravr - Primary database woravrdr - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 6 seconds ago)
14. View Standby Database Details
DGMGRL> show database 'woravrdr';
Database - woravrdr
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Average Apply Rate: 6.00 KByte/s
Real Time Query: OFF
Instance(s):
woravrdr1
woravrdr2
Database Status:
SUCCESS
- Transport Lag: 0 seconds – Redo is being shipped in real-time
- Apply Lag: 0 seconds – Standby is fully synchronized with primary
- Intended State: APPLY-ON – Managed recovery is active
- Database Status: SUCCESS – No errors or warnings detected
Configuration Management Commands
Common DGMGRL Operations
| Operation | Command | Purpose |
| Show Configuration | SHOW CONFIGURATION; | Display overall configuration status |
| Show Database | SHOW DATABASE ‘db_name’; | Display detailed database information |
| Validate Configuration | VALIDATE DATABASE ‘db_name’; | Check database readiness for role transition |
| Switchover | SWITCHOVER TO ‘standby_name’; | Perform planned role reversal |
| Failover | FAILOVER TO ‘standby_name’; | Perform emergency failover |
| Disable Database | DISABLE DATABASE ‘db_name’; | Temporarily remove database from management |
| Enable Database | ENABLE DATABASE ‘db_name’; | Resume management of database |
| Edit Property | EDIT DATABASE ‘db_name’ SET PROPERTY… | Modify database-level properties |
| Remove Database | REMOVE DATABASE ‘db_name’; | Remove database from configuration |
| Reinstate Database | REINSTATE DATABASE ‘db_name’; | Reconnect failed primary as standby |
Useful Property Management
Display Database Properties
DGMGRL> show database 'woravrdr' LogXptMode; LogXptMode = 'ASYNC' DGMGRL> show database 'woravrdr' ApplyLagThreshold; ApplyLagThreshold = '30'
-- Change redo transport mode to synchronous DGMGRL> edit database 'woravrdr' set property LogXptMode='SYNC'; Property "LogXptMode" updated -- Enable Active Data Guard (read-only standby) DGMGRL> edit database 'woravrdr' set state='APPLY-ON' with REAL TIME APPLY; Succeeded.
Performing a Switchover Operation
Validate Switchover Readiness
DGMGRL> validate database 'woravrdr';
Database Role: Physical standby database
Primary Database: woravr
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Managed by Clusterware:
woravr: YES
woravrdr: YES
Validating static connect identifier for the primary database woravr...
The static connect identifier allows for a connection to database "woravr".
DGMGRL> switchover to 'woravrdr'; Performing switchover NOW, please wait... Operation requires a connection to database "woravrdr" Connecting ... Connected to "woravrdr" Connected as SYSDG. New primary database "woravrdr" is opening... Operation requires start up of instance "woravr1" on database "woravr" Starting instance "woravr1"... Connected to an idle instance. ORACLE instance started. Connected to "woravr" Database mounted. Database opened. Connected to "woravr" Switchover succeeded, new primary is "woravrdr"
Protection Mode Management
Data Guard supports three protection modes that define the level of data protection:- Maximum Performance: Default mode, provides best performance with minimal impact to primary
- Maximum Availability: Ensures zero data loss under normal conditions while maintaining high availability
- Maximum Protection: Guarantees zero data loss but primary shuts down if synchronous standby is unavailable
-- Change protection mode to Maximum Availability DGMGRL> edit configuration set protection mode as maxavailability; Succeeded. -- Change protection mode to Maximum Protection DGMGRL> edit configuration set protection mode as maxprotection; Succeeded. -- Return to Maximum Performance DGMGRL> edit configuration set protection mode as maxperformance; Succeeded.
- Maximum Availability and Maximum Protection require SYNC or FASTSYNC redo transport mode
- Standby redo logs must be configured on all standby databases
- Network bandwidth must be adequate to support synchronous redo transmission
- Maximum Protection mode can cause primary database shutdown if synchronous standby becomes unavailable
Fast-Start Failover Configuration
Fast-Start Failover (FSFO) enables automatic failover when the primary database becomes unavailable. This requires an observer process and careful configuration.
-- Enable Fast-Start Failover
DGMGRL> enable fast_start failover;
Enabled.
-- Start Observer (run in separate session)
DGMGRL> start observer;
Observer started
-- Check FSFO status
DGMGRL> show fast_start failover;
Fast-Start Failover: Enabled
Protection Mode: MaxPerformance
Lag Limit: 30 seconds
Threshold: 30 seconds
Active Target: woravrdr
Potential Targets: "woravrdr"
Observer: west01
Shutdown Primary: TRUE
Auto-reinstate: TRUE
Configurable Failover Conditions
Health Conditions:
Corrupted Controlfile YES
Corrupted Dictionary YES
Inaccessible Logfile NO
Stuck Archiver NO
Datafile Write Errors YES
Oracle Error Conditions:
(none)
✅ Data Guard Broker Configuration Complete Your Oracle Data Guard Broker is now fully configured and operational. You can manage your entire Data Guard environment through the centralized DGMGRL interface, perform switchovers with single commands, and optionally enable Fast-Start Failover for automatic failover capabilities. The broker provides comprehensive monitoring and ensures configuration consistency across all
