Complete switchover processing
Graceful Switchover consists of multiple steps on both the primary and the standby server. After each step a checkpoint is initiated on both servers. Only until both servers have reached the same checkpoint will processing continue to the next step. This ensures that both servers are always in a consistent state and rollback or roll forward is possible in case there are any issues. Backup copies of the control files, the redo logs and the database configuration files are made in case a rollback has to be initiated. The backup copies are in the same location as the original files and have a date stamp suffix in the form yyyymmddhh24mi. Redo logs and the archive logs are compressed before being transferred to the other server.Â
When an error occurs on either the primary server or the standby server, processing will stop on both the primary and standby server.
The complete switchover process is shown below:
1. The process on the primary server to transition from a primary database to a standby database:
Â
=============================================================
Dbvisit Standby Database Technology (pid 23152)
dbv_oraStartStop started on dbvisit31
=============================================================
=============================================================
Graceful Switchover starting on Primary Database dbvisitp with standby database dbvisitp.
Timestamp: 201112051708.
>>> Database dbvisitp will be shutdown and restarted <<<
Ensure Dbvisit is no longer scheduled.
Obtaining archive log gap....
Contacting Standby Database dbvisitp on dbvisit32.avisit.co.nz...
Last standby sequence obtained (13878) for thread 1.
Archive Log Gap for thread 1 is: 0. This is correct to continue.
Please enter unique key to begin graceful switchover for database dbvisitp.
The same key must be entered on both primary and standby server.
Please start command: dbv_oraStartStop switchover dbvisitp
on dbvisit32.avisit.co.nz if not already started.
Please enter unique key:
31
Key 31 entered.
Contacting dbvisit32.avisit.co.nz to ensure the same unique key is entered for dbvisitp.
Waiting for Key 1 on dbvisit32.avisit.co.nz...
Checkpoint 1 completed. Key found on dbvisit32.avisit.co.nz
Transferring X.dbvisit.31.dbvisitp.tempfile to host
dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.tempfile
Transferring X.dbvisit.31.dbvisitp.force_logging to
host dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.force_logging
Waiting for Checkpoint 2 on dbvisit32.avisit.co.nz...
Checkpoint 2 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 3 on dbvisit32.avisit.co.nz...
Checkpoint 3 completed. Key found on dbvisit32.avisit.co.nz
Shutting down regular Database dbvisitp...
Regular Database dbvisitp shutdown successfully.
Starting Regular Database dbvisitp...
Regular Database dbvisitp started restrict.
Performing Oracle Checkpoint.
Waiting 3 seconds for log switch completion...
Creating standby controlfile controlfile...
Waiting for Checkpoint 4 on dbvisit32.avisit.co.nz...
Checkpoint 4 completed. Key found on dbvisit32.avisit.co.nz
Copying new archives for dbvisitp to dbvisit32.avisit.co.nz...
Transferring 1_13879_0562150315.log to host dbvisit32.avisit.co.nz:1_13879_0562150315.log
Transferring 1_13880_0562150315.log to host dbvisit32.avisit.co.nz:1_13880_0562150315.log
Transferring X.dbvisit.31.dbvisitp.archives to
host dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.archives
Completed.
Shutting down regular Database dbvisitp...
Regular Database dbvisitp shutdown successfully.
Copying redo logs ... this may take a while...
Transferring X.dbvisit.31.dbvisitp.redo_2.log to
host dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.redo_2.log
Transferring X.dbvisit.31.dbvisitp.redo_3.log to
host dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.redo_3.log
Transferring X.dbvisit.31.dbvisitp.redo_matrix to
host dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.redo_matrix
Waiting for Checkpoint 5 on dbvisit32.avisit.co.nz...
Checkpoint 5 completed. Key found on dbvisit32.avisit.co.nz
Backing up current controlfiles for dbvisitp dbvisit31.avisit.co.nz...
Database dbvisitp on dbvisit31.avisit.co.nz is already down. No action taken.
Starting Regular Database dbvisitp...
Regular Database dbvisitp started nomount.
Shutting down standby Database dbvisitp...
Standby Database dbvisitp shutdown successfully.
Controlfile backed up as /usr/tmp/GS/dbvisitp/X.dbvisit.31.dbvisitp.controlfile.
Database dbvisitp on dbvisit31.avisit.co.nz is already down. No action taken.
Transferring X.dbvisit.31.dbvisitp.controlfile to
host dbvisit32.avisit.co.nz:X.dbvisit.31.dbvisitp.controlfile
Waiting for Checkpoint 6 on dbvisit32.avisit.co.nz...
Checkpoint 6 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 7 on dbvisit32.avisit.co.nz...
Checkpoint 7 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 8 on dbvisit32.avisit.co.nz...
Checkpoint 8 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 9 on dbvisit32.avisit.co.nz...
Checkpoint 9 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 10 on dbvisit32.avisit.co.nz...
Checkpoint 10 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 11 on dbvisit32.avisit.co.nz...
Checkpoint 11 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 12 on dbvisit32.avisit.co.nz...
Checkpoint 12 completed. Key found on dbvisit32.avisit.co.nz
Database dbvisitp on dbvisit31.avisit.co.nz is already down. No action taken.
Starting Regular Database dbvisitp...
Regular Database dbvisitp started nomount.
STANDBY controlfile created.
Shutting down standby Database dbvisitp...
Standby Database dbvisitp shutdown successfully.
Starting Standby Database dbvisitp...
Standby Database dbvisitp started .
Waiting for Checkpoint 13 on dbvisit32.avisit.co.nz...
Checkpoint 13 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 14 on dbvisit32.avisit.co.nz...
Checkpoint 14 completed. Key found on dbvisit32.avisit.co.nz
File dbv_dbvisitp.env copied to dbv_dbvisitp.env.201112051708.
Dbvisit Database configuration (DDC) file dbv_dbvisitp.env has been updated and
variables have been reversed between primary and standby server.
SOURCE=dbvisit32.avisit.co.nz DESTINATION=dbvisit31.avisit.co.nz.
Waiting for Checkpoint 15 on dbvisit32.avisit.co.nz...
Checkpoint 15 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 16 on dbvisit32.avisit.co.nz...
Checkpoint 16 completed. Key found on dbvisit32.avisit.co.nz
Waiting for Checkpoint 17 on dbvisit32.avisit.co.nz...
Checkpoint 17 completed. Key found on dbvisit32.avisit.co.nz
Tempfiles dropped.
Waiting for Checkpoint 18 on dbvisit32.avisit.co.nz...
Checkpoint 18 completed. Key found on dbvisit32.avisit.co.nz
Graceful switchover completed.
This database (dbvisitp) is now a standby database.
To keep this new standby database in synch,
reschedule Dbvisit as per normal:
dbvisit dbvisitp
=============================================================
dbv_oraStartStop ended on dbvisit31
=============================================================
Where dbvisitp is the name of the database, dbvisit31 is the primary server, dbvisit32 is the standby server.
2. The process on the standby server to transition from a standby database to a primary database:
Â
=============================================================
Dbvisit Standby Database Technology (pid 3911)
dbv_oraStartStop started on dbvisit32
=============================================================
=============================================================
Graceful Switchover starting on Standby Database dbvisitp5.
Timestamp: 201112051709.
Database dbvisitp5 will be shutdown and restarted!
Ensure Dbvisit is no longer scheduled.
Please enter unique key to begin graceful switchover for database dbvisitp5.
The same key must be entered on both primary and standby server.
Please start command: dbv_oraStartStop switchover dbvisitp5
on dbvisit31.avisit.co.nz if not already started.
Please enter unique key:
31
Key 31 entered.
Contacting dbvisit31.avisit.co.nz to ensure the same unique key is entered for dbvisitp5.
Waiting for Key 1 on dbvisit31.avisit.co.nz...
Checkpoint 1 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 2 on dbvisit31.avisit.co.nz...
Checkpoint 2 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 3 on dbvisit31.avisit.co.nz...
Checkpoint 3 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 4 on dbvisit31.avisit.co.nz...
Checkpoint 4 completed. Key found on dbvisit31.avisit.co.nz
Shutting down standby Database dbvisitp5...
Standby Database dbvisitp5 shutdown successfully.
Waiting for Checkpoint 5 on dbvisit31.avisit.co.nz...
Checkpoint 5 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 6 on dbvisit31.avisit.co.nz...
Checkpoint 6 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 7 on dbvisit31.avisit.co.nz...
Checkpoint 7 completed. Key found on dbvisit31.avisit.co.nz
Backing up current controlfiles for dbvisitp5 dbvisit32.avisit.co.nz...
Database dbvisitp5 on dbvisit32.avisit.co.nz is already down. No action taken.
Starting Standby Database dbvisitp5...
Standby Database dbvisitp5 started nomount.
Shutting down standby Database dbvisitp5...
Standby Database dbvisitp5 shutdown successfully.
Controlfile backed up as /usr/tmp/GS/dbvisitp/X.dbvisit.31.dbvisitp.stdby_ctl_bck.
Database dbvisitp5 on dbvisit32.avisit.co.nz is already down. No action taken.
Waiting for Checkpoint 8 on dbvisit31.avisit.co.nz...
Checkpoint 8 completed. Key found on dbvisit31.avisit.co.nz
Starting Standby Database dbvisitp5...
Standby Database dbvisitp5 started nomount.
Database dbvisitp5 on dbvisit32.avisit.co.nz is already started. No action taken.
PRIMARY controlfile created.
Mount Database dbvisitp5...
Database dbvisitp5 mounted.
Copying redo log /usr/tmp/GS/dbvisitp/X.dbvisit.31.dbvisitp.redo_2.log to
/oracle/oradata/dbvisitp5/redo_2_1
File /oracle/oradata/dbvisitp/redo_2_1 renamed to
/oracle/oradata/dbvisitp5/redo_2_1.
Copying redo log /usr/tmp/GS/dbvisitp/X.dbvisit.31.dbvisitp.redo_3.log to
/oracle/oradata/dbvisitp5/redo_3_1
File /oracle/oradata/dbvisitp/redo_3_1 renamed to
/oracle/oradata/dbvisitp5/redo_3_1.
Waiting for Checkpoint 9 on dbvisit31.avisit.co.nz...
Checkpoint 9 completed. Key found on dbvisit31.avisit.co.nz
Recovering new primary database...
Completed.
Waiting for Checkpoint 10 on dbvisit31.avisit.co.nz...
Checkpoint 10 completed. Key found on dbvisit31.avisit.co.nz
Archive log all for Database dbvisitp5...
Completed.
Tempfiles dropped.
Waiting for Checkpoint 11 on dbvisit31.avisit.co.nz...
Checkpoint 11 completed. Key found on dbvisit31.avisit.co.nz
Open Database dbvisitp5...
Database dbvisitp5 opened.
Waiting for Checkpoint 12 on dbvisit31.avisit.co.nz...
Checkpoint 12 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 13 on dbvisit31.avisit.co.nz...
Checkpoint 13 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 14 on dbvisit31.avisit.co.nz...
Checkpoint 14 completed. Key found on dbvisit31.avisit.co.nz
File dbv_dbvisitp.env copied to dbv_dbvisitp.env.201112051709.
Dbvisit Database configuration (DDC) file dbv_dbvisitp.env has been updated and
variables have been reversed between primary and standby server.
SOURCE=dbvisit32.avisit.co.nz DESTINATION=dbvisit31.avisit.co.nz.
Waiting for Checkpoint 15 on dbvisit31.avisit.co.nz...
Checkpoint 15 completed. Key found on dbvisit31.avisit.co.nz
Tempfiles created.
Waiting for Checkpoint 16 on dbvisit31.avisit.co.nz...
Checkpoint 16 completed. Key found on dbvisit31.avisit.co.nz
Waiting for Checkpoint 17 on dbvisit31.avisit.co.nz...
Checkpoint 17 completed. Key found on dbvisit31.avisit.co.nz
FORCE LOGGING is turned on in the primary database dbvisitp5 on dbvisit32.avisit.co.nz.
Waiting for Checkpoint 18 on dbvisit31.avisit.co.nz...
Checkpoint 18 completed. Key found on dbvisit31.avisit.co.nz
Graceful switchover completed.
This database (dbvisitp5) is now the primary database.
You may consider re-creating a password file to make sure all sysdba passwords are preserved.
To keep the standby database on dbvisit31.avisit.co.nz in synch with this primary database,
reschedule Dbvisit as per normal:
dbvisit dbvisitp
=============================================================
dbv_oraStartStop ended on dbvisit32
=============================================================
Where dbvisitp is the name of the database, dbvisit31 is the primary server, dbvisit32 is the standby server.