Stay organized with collections
Save and categorize content based on your preferences.
Configure and enable Data Guard broker
After you've set up the primary
and standby
databases for Data Guard, you need to set up its broker.
The Data Guard broker manages creation, control, and monitoring of Data Guard
configurations.
The following examples are used throughout this guide:
Database unique name
Server hostnames
RAC instance names
Role
Database unique name
Server hostnames
RAC instance names
Role
DBDG_SITE1
site1db1, site1db2
DBDG_SITE11, DBDG_SITE12
Primary
DBDG_SITE2
site2db1, site2db2
DBDG_SITE21, DBDG_SITE22
Standby
Set up the primary database
Start the Data Guard monitor process on the primary database:
Log in to the first Bare Metal Solution server that hosts the primary database.
In /etc/oratab check that an entry to enable environment variables for the
primary database exists:
DBDG_SITE11:/apps/oracle/19.0.0/db_home1:N
Set the ORACLE_SID environment variable so you can connect to the primary
database:
sourceoraenv <<< "DBDG_SITE11"
You should receive the response
The Oracle base has been set to /apps/oracle/oracle_base.
Use Recovery Manager to check that archive logs are not automatically
deleted until they have been applied on all standby databases:
Start SQL*Plus, then configure a location for the broker configuration
files and start the broker. RAC databases require the broker configuration
files to reside on shared storage, preferably in an ASM diskgroup:
Log in to the first Bare Metal Solution server that hosts the primary database.
Connect to the Data Guard command line interface, then to the primary
database:
dgmgrl
CONNECTSYS@DBDG_SITE1
When prompted for a password, enter your SYS remote login password for the
primary database.
Create the broker configuration:
CREATE CONFIGURATION 'DBDG' AS PRIMARY DATABASE IS 'DBDG_SITE1' CONNECT IDENTIFIER IS DBDG_SITE1;
Add the standby database:
ADD DATABASE DBDG_SITE2 AS CONNECT IDENTIFIER IS DBDG_SITE2 MAINTAINED AS PHYSICAL;
Enable the configuration. Enabling this configuration directs the broker
process to begin log shipping from the primary database, and apply the redo
on the standby database as it is received:
ENABLE CONFIGURATION;
You can check if the configuration is successful with the following
commands:
SHOW CONFIGURATION;
SHOW DATABASE DBDG_SITE1;
SHOW DATABASE DBDG_SITE2;
VALIDATE DATABASE DBDG_SITE1;
VALIDATE DATABASE DBDG_SITE2;
The show configuration command doesn't report a status of SUCCESS until
the standby database is synchronized with the primary database. The amount
of time required for the initial synchronization can vary, based on the
amount of changes performed on the primary database or the latency between
the primary and standby sites. Here is an example of a successful
configuration:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis guide explains how to set up the Data Guard broker, which is essential for managing the creation, control, and monitoring of Data Guard configurations.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves configuring the primary database by setting up the Data Guard monitor process, and configuring a location for the broker configuration files, then ensuring archive logs are not deleted prematurely.\u003c/p\u003e\n"],["\u003cp\u003eThe standby database setup mirrors the primary, including setting up the monitor process and configuring the broker file location.\u003c/p\u003e\n"],["\u003cp\u003eA broker configuration is created on the primary database using the Data Guard command line interface, including adding the standby database and enabling log shipping.\u003c/p\u003e\n"],["\u003cp\u003eOnce the configuration is created, you can validate that the configuration is working properly using multiple commands and enable flashback on the newly configured standby database.\u003c/p\u003e\n"]]],[],null,["# Configure and enable Data Guard broker\n======================================\n\nAfter you've set up the [primary](/bare-metal/docs/solutions/oracle/data-guard-setup/db-setup-primary)\nand [standby](/bare-metal/docs/solutions/oracle/data-guard-setup/db-setup-standby)\ndatabases for Data Guard, you need to set up its [broker](https://docs.oracle.com/en/database/oracle/oracle-database/19/dgbkr/oracle-data-guard-broker-concepts.html).\nThe Data Guard broker manages creation, control, and monitoring of Data Guard\nconfigurations.\n\nThe following examples are used throughout this guide:\n\nSet up the primary database\n---------------------------\n\nStart the Data Guard monitor process on the primary database:\n\n1. Log in to the first Bare Metal Solution server that hosts the primary database.\n\n2. In `/etc/oratab` check that an entry to enable environment variables for the\n primary database exists:\n\n \u003cvar class=\"readonly\" translate=\"no\"\u003eDBDG_SITE11\u003c/var\u003e:\u003cvar scope=\"oraclehome\" translate=\"no\"\u003e/apps/oracle/19.0.0/db_home1\u003c/var\u003e:N\n\n3. Set the `ORACLE_SID` environment variable so you can connect to the primary\n database:\n\n source oraenv \u003c\u003c\u003c \"\u003cvar translate=\"no\"\u003eDBDG_SITE11\u003c/var\u003e\"\n\n You should receive the response\n `The Oracle base has been set to `\u003cvar class=\"edit\" scope=\"oraclebase\" translate=\"no\"\u003e/apps/oracle/oracle_base\u003c/var\u003e.\n4. Use Recovery Manager to check that archive logs are not automatically\n deleted until they have been applied on all standby databases:\n\n rman target /\n\n CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;\n EXIT;\n\n5. Start SQL\\*Plus, then configure a location for the broker configuration\n files and start the broker. RAC databases require the broker configuration\n files to reside on shared storage, preferably in an ASM diskgroup:\n\n sqlplus / as sysdba\n\n ALTER SYSTEM SET DG_BROKER_CONFIG_FILE1='+DATA/\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e/dr1\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e.dat' SID='*' SCOPE=BOTH;\n ALTER SYSTEM SET DG_BROKER_CONFIG_FILE2='+DATA/\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e/dr2\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e.dat' SID='*' SCOPE=BOTH;\n ALTER SYSTEM SET DG_BROKER_START=true SID='*' SCOPE=BOTH;\n EXIT;\n\nSet up the standby database\n---------------------------\n\nStart the Data Guard monitor process on the standby database:\n\n1. Log in to the first Bare Metal Solution server that hosts the standby database.\n\n2. Set the `ORACLE_SID` environment variable, so you can connect to the standby\n database:\n\n source oraenv \u003c\u003c\u003c \"\u003cvar translate=\"no\"\u003eDBDG_SITE21\u003c/var\u003e\"\n\n You should receive the response\n `The Oracle base has been set to `\u003cvar scope=\"oraclebase\" translate=\"no\"\u003e/apps/oracle/oracle_base\u003c/var\u003e.\n3. Log in to SQL\\*Plus, then configure a location for broker configuration\n files and start the broker.\n\n sqlplus / as sysdba\n\n ALTER SYSTEM SET DG_BROKER_CONFIG_FILE1='+DATA/\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e/dr1\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e.dat' SID='*' SCOPE=BOTH;\n ALTER SYSTEM SET DG_BROKER_CONFIG_FILE2='+DATA/\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e/dr2\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e.dat' SID='*' SCOPE=BOTH;\n ALTER SYSTEM SET DG_BROKER_START=true SID='*' SCOPE=BOTH;\n EXIT;\n\nCreate the broker configuration\n-------------------------------\n\n1. Log in to the first Bare Metal Solution server that hosts the primary database.\n\n2. Connect to the Data Guard command line interface, then to the primary\n database:\n\n dgmgrl\n\n CONNECT SYS@\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e\n\n When prompted for a password, enter your SYS remote login password for the\n primary database.\n3. Create the broker configuration:\n\n CREATE CONFIGURATION 'DBDG' AS PRIMARY DATABASE IS '\u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e' CONNECT IDENTIFIER IS \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e;\n\n4. Add the standby database:\n\n ADD DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e AS CONNECT IDENTIFIER IS \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e MAINTAINED AS PHYSICAL;\n\n5. Enable the configuration. Enabling this configuration directs the broker\n process to begin log shipping from the primary database, and apply the redo\n on the standby database as it is received:\n\n ENABLE CONFIGURATION;\n\n6. You can check if the configuration is successful with the following\n commands:\n\n SHOW CONFIGURATION;\n\n SHOW DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e;\n\n SHOW DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e;\n\n VALIDATE DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e;\n\n VALIDATE DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e;\n\n The `show configuration` command doesn't report a status of `SUCCESS` until\n the standby database is synchronized with the primary database. The amount\n of time required for the initial synchronization can vary, based on the\n amount of changes performed on the primary database or the latency between\n the primary and standby sites. Here is an example of a successful\n configuration: \n\n Configuration - DBDG\n\n Protection Mode: MaxPerformance\n Members:\n \u003cvar translate=\"no\"\u003eDBDG_SITE1\u003c/var\u003e - Primary database\n \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e - Physical standby database\n\n Fast-Start Failover: Disabled\n\n Configuration Status:\n SUCCESS (status updated 0 seconds ago)\n\n7. Enable flashback on the newly configured standby database:\n\n CONNECT SYS@\u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e\n\n When prompted for a password, enter your SYS remote login password for the\n standby database. \n\n EDIT DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e SET STATE=APPLY-OFF;\n SQL 'ALTER DATABASE FLASHBACK ON';\n EDIT DATABASE \u003cvar translate=\"no\"\u003eDBDG_SITE2\u003c/var\u003e SET STATE=APPLY-ON;\n\n8. Exit the Data Guard command line interface:\n\n EXIT;\n\nNext steps\n----------\n\nNext, [validate the Data Guard deployment](/bare-metal/docs/solutions/oracle/data-guard-setup/validate)."]]