Please find the following High level steps to convert the primary to standby using switch over method .With this method the failover and switchover happens without much downtime .  It ensures data consistency during the transition. After switch over the stand by database remains mount. We do have this feature from 12c onwards.

In below PRODDR01 is Standby Database and PROD is production database.

TURN THE PRIMARY DB TO STANDBY DB

  1. Level 0 backup before starting the activity.
    2. Backup Control file alone in both Primary & DR after bringing down the application services.
    3. Stop the old DR database.
    4. Crosscheck DB sync between primary & standby
    5. Shutdown Primary database
    6. Startup primary database in node 1
    7. alter database switchover to PRODDR01 verify;
    8. select max(sequence#) from v$log_history;
    9. select name,open_mode,database_role,switchover_status from v$database;
    10. alter database commit to switchover to physical standby;
    11. At this point-in-time, the new PRIMARY database is in MOUNT state, so you need to OPEN the database.
    alter database open;
    12. And startup the new STANDBY database and enable MRP: (below is the active standby database command)
    alter database mount standby database;
    recover managed standby database using current logfile disconnect from session;
    13. Switch log file
    alter system switch logfile;
    14. Crosscheck the sync statusTURN THE STANDBY DB TO PRIMARY DB
    1. alter database switchover to PROD verify;
    2. select max(sequence#) from v$log_history;
    3. select name,open_mode,database_role,switchover_status from v$database;
    4. alter database commit to switchover to physical standby;
    5. At this point-in-time, the orig PRIMARY database is in MOUNT state, so you need to OPEN the database.
    alter database open;
    6. And startup the STANDBY database and enable MRP: (below is the active standby database command)
    alter database mount standby database;
    recover managed standby database using current logfile disconnect from session;
    7. Switch log file
    alter system switch logfile;
    8. Crosscheck the sync status

Script to check the sync Status

SELECT ARCH.THREAD# “Thread”, ARCH.SEQUENCE# “Last Sequence Received”, APPL.SEQUENCE# “Last Sequence Applied”, (ARCH.SEQUENCE# – APPL.SEQUENCE#) “Difference” FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;

Recent Posts

Start typing and press Enter to search