Data Guard Broker Configuration
Published by : Obay Salah , November 19, 2024
We will use the Data Guard command-line interface (CLI) to create, manage and monitor the Broker Configuration. Here are the steps:
1- Run the Data Guard Broker:
To run the Data Guard Broker, the variable DG_BROKER_START must be configured to take the value true for both the Primary and Standby Database. By default, this variable takes the value false. You must also use the Server Parameter (SPFILE).
ALTER SYSTEM SET DG_BROKER_START
This change is saved in the SPFILE and the Data Guard Broker is automatically started when the Instance is first started.
2- Create the Configuration:
To create the Configuration, you must follow the following steps:
A- Run the Data Guard Command Line Interface (CLI)
C:\> DGMGRL DGMGRL for Solaris: Version 10.1 Copyright (c) 2000, 2003, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL>
B- Contact to Primary Database
DGMGRL> CONNECT sys/sys@PRIMNET; Connected
C- Create the Broker Configuration
DGMGRL> CREATE CONFIGURATION 'TEST' AS PRIMARY DATABASE IS 'PRIM' CONNECT IDENTIFIER IS PRIMNET;
We created a Configuration called TEST and specified the Primary Database in this Configuration which is PRIM Database. Note that we used DB_UNIQUE_NAME here.
The CLI will return the following information:
Configuration "TEST" created with primary database "PRIM"
D- Verify configuration:
DGMGRL> SHOW CONFIGURATION; Configuration Name: TEST Enabled: NO Protection Mode: MaxPerformance Databases: PRIM - Primary database Current status for "TEST": DISABLED
3- Add the Standby Database to the Configuration:
DGMGRL> ADD DATABASE 'STAN' AS CONNECT IDENTIFIER IS STANNET MAINTAINED AS PHYSICAL; Database "STAN" added.
So we have added the Physical Standby Database to the Configuration and the CLI will return the following information:
DGMGRL> SHOW CONFIGURATION; Configuration Name: TEST Enabled: NO Protection Mode: MaxPerformance Databases: PRIM - Primary database STAN - Physical standby database Current status for "TEST": DISABLED
4- Setting Database Properties:
After creating the configuration, you can change the database properties (Primary or Standby Database) at any time.
To view the properties of the Primary Database
DGMGRL> SHOW DATABASE VERBOSE 'PRIM';
To view the properties of the Standby Database
DGMGRL> SHOW DATABASE VERBOSE 'STAN';
You can change the database properties using the command
DGMGRL> EDIT DATABASE 'DB_UNIQUE_NAME' SET PROPERTY 'PROPERTY_NAME'=’NEW VALUE';
DB_UNIQUE_NAME: The name of the database whose properties you want to change.
PROPERTY_NAME: You can see all the properties that can be changed in the database using the command
SHOW DATABASE VERBOSE 'DB_UNIQUE_NAME'
5- Activate the Configuration:
Until this moment, the Configuration has not been activated and you can verify this by using the SHOW CONFIGURATION command, this command shows you the status of the Configuration which is DISABLE.
Activating the Configuration allows the Data Guard Broker to manage the Configuration and to bring the Primary and Standby Database online.
There are two activation options:
A- Activate the Configuration including all databases in the Configuration
DGMGRL> ENABLE CONFIGURATION; Enabled.
You can verify activation by running the SHOW CONFIGURATION command
B- Activate the Standby Database
DGMGRL> ENABLE DATABASE 'STAN'; Enabled.
You can verify activation by the command
SHOW DATABASE ‘STAN’;
Comments
no comment yet!