Until now, we’ve been managing Data Guard primarily with SQL commands and initialization parameters.
That is useful for understanding the technology.
But in a serious Oracle 19c environment, especially RAC, you should also master Data Guard Broker.
The Broker provides a centralized management layer for:
- configuration
- monitoring
- switchover
- failover
- transport
- redo apply
- protection modes
- validation
- health status
The important mindset is:
SQL commands teach you how Data Guard works. Broker teaches you how to operate it consistently.
1. What Is Data Guard Broker?
Data Guard Broker is an Oracle management framework that automates and simplifies the management of a Data Guard configuration.
Instead of manually executing commands such as:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE;
or manually checking many views, you can manage the configuration through:
DGMGRL
The architecture becomes:
Data Guard Broker
|
+----------+----------+
| |
v v
PRIMARY STANDBY
| |
v v
Oracle DB Oracle DB
2. DGMGRL
The main command-line interface is:
dgmgrl
Connect locally:
dgmgrl /
Or:
dgmgrl sys@PRODDB
You’ll get:
DGMGRL for Linux: Release 19... DGMGRL>
Now you can manage the entire Data Guard configuration.
3. Why Broker?
Without Broker, you may need to manage:
Primary ├── LOG_ARCHIVE_DEST_n ├── transport ├── standby ├── MRP ├── gaps ├── switchover └── failover
With Broker:
BROKER
|
+---------+---------+
| |
PRIMARY STANDBY
| |
Transport Redo Apply
The Broker maintains a model of the configuration and provides centralized control.
4. Broker Components
At a high level:
DGMGRL | v Broker Configuration | +----------------+ | | v v Primary Standby | | DMON DMON
The important background process is:
DMON
Database Monitor.
5. DMON
Check the process at OS level:
ps -ef | grep dmon
On an Oracle instance, you may see:
ora_dmon_PROD1
The DMON process participates in Broker management and communication.
In RAC, Broker interacts with the RAC database as a whole, while the Broker infrastructure is present across instances.
6. Enable Broker
Before creating a Broker configuration, verify:
SHOW PARAMETER dg_broker_start;
You may see:
dg_broker_start boolean FALSE
Enable it:
ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH SID='*';
For RAC, use:
SID='*'
so the setting applies appropriately across instances.
Verify:
SHOW PARAMETER dg_broker_start;
Expected:
TRUE
7. Broker Configuration Files
Historically, Broker uses configuration files such as:
DG_BROKER_CONFIG_FILE1 DG_BROKER_CONFIG_FILE2
Check:
SHOW PARAMETER dg_broker_config_file;
Example:
dg_broker_config_file1 +DATA/PRODDB/dr1PRODDB.dat dg_broker_config_file2 +RECO/PRODDB/dr2PRODDB.dat
The exact names depend on the environment.
8. Why Two Broker Configuration Files?
Broker maintains redundant copies of its configuration.
Conceptually:
Broker Configuration
|
+----+----+
| |
File 1 File 2
This improves resilience.
Don’t manually edit these files.
They are managed by Broker.
9. Create a Broker Configuration
First connect:
dgmgrl /
Create the configuration:
DGMGRL> CREATE CONFIGURATION PRODDB_DG AS PRIMARY DATABASE IS PRODDB CONNECT IDENTIFIER IS PRODDB;
Now add the standby:
DGMGRL> ADD DATABASE PRODDB_DR AS CONNECT IDENTIFIER IS PRODDB_DR MAINTAINED AS PHYSICAL;
Then enable the configuration:
DGMGRL> ENABLE CONFIGURATION;
10. Verify the Configuration
Run:
DGMGRL> SHOW CONFIGURATION;
You want something similar to:
Configuration - PRODDB_DG
Protection Mode: MaxPerformance
Members:
PRODDB - Primary database
PRODDB_DR - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
This is your first Broker health check.
11. SHOW CONFIGURATION
The most frequently used command:
DGMGRL> SHOW CONFIGURATION;
It gives you the high-level status.
For example:
Configuration Status: SUCCESS
or:
Configuration Status: WARNING
or:
Configuration Status: ERROR
Don’t stop at the status.
If you get:
WARNING
investigate why.
12. SHOW DATABASE
For the primary:
DGMGRL> SHOW DATABASE PRODDB;
For the standby:
DGMGRL> SHOW DATABASE PRODDB_DR;
You’ll get information about:
Role Intended State Transport Lag Apply Lag Transport Status Apply Status Database Status
13. SHOW DATABASE VERBOSE
For troubleshooting:
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
This is much more useful.
It exposes properties such as:
LogXptMode ApplyLagThreshold TransportLagThreshold ApplyParallel StandbyFileManagement StaticConnectIdentifier DGConnectIdentifier
The exact output varies with Oracle release and configuration.
14. Broker Properties
One of the most important concepts is:
Broker has its own properties.
For example:
LogXptMode
controls the transport mode from the Broker perspective.
You can inspect:
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
and find:
LogXptMode = 'ASYNC'
15. Change a Broker Property
Example:
DGMGRL> EDIT DATABASE PRODDB_DR SET PROPERTY LogXptMode='ASYNC';
This is different from manually editing:
LOG_ARCHIVE_DEST_2
Once Broker manages the configuration, you should generally make Data Guard configuration changes through Broker where the property is supported.
16. Don’t Mix Management Methods Carelessly
This is a major production lesson.
If Broker manages Data Guard, avoid constantly doing:
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2=...
manually without understanding the Broker configuration.
Otherwise you can create:
Manual configuration
+
Broker configuration
=
configuration drift
A DBA should know which layer is authoritative for the property being changed.
17. Broker and Initialization Parameters
Broker does not replace every initialization parameter.
Instead:
Database parameters
+
Broker properties
+
Oracle Net
+
Database configuration
work together.
For example:
DB_UNIQUE_NAME
remains a database parameter.
But Broker manages higher-level operational properties such as:
transport apply role transitions health
18. Validate the Configuration
One of the best Broker commands:
DGMGRL> VALIDATE CONFIGURATION;
This checks the Data Guard environment.
Example:
Configuration Status: SUCCESS
You can also validate an individual database:
DGMGRL> VALIDATE DATABASE PRODDB_DR;
19. Validate Database Verbose
For deeper analysis:
DGMGRL> VALIDATE DATABASE VERBOSE PRODDB_DR;
This can expose important details about:
Transport Redo Apply Log files Standby Redo Logs Connectivity Configuration
For a production health check, this is one of the first commands I’d run.
20. Validate Network Connectivity
Broker depends heavily on Oracle Net.
For example:
PRODDB | | DGConnectIdentifier v PRODDB_DR
Test manually too:
tnsping PRODDB_DR
and:
sqlplus sys@PRODDB_DR as sysdba
Broker does not eliminate the need for proper Oracle Net configuration.
21. Static Connect Identifier
Broker may need to connect to a database even when the database is not fully open.
That’s where:
StaticConnectIdentifier
becomes important.
For RAC environments, this is especially important.
You can inspect:
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
Look for:
StaticConnectIdentifier
22. Why Static Connectivity Matters
Imagine:
Primary | v Switchover | v Old Primary becomes Standby
The database may be:
MOUNTED
rather than:
OPEN
Broker still needs a way to connect to it.
Therefore:
Static Listener
+
StaticConnectIdentifier
is important for reliable role transitions.
23. RAC and Broker
Our architecture is:
PRIMARY RAC
+---------------+
| |
PROD1 PROD2
| |
+-------+-------+
|
Broker
|
+-------+-------+
| |
DR1 DR2
| |
+---------------+
STANDBY RAC
Broker is managing the database configuration rather than treating each RAC instance as a separate Data Guard database.
That’s an important distinction.
24. RAC Instance-Specific Properties
For RAC, you should also understand:
PreferredInstance
and:
InstanceName
in the context of Broker properties and services.
For example, after a role transition, you may want the database service to start on the appropriate RAC instances.
This becomes particularly important when integrating:
Data Guard + RAC + Services + Application Continuity
25. Broker and Services
A mature architecture should look like:
Data Guard
|
Role Transition
|
+------------+------------+
| |
PRIMARY STANDBY
| |
PRIMARY SERVICE DR SERVICE
| |
Clients Clients
Application connections should not simply hard-code:
PROD1
or:
DR1
You should design services around database roles.
26. Intended State
Broker has an important concept:
Intended State
For example:
DGMGRL> SHOW DATABASE PRODDB_DR;
You may see:
Intended State: APPLY-ON
This means Broker expects redo apply to be running.
If you intentionally stop apply:
DGMGRL> EDIT DATABASE PRODDB_DR SET STATE='APPLY-OFF';
Broker knows that this is intentional.
27. APPLY-ON / APPLY-OFF
Instead of manually:
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
you can use Broker:
DGMGRL> EDIT DATABASE PRODDB_DR SET STATE='APPLY-OFF';
Restart:
DGMGRL> EDIT DATABASE PRODDB_DR SET STATE='APPLY-ON';
This is much cleaner when Broker owns the configuration.
28. TRANSPORT-ON / TRANSPORT-OFF
Broker can also control redo transport.
For example:
DGMGRL> EDIT DATABASE PRODDB_DR SET STATE='TRANSPORT-OFF';
and:
DGMGRL> EDIT DATABASE PRODDB_DR SET STATE='TRANSPORT-ON';
This gives you controlled operational maintenance.
29. Switchover
Now we reach one of Broker’s biggest advantages.
Without Broker, a switchover involves many manual steps.
With Broker:
DGMGRL> SWITCHOVER TO PRODDB_DR;
Broker coordinates the role transition.
Conceptually:
Before: PRODDB PRIMARY PRODDB_DR STANDBY After: PRODDB STANDBY PRODDB_DR PRIMARY
This is one of the core operations you must master.
30. Before Switchover
Never simply run:
SWITCHOVER
on a production system without validation.
First:
DGMGRL> VALIDATE DATABASE PRODDB; DGMGRL> VALIDATE DATABASE PRODDB_DR;
Then:
DGMGRL> SHOW CONFIGURATION;
You want:
SUCCESS
and ideally:
Transport Lag: 0 Apply Lag: 0
or within an acceptable operational threshold.
31. Switchover Example
DGMGRL> SWITCHOVER TO PRODDB_DR;
Broker performs the coordinated transition.
Afterward:
DGMGRL> SHOW CONFIGURATION;
Expected:
PRODDB_DR - Primary database PRODDB - Physical standby database
Then verify from SQL:
SELECT database_role,
open_mode
FROM v$database;
32. Failover
Failover is different.
Switchover:
Planned
Failover:
Unplanned / disaster
Broker can perform:
DGMGRL> FAILOVER TO PRODDB_DR;
This should be treated as a serious operation.
Potential data loss depends on:
Protection mode Transport mode Network state Redo received Redo applied
33. Switchover vs Failover
Remember:
| Operation | Purpose |
|---|---|
| Switchover | Planned role transition |
| Failover | Disaster recovery |
| Reinstate | Convert old primary back to standby |
| Convert database | Role transition operation |
The objective is not just memorizing commands.
You need to understand what happens to the old primary after each operation.
34. Reinstate
After a failover, the old primary may no longer be usable as the primary.
If Flashback Database is available and the configuration allows it, Broker can often reinstate the old primary as a standby.
Conceptually:
Before failure: PRIMARY ───────> STANDBY After failover: OLD PRIMARY NEW PRIMARY After reinstate: OLD PRIMARY ───────> NEW PRIMARY STANDBY PRIMARY
This is one of the most powerful Broker capabilities.
35. Fast-Start Failover
Later in the Masterclass we’ll dedicate a full part to:
FSFO
Fast-Start Failover.
It can automatically perform failover when configured correctly.
Architecture:
Observer
|
+--------+--------+
| |
PRIMARY STANDBY
The Observer monitors the environment and can trigger automatic failover according to the configured protection and FSFO policies.
Do not enable this casually in production.
36. Observer
Check Broker:
DGMGRL> SHOW FAST_START FAILOVER;
You may see:
Fast-Start Failover: DISABLED
Later we’ll configure:
Observer
and understand:
Target Standby FastStartFailoverTarget ObserverReconnect FastStartFailoverThreshold
37. Broker Health Monitoring
A simple production check:
DGMGRL> SHOW CONFIGURATION;
Then:
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
Then:
DGMGRL> VALIDATE DATABASE VERBOSE PRODDB_DR;
This gives you three levels:
Configuration
↓
Database
↓
Detailed validation
38. Broker Warnings
Suppose:
Configuration Status: WARNING
Don’t immediately execute:
ENABLE CONFIGURATION
or restart anything.
First:
DGMGRL> SHOW CONFIGURATION;
Then:
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
Look for:
ORA- ORA-16xxx transport error apply error lag connectivity
Broker is telling you something.
Treat the warning as a diagnostic signal.
39. Broker Status vs Database Status
You should distinguish:
Broker Status
from:
Database Status
For example:
Database Status: SUCCESS
doesn’t necessarily mean:
Application = healthy
Data Guard is only one part of the application stack.
Likewise:
Broker WARNING
doesn’t automatically mean:
Database corrupted
It may simply be:
Apply lag threshold exceeded
40. Useful Broker Commands
Build this into your muscle memory:
DGMGRL> SHOW CONFIGURATION; DGMGRL> SHOW DATABASE PRODDB; DGMGRL> SHOW DATABASE PRODDB_DR; DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR; DGMGRL> VALIDATE CONFIGURATION; DGMGRL> VALIDATE DATABASE PRODDB_DR; DGMGRL> VALIDATE DATABASE VERBOSE PRODDB_DR;
These are your everyday commands.
41. Configuration Overview
You can also use:
DGMGRL> SHOW CONFIGURATION VERBOSE;
This is useful when you want more information about the configuration itself.
42. Broker Logging
When troubleshooting Broker, examine the Broker logs.
Oracle maintains Broker diagnostic information under the Oracle diagnostic infrastructure.
You can locate diagnostic destinations with:
SELECT name,
value
FROM v$diag_info
WHERE name LIKE '%Diag%';
and inspect the Broker-related trace/log files in the diagnostic area.
Don’t limit troubleshooting to the DGMGRL screen.
43. A Real Troubleshooting Workflow
Suppose an application team tells you:
“The DR database is behind.”
Don’t start with:
DGMGRL> FAILOVER
Instead:
Step 1
DGMGRL> SHOW CONFIGURATION;
Step 2
DGMGRL> SHOW DATABASE VERBOSE PRODDB_DR;
Step 3
DGMGRL> VALIDATE DATABASE VERBOSE PRODDB_DR;
Step 4
SQL:
SELECT name,
value,
unit
FROM v$dataguard_stats
WHERE name IN
(
'transport lag',
'apply lag'
);
Step 5
Check:
SELECT * FROM v$archive_gap;
Now you have enough information to determine whether the issue is:
Transport Apply Network Gap Storage CPU Configuration
44. Broker and Manual SQL — The Golden Rule
You will encounter both:
SQL*Plus
and:
DGMGRL
in real environments.
The correct approach is not:
“Always use DGMGRL.”
or:
“Always use SQL.”
Instead:
Understand what Broker manages, then use Broker consistently for Broker-managed operations.
For example:
Role transitions
→ Broker
Apply state
→ Broker
Transport state
→ Broker
Validation
→ Broker
while SQL remains essential for:
Database internals Views Performance Storage RAC Redo OS troubleshooting
45. Broker Configuration Files — Don’t Touch Them
You may find files such as:
dr1PRODDB.dat dr2PRODDB.dat
Do not:
vi dr1PRODDB.dat
Do not manually modify them.
Use:
DGMGRL
to manage Broker metadata.
46. Broker in RAC
For RAC, enable:
ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH SID='*';
Then verify each instance:
SELECT inst_id,
value
FROM gv$parameter
WHERE name='dg_broker_start';
Expected:
INST_ID VALUE ------- ----- 1 TRUE 2 TRUE
This is a good RAC validation exercise.
47. Broker + RAC Health Check
Run:
SELECT inst_id,
instance_name,
status
FROM gv$instance
ORDER BY inst_id;
Then:
DGMGRL> SHOW CONFIGURATION;
Then:
DGMGRL> VALIDATE DATABASE VERBOSE PRODDB_DR;
You want the RAC layer and Data Guard layer to agree.
48. A Practical Lab
Let’s turn this into an actual exercise.
Step 1 — Check database parameters
SHOW PARAMETER dg_broker;
Step 2 — Enable Broker
ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH SID='*';
Step 3 — Connect
dgmgrl /
Step 4 — Create configuration
CREATE CONFIGURATION PRODDB_DG AS PRIMARY DATABASE IS PRODDB CONNECT IDENTIFIER IS PRODDB;
Step 5 — Add standby
ADD DATABASE PRODDB_DR AS CONNECT IDENTIFIER IS PRODDB_DR MAINTAINED AS PHYSICAL;
Step 6 — Enable
ENABLE CONFIGURATION;
Step 7 — Check
SHOW CONFIGURATION;
49. Then Validate
VALIDATE CONFIGURATION;
Then:
VALIDATE DATABASE VERBOSE PRODDB_DR;
If everything is correctly configured, you should have a clean Broker configuration.
50. Test Apply Control
Stop apply:
EDIT DATABASE PRODDB_DR SET STATE='APPLY-OFF';
Check:
SHOW DATABASE PRODDB_DR;
Start it again:
EDIT DATABASE PRODDB_DR SET STATE='APPLY-ON';
This is a very useful lab exercise.
51. Test Transport Control
Disable transport:
EDIT DATABASE PRODDB_DR SET STATE='TRANSPORT-OFF';
Verify:
SHOW DATABASE PRODDB_DR;
Then restore:
EDIT DATABASE PRODDB_DR SET STATE='TRANSPORT-ON';
Now you have demonstrated that Broker can independently control:
Transport Apply
52. Production Broker Checklist
Before declaring Broker production-ready:
✓ DG_BROKER_START=TRUE ✓ Unique DB_UNIQUE_NAME ✓ Correct DGConnectIdentifier ✓ Correct StaticConnectIdentifier ✓ Oracle Net connectivity ✓ Password file synchronization ✓ Standby Redo Logs ✓ Real-Time Apply ✓ Broker configuration enabled ✓ VALIDATE CONFIGURATION = SUCCESS ✓ VALIDATE DATABASE = SUCCESS ✓ Switchover tested ✓ Failover procedure documented ✓ Reinstate procedure tested ✓ Services configured correctly ✓ Monitoring configured
53. The Expert-Level Mindset
For an expert-level Oracle DBA, don’t think:
"How do I execute SWITCHOVER?"
Think:
What is the current role?
↓
Is transport healthy?
↓
Is apply caught up?
↓
Are there gaps?
↓
Are all RAC instances healthy?
↓
Is the target ready?
↓
Is Broker configuration healthy?
↓
Can I safely perform the role transition?
The command is the easy part.
The decision-making is the real skill.
54. Part 9 Summary
At this point, our architecture has evolved from manual Data Guard administration to centralized Broker management:
DGMGRL
|
Data Guard Broker
|
+---------+---------+
| |
PRIMARY STANDBY
| |
LGWR/RFS MRP
| |
+------ REDO -------+
You should now understand:
✓ Data Guard Broker ✓ DGMGRL ✓ DMON ✓ DG_BROKER_START ✓ Broker configuration ✓ Broker configuration files ✓ SHOW CONFIGURATION ✓ SHOW DATABASE ✓ SHOW DATABASE VERBOSE ✓ VALIDATE CONFIGURATION ✓ VALIDATE DATABASE ✓ APPLY-ON / APPLY-OFF ✓ TRANSPORT-ON / TRANSPORT-OFF ✓ Switchover ✓ Failover ✓ Reinstate ✓ StaticConnectIdentifier ✓ Broker + RAC ✓ Broker troubleshooting


