- Kiran Dalvi
- 27 Sep, 2023
- 0 Comments
- 2 Mins Read
Convert Physical Standby To Snapshot Standby Using Dgmgrl
Convert Physical Standby To Snapshot Standby Using Dgmgrl
Follow the below steps to Convert Physical Standby To Snapshot Standby Using Dgmgrl :
Â
1. Make sure flashback is on on standby database.
SQL> show parameter db_recovery NAME TYPE ------------------------------------ -------------------------------- VALUE ------------------------------ db_recovery_file_dest string +FRA db_recovery_file_dest_size big integer 200G SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO SQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLY WITH APPLY SQL> alter database flashback on; alter database flashback on * ERROR at line 1: ORA-01153: an incompatible media recovery is active SQL> recover managed standby database cancel; Media recovery complete. SQL> alter database flashback on; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES SQL> alter database recover managed standby database using current logfile disconnect from session; Database altered.
2. Check the configuration:
DGMGRL> show configuration Configuration - dg_config_prim Protection Mode: MaxPerformance Members: PRIM - Primary database PRIM - Physical standby database Error: ORA-16810: multiple errors or warnings detected for the member Fast-Start Failover: DISABLED Configuration Status: ERROR (status updated 46 seconds ago) DGMGRL> validate database PRIM Database Role: Physical standby database Primary Database: PRIM Ready for Switchover: Yes Ready for Failover: Yes (Primary Running) Flashback Database Status: PRIM : Off PRIM: On Managed by Clusterware: PRIM : YES PRIM: YES DGMGRL> show configuration Configuration - dg_config_prim Protection Mode: MaxPerformance Members: PRIM - Primary database PRIM - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 6 seconds ago)
3. Convert physical to snapshot standby. :
DGMGRL> convert database PRIM to snapshot standby; Converting database "PRIM" to a Snapshot Standby database, please wait... Database "PRIM" converted successfully DGMGRL> show configuration Configuration - dg_config_prim Protection Mode: MaxPerformance Members: PRIM - Primary database PRIM - Snapshot standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 52 seconds ago) SQL> select open_mode,database_role from v$database; OPEN_MODE DATABASE_ROLE -------------------- ---------------- READ WRITE SNAPSHOT STANDBY
Now the database is open in read write mode. So you can do any changes or testing on the database.
Once your activity is done, you can revert it back to physical standby.
4. Convert snapshot to physical standby
DGMGRL> convert database PRIM to physical standby; Converting database "PRIM" to a Physical Standby database, please wait... Operation requires a connection to database "ne" Connecting ... Connected to "PRIM" Connected as SYSDBA. Oracle Clusterware is restarting database "PRIM" ... Connected to "PRIM" Connected to "PRIM" Continuing to convert database "PRIM" ... Database "PRIM" converted successfully DGMGRL> DGMGRL> show configuration; Configuration - dg_config_prim Protection Mode: MaxPerformance Members: PRIM - Primary database PRIM - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS (status updated 4 seconds ago) DGMGRL>