Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Configura y habilita el agente de Data Guard
Después de configurar las bases de datos principal y en espera para Data Guard, debes configurar su agente.
El agente de Data Guard administra la creación, el control y la supervisión de las configuraciones de Data Guard.
En esta guía, se usan los siguientes ejemplos:
Nombre único de la base de datos
Nombres de host del servidor
Nombres de instancias de RAC
Rol
Nombre único de la base de datos
Nombres de host del servidor
Nombres de instancias de RAC
Rol
DBDG_SITE1
site1db1, site1db2
DBDG_SITE11, DBDG_SITE12
Principal
DBDG_SITE2
site2db1, site2db2
DBDG_SITE21, DBDG_SITE22
En suspensión
Configura la base de datos principal
Inicia el proceso de supervisión de Data Guard en la base de datos principal:
Accede al primer servidor de la solución Bare Metal que aloja la base de datos principal.
En /etc/oratab, verifica que exista una entrada a fin de habilitar las variables de entorno para la base de datos principal:
DBDG_SITE11:/apps/oracle/19.0.0/db_home1:N
Configura la variable de entorno ORACLE_SID para que puedas conectarte a la base de datos principal:
sourceoraenv <<< "DBDG_SITE11"
Deberías recibir la respuesta The Oracle base has been set to /apps/oracle/oracle_base.
Usa el administrador de recuperación para comprobar que los registros de archivos no se borren de forma automática hasta que se hayan aplicado en todas las bases de datos en espera:
Inicia SQL*Plus y, luego, configura una ubicación para los archivos de configuración del agente e inicia el agente. Las bases de datos de RAC requieren que los archivos de configuración del agente residan en el almacenamiento compartido, de preferencia en un grupo de discos de ASM:
Accede al primer servidor de la solución Bare Metal que aloja la base de datos principal.
Conéctate a la interfaz de línea de comandos de Data Guard y, luego, a la base de datos principal:
dgmgrl
CONNECTSYS@DBDG_SITE1
Cuando se te solicite una contraseña, ingresa tu contraseña de acceso remoto de SYS para la base de datos principal.
Crea la configuración del agente:
CREATE CONFIGURATION 'DBDG' AS PRIMARY DATABASE IS 'DBDG_SITE1' CONNECT IDENTIFIER IS DBDG_SITE1;
Agrega la base de datos en espera:
ADD DATABASE DBDG_SITE2 AS CONNECT IDENTIFIER IS DBDG_SITE2 MAINTAINED AS PHYSICAL;
Habilita la configuración. Habilitar esta configuración le indica al proceso del agente que comience el envío de registros de la base de datos principal y que aplique el rehacer en la base de datos en espera a medida que se recibe:
ENABLE CONFIGURATION;
Puedes verificar si la configuración se realiza de forma correcta con los siguientes comandos:
SHOW CONFIGURATION;
SHOW DATABASE DBDG_SITE1;
SHOW DATABASE DBDG_SITE2;
VALIDATE DATABASE DBDG_SITE1;
VALIDATE DATABASE DBDG_SITE2;
El comando show configuration no informa un estado de SUCCESS hasta que la base de datos en espera se sincroniza con la base de datos principal. El tiempo requerido de sincronización inicial puede variar según la cantidad de cambios realizados en la base de datos principal o la latencia entre los sitios principal y en espera. A continuación, se muestra un ejemplo de una configuración correcta:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (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)."]]