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.
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.
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.
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
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.
Before configuring Data Guard Broker, ensure the following conditions are met:
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
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
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
SQL> 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
SQL> 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
[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.
DGMGRL> create configuration 'woravr' as
primary database is 'woravr'
connect identifier is woravr;
Configuration "woravr" created with primary database "woravr"
DGMGRL> add database 'woravrdr' as
connect identifier is woravrdr
maintained as physical;
Database "woravrdr" added
DGMGRL> 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.
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.
DGMGRL> enable configuration; Enabled
DGMGRL> 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)
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
| 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 |
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.
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"
-- 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.
-- 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)