Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Data Guard-Broker konfigurieren und aktivieren
Nachdem Sie die primären und Standby-Datenbanken für Data Guard eingerichtet haben, müssen Sie den zugehörigen Broker einrichten.
Der Data Guard-Broker verwaltet das Erstellen, Steuern und Überwachen von Data Guard-Konfigurationen.
Die folgenden Beispiele werden in diesem Leitfaden verwendet:
Eindeutiger Name der Datenbank
Server-Hostnamen
RAC-Instanznamen
Rolle
Eindeutiger Name der Datenbank
Server-Hostnamen
RAC-Instanznamen
Rolle
DBDG_SITE1
site1db1, site1db2
DBDG_SITE11, DBDG_SITE12
Primär
DBDG_SITE2
site2db1, site2db2
DBDG_SITE21, DBDG_SITE22
Standby
Primäre Datenbank einrichten
Starten Sie den Data Guard-Monitoringprozess in der primären Datenbank:
Melden Sie sich beim ersten Bare-Metal-Lösungsserver an, der die primäre Datenbank hostet.
Prüfen Sie in /etc/oratab, ob ein Eintrag zum Aktivieren von Umgebungsvariablen für die primäre Datenbank vorhanden ist:
DBDG_SITE11:/apps/oracle/19.0.0/db_home1:N
Legen Sie die Umgebungsvariable ORACLE_SID fest, damit Sie eine Verbindung zur primären Datenbank herstellen können:
sourceoraenv <<< "DBDG_SITE11"
Sie sollten die Antwort The Oracle base has been set to /apps/oracle/oracle_base erhalten.
Prüfen Sie mit dem Wiederherstellungsmanager, dass Archivlogs erst dann automatisch gelöscht werden, wenn sie auf alle Standby-Datenbanken angewendet wurden:
Starten Sie SQL*Plus, konfigurieren Sie einen Speicherort für die Broker-Konfigurationsdateien und starten Sie den Broker. Bei RAC-Datenbanken müssen sich die Broker-Konfigurationsdateien auf einem freigegebenen Speicher befinden, vorzugsweise in einer ASM-Laufwerksgruppe:
Melden Sie sich beim ersten Bare-Metal-Lösungsserver an, der die primäre Datenbank hostet.
Stellen Sie eine Verbindung zur Data Guard-Befehlszeilenschnittstelle und dann zur primären Datenbank her:
dgmgrl
CONNECTSYS@DBDG_SITE1
Wenn Sie zur Eingabe eines Passworts aufgefordert werden, geben Sie Ihr Remote-Anmeldepasswort für SYS für die primäre Datenbank ein.
Erstellen Sie die Broker-Konfiguration:
CREATE CONFIGURATION 'DBDG' AS PRIMARY DATABASE IS 'DBDG_SITE1' CONNECT IDENTIFIER IS DBDG_SITE1;
Fügen Sie die Standby-Datenbank hinzu:
ADD DATABASE DBDG_SITE2 AS CONNECT IDENTIFIER IS DBDG_SITE2 MAINTAINED AS PHYSICAL;
Aktivieren Sie die Konfiguration. Wenn Sie diese Konfiguration aktivieren, wird der Broker-Prozess angewiesen, den Logversand von der primären Datenbank zu starten und das Wiederherstellen auf die Standby-Datenbank anzuwenden, sobald sie empfangen wird:
ENABLE CONFIGURATION;
Mit den folgenden Befehlen können Sie prüfen, ob die Konfiguration erfolgreich ist:
SHOW CONFIGURATION;
SHOW DATABASE DBDG_SITE1;
SHOW DATABASE DBDG_SITE2;
VALIDATE DATABASE DBDG_SITE1;
VALIDATE DATABASE DBDG_SITE2;
Der Befehl show configuration meldet den Status SUCCESS erst, wenn die Standby-Datenbank mit der primären Datenbank synchronisiert wird. Die Dauer der ersten Synchronisierung kann je nach Umfang der an der primären Datenbank ausgeführten Änderungen oder der Latenz zwischen der primären und der Standby-Website variieren. Hier sehen Sie ein Beispiel für eine erfolgreiche Konfiguration:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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)."]]