Opening a DR database in read write mode using Snapshot Standby method
Objective of this document is to convert a DR database (Mount state) into Read Write mode using Snapshot standby method and restoring it back to sync it up with the PRIMARY database.
DR Environment
The I****01 has a two node clustered DR database as follows,
NAME DB_UNIQUE_NAME OPEN_MODE
--------- ------------------------------ --------------------
I****01 DRI****01 MOUNTED
I****01 DRI****01 MOUNTED
INSTANCE_NAME STATUS HOST_NAME
---------------- ------------ --------------------------------
I****011 MOUNTED of90.egan.server.com
I****012 MOUNTED of91.egan.server.com
The flashback mode is disabled in I****01 database.
Steps to enable the flashback mode in both the Primary and DR I****01 database.
1. Enabling Flashback in DR database.
a. Cancel the recovery in the standby database.
STANDBY>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
b. Then activate the FLASHBACK on the standby database.
STANDBY> alter system set db_flashback_retention_target=1440 scope=both; ### retention value varies depending on the requirement.
STANDBY>ALTER DATABASE FLASHBACK ON;
c. Verify the flashback mode,
SQL> select flashback_on from v$database;
2. Enabling Flashback in the Primary database.
a. Activate the FLASHBACK on the PRIMARY database.
PRIMARY> alter system set db_flashback_retention_target=1440 scope=both;#### retention value varies depending on the requirement.
PRIMARY> alter database flashback on;
b. Verify the flashback mode,
SQL> select flashback_on from v$database;
Once the flashback mode is enabled, we shall go ahead and bring the DR in the read write mode.
Steps to open the DR database in Read/Write mode using Snapshot Standby
a. Stop the recovery in the DR database.
STANDBY>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
b. Check The MRP status,
STANDBY>select PROCESS,CLIENT_PROCESS,THREAD#,SEQUENCE#,BLOCK# from v$managed_standby where process = 'MRP0' or client_process='LGWR';
(or)
host# ps –ef|grep –imrp
c. Bring down all instances except oneon which we will be using the conversion commands, and ensure the DR database is in mount state
d. Convert the Physical standby DR to Snapshot standby DR,
STANDBY>ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
e. The DR database will be dismounted after the conversion, so start it.
STANDBY>startup;
f. The DR will be open in Read/Write mode now.
Steps to convert the Snapshot standby DR to Physical Standby DR
a. Shutdown all the instances except one on which we will be using the conversion commands.
b. Ensure that the database is mounted.
c. Do the conversion of snapshot standby database to physical standby database.
STANDBY>ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
d. Change back the DR to Physical Standby database,
STANDBY>ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
e. Bounce the DR database and bring them to mount,
STANDBY>shutdown immediate
STANDBY>startup mount
f. Enable the log shipping in the primary database,
PRIMARY>ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;
g. Start the MRP in the DR database,
STANDBY>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;