Você está na página 1de 9

ORACLE 10g

DATA GUARD BROKER


Ritesh Chhajer SATG DBA TEAM

Agenda
DG Broker Concepts & Advantages

Setup using CLI(DGMGRL)


Useful broker commands Switchover

Concepts
Any Data Guard configuration consists of one primary database and up to nine standby databases. The Data Guard broker logically groups these primary and standby databases into a broker configuration so as to manage and monitor them together as an integrated unit. Data Guard broker is a centralized framework to manage entire Data Guard configuration through a client connection to any database in the configuration. Accessed either locally or remotely using either of the two clients: CLI interface(DGMGRL) or the Data Guard page from GUI( OEM Grid Control ) DGMGRL does not have the ability to create standby (GUI can do it). CLI is used mostly for configuration and management. Easy switchover/failover with one command thereby minimizing overall downtime associated with the planned/unplanned outage Integrated with CRS so that database role changes occur smoothly and seamlessly. Instead of managing primary and standby databases with various SQL*Plus statements, broker provides a single unified configuration

DMON
Data Guard monitor process (DMON) runs for every database instance that is managed by the broker and maintains the broker configuration in a binary configuration file Whenever a broker command is issued, DMON process: Carries out the request on primary database Coordinates with DMON process for each of the other databases Updates its local configuration file Communicates with DMON process for each of the other databases to update their copies of the configuration file

Prerequisites
Set up following parameters on primary and standby: DG_BROKER_START=TRUE DG_BROKER_CONFIG_FILE1=<PATH> DG_BROKER_CONFIG_FILE2=<PATH> LOCAL_LISTENER GLOBAL_DBNAME in listener.ora as db_unique_name_DGMGRL.db_domain To enable DGMGRL to restart instances, a service with a specific name must be statically registered with the local listener of each instance. For RAC, ensure dg_broker_config_files are on shared storage and accessible to all instances. START_OPTIONS for RAC database must be set to MOUNT in OCR using SRVCTL (For switchover/Failover operations for broker and CRS to coordinate while restarting instances and database role reversal) SPFILE must be used

Setup
Note values to prepare for configuration Pri db_unique_name = 'STEXPAC2' DG db_unique_name = 'STEXPDG' Configuration(any name) = 'DG_SITEEXP' sys password = '<pwd>' Pri conn stg = 'STEXPAC2' 1. Connect

DGMGRL> connect sys/<pwd>


2. Create Configuration DGMGRL> CREATE CONFIGURATION 'DG_SITEEXP' AS PRIMARY DATABASE IS 'STEXPAC2' CONNECT IDENTIFIER IS STEXPAC2; 3. Verify configuration and database (For RAC, verify all instances are validated) DGMGRL> show configuration; DGMGRL> show database STEXPAC2;

Setup contd.
4. Add standby to the configuration DGMGRL> ADD DATABASE 'STEXPDG' AS CONNECT IDENTIFIER IS STEXPDG MAINTAINED AS PHYSICAL; 5. Enable the broker DGMGRL> ENABLE CONFIGURATION; 6. Verify again DGMGRL> SHOW CONFIGURATION; Few Commands: DGMGRL> SHOW DATABASE 'STEXPAC2' 'StatusReport'; DGMGRL> SHOW DATABASE 'STEXPAC2' 'LogXptStatus'; DGMGRL> SWITCHOVER TO STEXPDG; DGMGRL> EDIT DATABASE 'STEXPAC2' SET PROPERTY 'LogArchiveMaxProcesses'=2; DGMGRL> SHOW DATABASE VERBOSE STEXPAC2'; DGMGRL> HELP; DGMGRL> EDIT DATABASE STEXPDG SET STATE=READ-ONLY;

Switchover
Once SWITCHOVER is issued, the broker does the following: 1. 2. 3. 4. 5. 6. 7. 8. Verifies state of primary and standby database are enabled and in ONLINE state Shuts down all RAC instances except one Switches roles between the primary and standby databases. Updates the broker configuration file to record the changes in roles Restarts the new standby database and any RAC instances that were shutdown prior to switchover. Restarts the new primary database, opens it in read-write mode, and starts log transport services transmitting redo data to the archived redo log files for standby database After switchover completes, the overall Data Guard protection mode remains at the same protection level as it was before the switchover. For DGMGRL to restart instances automatically, you must connect to the database as SYSDBA using the username and password specified in the remote password file before beginning the switchover.

Q&A

Você também pode gostar