The standby site has two instances all in mounted mode and log apply enable on one instnace. To enable active dataguard
1. In this case log apply process is enabled on rac4b therefore cancel log apply process on that node. No action is required on other node rac5b.
SQL> alter database recover managed standby database cancel;2. Open the database in read only mode. Since database added to cluster to startup default on mount mode with
Database altered.
$GIRD_HOME/bin/srvctl add database -d rac11g2s -o $ORACLE_HOME -m local -p "+DATA/rac11g2s/spfilerac11g2s.ora" -n rac11g2 -r physical_standby -s mounteach instance must be started on read only mode if all of them are used for read only application. On rac4b
SQL> alter database open read only;After this on rac5b query the open mode to verify its still in mount mode and then open in read only mode
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
---------
READ ONLY
SQL> select open_mode from v$database;3. Start the log apply service on one instance with
OPEN_MODE
---------
MOUNTED
SQL> alter database open read only;
Database altered.
SQL> select open_mode from v$database;
OPEN_MODE
---------
READ ONLY
SQL> alter database recover managed standby database using current logfile disconnect;4. On both standby instances querying the open mode will give
Database altered.
SQL> select open_mode from v$database;If data gurad broker is configured and redo apply is started then to enable active data guard
OPEN_MODE
--------------------
READ ONLY WITH APPLY
1.Stop the log apply on the standby using dgmgrl
DGMGRL> edit database rac11g2s set state='APPLY-OFF';2. Open the standby database instances in read only mode using sql plus
Succeeded.
DGMGRL> show database rac11g2s
Database - rac11g2s
Role: PHYSICAL STANDBY
Intended State: APPLY-OFF
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: OFF
Instance(s):
rac11g2s1 (apply instance)
rac11g2s2
Database Status:
SUCCESS
SQL> alter database open read only;3. Start the redo apply service again using dgmgrl
Database altered.
DGMGRL> edit database rac11g2s set state='APPLY-ON';
Succeeded.
Disabling Active Dataguard
1. Cancel the log apply service
SQL> alter database recover managed standby database cancel;This will change open mode from READ ONLY WITH APPLY to READ ONLY
Database altered.
SQL> select open_mode from v$database;2. Shutdown and start (in mount mode) the standby database
OPEN_MODE
---------
READ ONLY
srvctl stop database -d rac11g2s3. Enable log apply service
srvctl start database -d rac11g2s
SQL> select open_mode from v$database;
OPEN_MODE
---------
MOUNTED
SQL> alter database recover managed standby database using current logfile disconnect;
Database altered.