Data Guard Broker
Creating the data guard broker for primary database(orcl1) and standby database(orcl2):
Prerequisite: Both the physical database and standby database must exist before dataguard broker can be setup
1. Enable Data Guard Broker in both database:
SQL> sqlplus sys/oracle@orcl1 as sysdba
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE
SQL> sqlplus sys/oracle@orcl1 as sysdba
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE
2. Edit the listener.ora on the primary database so that it has the following entry:
Creating the data guard broker for primary database(orcl1) and standby database(orcl2):
Prerequisite: Both the physical database and standby database must exist before dataguard broker can be setup
1. Enable Data Guard Broker in both database:
SQL> sqlplus sys/oracle@orcl1 as sysdba
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE
SQL> sqlplus sys/oracle@orcl1 as sysdba
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE
2. Edit the listener.ora on the primary database so that it has the following entry:
(SID_DESC =
(GLOBAL_DBNAME = orcl1_dgmgrl)
(ORACLE_HOME = /u01/oracle/product/11.1.0/db_1)
(SID_NAME = orcl2)
)
3. Edit the listener.ora on the standby database so that it has the following entry:
(SID_DESC =
(GLOBAL_DBNAME = orcl2_dgmgrl)
(ORACLE_HOME = /u01/oracle/product/11.1.0/db_1)
(SID_NAME = orcl2)
)
4. Connect to DGMGRL and create the configuration file:
$ DGMGRL
DGMGRL> CREATE CONFIGURATION ‘orcldgbrkr’
$ DGMGRL
DGMGRL> CREATE CONFIGURATION ‘orcldgbrkr’
> AS
> PRIMARY DATABASE IS ‘orcl1’
> CONNECT IDENTIFIER IS ‘orcl1’
;
DGMGRL> SHOW CONFIGURATION
5. Add the standby database in the dataguard broker configuration:
DGMGRL> ADD DATABASE ‘orcl2’
> AS
> CONNECT IDENTIFIER IS ‘orcl2’
>;
> AS
> CONNECT IDENTIFIER IS ‘orcl2’
>;
DGMGRL> SHOW CONFIGURATION
6. Enable the configuration:
DGMGRL> Enable Configuration
DGMGRL> SHOW CONFIGURATION
DGMGRL> Enable Configuration
DGMGRL> SHOW CONFIGURATION
7. View the details of the primary and standby database:
DGMGRL> show database orcl1
DGMGRL> show database orcl2
To show additional details:
DGMGRL> show database verbose orcl1
DGMGRL> show database verbose orcl2
DGMGRL> show database orcl1
DGMGRL> show database orcl2
To show additional details:
DGMGRL> show database verbose orcl1
DGMGRL> show database verbose orcl2
8. To perform a switchover:
DGMGRL>switchover to ‘orcl2’
DGMGRL>switchover to ‘orcl2’