November 1, 2015

Convert Physical Standby to Snapshot Standby and Vice Versa using DGMGRL

Check the below commands output before proceeding at standby server.
$ srvctl status database -d stand
$ srvctl status service -d stand
$ srvctl config database -d stand
$ ./crsctl status res -t

Connect to primary server and perform the below steps this will convert the physical standby to snapshot standby

DGMGRL> show configuration;

Configuration - DG-prod

  Protection Mode: MaxPerformance
  Members:
  prod   - Primary database
    stand - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 23 seconds ago)


DGMGRL> convert database stand to snapshot standby;
Converting database "stand" to a Snapshot Standby database, please wait...
Database "stand" converted successfully
DGMGRL> show configuration;

Configuration - DG-prod

  Protection Mode: MaxPerformance
  Members:
  prod   - Primary database
    stand - Snapshot standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 11 seconds ago)

DGMGRL> show database stand;

Database - stand

  Role:               SNAPSHOT STANDBY
  Transport Lag:      0 seconds (computed 0 seconds ago)
  Apply Lag:          1 minute 18 seconds (computed 0 seconds ago)
  Instance(s):
    stand

Database Status:
SUCCESS

Make sure that you have the enough space for the FRA.
The below query will give the FRA usagae details.
SQL> select name, (space_limit/1024/1024/1024) ||'GB' as Space_Limit, (space_used/1024/1024/1024)||'GB' as Space_Used from v$recovery_file_dest;
SQL> select * from V$FLASH_RECOVERY_AREA_USAGE;

Do your tests on the snapshot standby at this time you can open in read-write mode. Once your work done then convert back to snapshot standby to physical standby.

DGMGRL> convert database stand to physical standby;
Converting database "stand" to a Physical Standby database, please wait...
Database "stand" converted successfully
DGMGRL> show configuration;

Configuration - DG-prod

  Protection Mode: MaxPerformance
  Members:
  prod   - Primary database
    stand - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 23 seconds ago)

Once done please crosscheck the sync status between primary and standby.

*********************Check Sync Status**************************

Primary:
*******
SQL> select max(sequence#) from v$archived_log;

MAX(SEQUENCE#)
--------------
        127056

Standby:
*******
SQL> select max(sequence#) from V$archived_log where applied='YES';

MAX(SEQUENCE#)
--------------
        127056

Also check the all the oracle services are running as before the snapshot convert.

$ srvctl status database -d stand
$ srvctl status service -d stand
$ srvctl config database -d stand
$ ./crsctl status res -t

The outputs of the above commands should match with the previous one. If not we need to troubleshoot it.

Happy Learning :)

No comments:

Post a Comment