Oracle Data Guard 19c Masterclass – Part 10 : DGMGRL Configuration & Database Registration

In Part 9, we introduced Data Guard Broker and the role of DGMGRL.

Now we’ll build the Broker configuration properly from scratch and, more importantly, understand what Oracle is actually doing when you register a primary and standby database with Broker.

This is the foundation for everything that comes later: validation, switchover, failover, reinstate, and Fast-Start Failover.

1. The Architecture

We’ll continue with the lab architecture:

                 Data Guard Broker
                        |
                 PRODDB_DG
                  /         \
                 /           \
                v             v
          PRODDB              PRODDB_DR
          PRIMARY             PHYSICAL STANDBY

Assume:

Primary:
DB_NAME        = PRODDB
DB_UNIQUE_NAME = PRODDB

Standby:
DB_NAME        = PRODDB
DB_UNIQUE_NAME = PRODDB_DR

The important distinction is:

DB_NAME
    PRODDB
       |
       +----------------+
       |                |
    PRODDB           PRODDB_DR
  DB_UNIQUE_NAME   DB_UNIQUE_NAME

2. Before Broker: Check the Database

Before registering anything, verify the primary:

SELECT
    name,
    db_unique_name,
    database_role,
    open_mode,
    protection_mode
FROM v$database;

Expected:

NAME     DB_UNIQUE_NAME  DATABASE_ROLE  OPEN_MODE
-------- --------------- -------------  ----------
PRODDB   PRODDB          PRIMARY        READ WRITE

On the standby:

SELECT
    name,
    db_unique_name,
    database_role,
    open_mode,
    protection_mode
FROM v$database;

Expected:

NAME     DB_UNIQUE_NAME  DATABASE_ROLE      OPEN_MODE
-------- --------------- ------------------ ----------------
PRODDB   PRODDB_DR       PHYSICAL STANDBY   READ ONLY WITH APPLY

The exact OPEN_MODE depends on whether Active Data Guard is being used.

3. Verify DB_UNIQUE_NAME

On the primary:

SHOW PARAMETER db_unique_name;

Expected:

PRODDB

On standby:

SHOW PARAMETER db_unique_name;

Expected:

PRODDB_DR

If these are wrong, stop here.

Don’t start configuring Broker on top of an incorrectly identified Data Guard environment.

4. Verify Broker Is Enabled

On the primary:

SHOW PARAMETER dg_broker_start;

If:

FALSE

enable it:

ALTER SYSTEM SET
dg_broker_start=TRUE
SCOPE=BOTH SID='*';

Do the same on the standby:

ALTER SYSTEM SET
dg_broker_start=TRUE
SCOPE=BOTH SID='*';

For RAC:

SID='*'

is important.

5. Verify RAC Instances

If this is RAC:

SELECT
    inst_id,
    instance_name,
    host_name,
    status
FROM gv$instance
ORDER BY inst_id;

Example:

INST_ID INSTANCE_NAME HOST_NAME       STATUS
------- ------------- --------------- -------
1       PROD1         prod-db01       OPEN
2       PROD2         prod-db02       OPEN

On the standby:

INST_ID INSTANCE_NAME HOST_NAME       STATUS
------- ------------- --------------- -------
1       PROD1         dr-db01         OPEN
2       PROD2         dr-db02         OPEN

Broker works with the database, not as two independent Data Guard databases simply because RAC has two instances.

6. Oracle Net Is a Prerequisite

Before Broker registration, verify that the databases can connect to one another.

From the primary:

tnsping PRODDB_DR

Then:

sqlplus sys@PRODDB_DR as sysdba

From the standby:

tnsping PRODDB

Then:

sqlplus sys@PRODDB as sysdba

You need working connectivity in both directions for a robust configuration.

7. DGConnectIdentifier

Broker uses a connect identifier to communicate with the database.

Conceptually:

PRODDB
   |
   | DGConnectIdentifier
   v
PRODDB_DR

For example:

PRODDB_DR =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL=TCP)(HOST=dr-scan.example.com)(PORT=1521))
    (CONNECT_DATA =
      (SERVICE_NAME=PRODDB_DR_DGMGRL)
    )
  )

The actual implementation depends on your environment.

For RAC, using a SCAN/listener/service architecture is preferable to hard-coding a single node whenever possible.

8. Don’t Confuse Three Things

This is a common source of confusion.

Database unique name
PRODDB_DR
TNS alias
PRODDB_DR
Database service
PRODDB_DR_DGMGRL

They can have the same name, but they don’t have to.

Understand what each one represents.

9. Create the Broker Configuration

Start DGMGRL:

dgmgrl /

You should see:

DGMGRL>

Create the configuration:

CREATE CONFIGURATION PRODDB_DG
  AS PRIMARY DATABASE IS PRODDB
  CONNECT IDENTIFIER IS PRODDB;

Now Broker knows:

Configuration:
PRODDB_DG

Primary:
PRODDB

But the standby isn’t registered yet.

10. What Did We Actually Create?

We created a Broker configuration object:

PRODDB_DG

Inside it, currently:

PRODDB_DG
    |
    +---- PRODDB
             PRIMARY

The standby still needs to be added.

11. Register the Standby

Now:

ADD DATABASE PRODDB_DR
  AS CONNECT IDENTIFIER IS PRODDB_DR
  MAINTAINED AS PHYSICAL;

The architecture becomes:

PRODDB_DG
   |
   +---- PRODDB
   |       PRIMARY
   |
   +---- PRODDB_DR
           PHYSICAL STANDBY

12. Why MAINTAINED AS PHYSICAL?

Because we’re using:

Physical Standby

rather than:

Logical Standby

or another standby type.

For this Masterclass, our main architecture is:

Oracle 19c
      |
Physical Standby
      |
Real-Time Apply
      |
Data Guard Broker

13. Check the Configuration

Run:

SHOW CONFIGURATION;

You may see:

Configuration - PRODDB_DG

  Protection Mode: MaxPerformance
  Members:

  PRODDB     - Primary database
  PRODDB_DR  - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
DISABLED

This is normal if the configuration hasn’t been enabled yet.

14. Enable the Configuration

Run:

ENABLE CONFIGURATION;

Then:

SHOW CONFIGURATION;

You want:

Configuration Status:
SUCCESS

A healthy result might look like:

Configuration - PRODDB_DG

  Protection Mode: MaxPerformance
  Members:

  PRODDB     - Primary database
  PRODDB_DR  - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

15. SHOW DATABASE

Now inspect the primary:

SHOW DATABASE PRODDB;

And the standby:

SHOW DATABASE PRODDB_DR;

You’ll see information such as:

Role
Intended State
Transport Lag
Apply Lag
Transport Status
Apply Status

The exact output depends on the environment and Oracle version.

16. SHOW DATABASE VERBOSE

For detailed information:

SHOW DATABASE VERBOSE PRODDB_DR;

This is one of the most useful commands in your Data Guard toolkit.

You’ll find Broker properties related to:

LogXptMode
ApplyLagThreshold
TransportLagThreshold
FastStartFailoverTarget
DGConnectIdentifier
StaticConnectIdentifier

among others.

17. Database Registration Is Not Physical Database Creation

This distinction is critical.

When we execute:

ADD DATABASE PRODDB_DR

we are not creating the standby database.

The physical standby already exists.

Broker is simply registering it into its management configuration.

Think:

RMAN
  ↓
Creates physical standby

Broker
  ↓
Registers and manages physical standby

This separation is extremely important.

18. Broker Registration vs RMAN DUPLICATE

Earlier we used:

RMAN DUPLICATE TARGET DATABASE
FOR STANDBY

That creates the standby.

Now:

DGMGRL
ADD DATABASE

registers the standby with Broker.

So the complete workflow is:

Primary
   |
   | RMAN DUPLICATE
   v
Physical Standby
   |
   | DGMGRL ADD DATABASE
   v
Broker-managed Standby

19. Validate the Configuration

Run:

VALIDATE CONFIGURATION;

Then:

VALIDATE DATABASE PRODDB;

And:

VALIDATE DATABASE PRODDB_DR;

For more detail:

VALIDATE DATABASE VERBOSE PRODDB_DR;

This should become part of your standard Data Guard health-check procedure.

20. Why VALIDATE DATABASE Is So Useful

Suppose:

SHOW CONFIGURATION

returns:

SUCCESS

but you want to know whether the standby is actually ready for a role transition.

Run:

VALIDATE DATABASE VERBOSE PRODDB_DR;

It can identify problems involving:

Redo transport
Redo apply
Connectivity
Standby redo logs
Configuration
Database properties
Role transition readiness

This is much more useful than looking only at SUCCESS.

21. Broker Properties

After registration, inspect:

SHOW DATABASE VERBOSE PRODDB_DR;

You’ll see properties maintained by Broker.

You can change supported properties using:

EDIT DATABASE

For example:

EDIT DATABASE PRODDB_DR
SET PROPERTY ApplyLagThreshold=60;

This means Broker can report a warning when apply lag exceeds the configured threshold.

22. Apply Lag Threshold

For example:

ApplyLagThreshold=60

means approximately:

60 seconds

You might use:

EDIT DATABASE PRODDB_DR
SET PROPERTY ApplyLagThreshold=300;

for:

5 minutes

Don’t copy thresholds from someone else’s environment.

Define them according to your business RPO/RTO requirements.

23. Transport Lag Threshold

Similarly:

EDIT DATABASE PRODDB_DR
SET PROPERTY TransportLagThreshold=60;

This allows Broker to detect excessive transport lag.

Now you have:

Transport Lag
        +
Apply Lag
        |
        v
Broker Health

24. LogXptMode

Check:

SHOW DATABASE VERBOSE PRODDB_DR;

You may find:

LogXptMode = 'ASYNC'

For Maximum Performance architectures, asynchronous transport is common.

For other protection requirements, you may use:

SYNC

or:

FASTSYNC

depending on the architecture and Oracle capabilities.

We’ll dedicate a later part to protection modes and transport configuration.

25. Changing Transport Mode Through Broker

For example:

EDIT DATABASE PRODDB_DR
SET PROPERTY LogXptMode='ASYNC';

The important lesson is:

Once Broker is managing the Data Guard configuration, use Broker properties where appropriate instead of randomly editing the underlying LOG_ARCHIVE_DEST_n.

26. StaticConnectIdentifier

Inspect:

SHOW DATABASE VERBOSE PRODDB_DR;

You’ll see something similar to:

StaticConnectIdentifier =
'(DESCRIPTION=...)'

This is important because Broker may need to connect to the database when it is not fully open.

For example:

PRIMARY
   ↓
Switchover
   ↓
Database mounted
   ↓
Broker still needs connectivity

That’s where static connectivity becomes important.

27. RAC: Use a Proper Service

For RAC, don’t build your Broker architecture around:

HOST=prod-db01

unless you have a specific reason.

A more robust architecture is:

SCAN
  |
  +--- Node 1
  |
  +--- Node 2

and an appropriate service.

For example:

PRODDB_DGMGRL

The Broker connect identifier points to that service.

This avoids unnecessary dependence on a single RAC node.

28. Broker Configuration in RAC

Verify:

SELECT
    inst_id,
    value
FROM gv$parameter
WHERE name='dg_broker_start'
ORDER BY inst_id;

Expected:

INST_ID VALUE
------- -----
1       TRUE
2       TRUE

Then:

DGMGRL> SHOW CONFIGURATION;

This confirms that Broker can manage the database configuration.

29. What If ADD DATABASE Fails?

This is where troubleshooting skills matter.

Typical causes include:

Incorrect DB_UNIQUE_NAME
Incorrect TNS alias
Listener problem
Password file problem
SYS authentication failure
Static connection problem
Database not reachable
Broker disabled
Incorrect standby state

Start with:

SHOW DATABASE VERBOSE PRODDB_DR;

and test:

tnsping PRODDB_DR

then:

sqlplus sys@PRODDB_DR as sysdba

Don’t immediately modify Data Guard parameters.

30. Typical Error Pattern

You may see an error such as:

ORA-12514

or:

ORA-12541

or:

ORA-01017

These aren’t necessarily Data Guard problems.

They may mean:

ORA-12514 → listener doesn't know service
ORA-12541 → no listener
ORA-01017 → authentication failure

Always isolate the layer:

OS
 ↓
Network
 ↓
Listener
 ↓
Oracle Net
 ↓
Authentication
 ↓
Database
 ↓
Broker

31. Broker Registration Checklist

Before:

ADD DATABASE

check:

Primary
SELECT db_unique_name, database_role
FROM v$database;
Standby
SELECT db_unique_name, database_role
FROM v$database;
Broker
SHOW PARAMETER dg_broker_start;
Network
tnsping PRODDB_DR
Authentication
sqlplus sys@PRODDB_DR as sysdba
RAC
SELECT inst_id, instance_name, status
FROM gv$instance;

This prevents many unnecessary troubleshooting sessions.

32. A Complete Lab Sequence

For your lab, I recommend practicing this exact sequence.

Primary
SELECT name,
       db_unique_name,
       database_role
FROM v$database;

SHOW PARAMETER dg_broker_start;

Enable:

ALTER SYSTEM SET
dg_broker_start=TRUE
SCOPE=BOTH SID='*';
Standby
SELECT name,
       db_unique_name,
       database_role
FROM v$database;

SHOW PARAMETER dg_broker_start;

Enable:

ALTER SYSTEM SET
dg_broker_start=TRUE
SCOPE=BOTH SID='*';

33. Create Configuration

dgmgrl /

Then:

CREATE CONFIGURATION PRODDB_DG
  AS PRIMARY DATABASE IS PRODDB
  CONNECT IDENTIFIER IS PRODDB;

34. Add Standby

ADD DATABASE PRODDB_DR
  AS CONNECT IDENTIFIER IS PRODDB_DR
  MAINTAINED AS PHYSICAL;

35. Enable

ENABLE CONFIGURATION;

36. Validate

SHOW CONFIGURATION;

VALIDATE CONFIGURATION;

SHOW DATABASE VERBOSE PRODDB;

SHOW DATABASE VERBOSE PRODDB_DR;

VALIDATE DATABASE VERBOSE PRODDB_DR;

At this point, you should have a clean Broker-managed Data Guard configuration.

37. Save This as Your Broker Quick Check

I recommend having a small operational script/command sheet:

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 commands should become second nature.

38. What You Should Understand Before Moving On

At this point you should be able to explain the difference between:

RMAN DUPLICATE

and:

DGMGRL ADD DATABASE

as:

RMAN
    ↓
Builds the physical standby

DGMGRL
    ↓
Registers the standby with Broker

Broker
    ↓
Manages and monitors the configuration

That’s a very important Data Guard concept.

39. Expert-Level Question

If an interviewer asks:

“Can I use Data Guard Broker without first creating the standby database?”

The answer is:

No.

Broker does not replace the physical creation of the standby.

You first need a valid standby database, then register it with Broker.

40. Another Expert Question

“Does adding a database to Broker automatically mean redo transport is correctly configured?”

Not necessarily.

You still need to validate:

Oracle Net
Redo transport
Standby Redo Logs
Database properties
Authentication
Broker connectivity

That’s why:

VALIDATE DATABASE VERBOSE

is so important.

41. Part 10 — Final Architecture

We now have:

                         DGMGRL
                            |
                     Data Guard Broker
                            |
                     PRODDB_DG
                      /          \
                     /            \
                    v              v
              PRODDB             PRODDB_DR
              PRIMARY            PHYSICAL STANDBY
                  |                    |
                  |     REDO           |
                  +------------------->|
                                       |
                                    RFS/MRP
                                       |
                                  Standby Redo

And the management flow is:

RMAN
 ↓
Physical Standby
 ↓
DG_BROKER_START=TRUE
 ↓
CREATE CONFIGURATION
 ↓
ADD DATABASE
 ↓
ENABLE CONFIGURATION
 ↓
VALIDATE
 ↓
Broker-managed Data Guard

Bookmark the permalink.
Loading Facebook Comments ...

Leave a Reply