Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can now perform a Graceful Switchover (GS) back to the original configuration by running the ./dbv_oraStartStop switchover DDC <key> command.

 

Example Graceful Switchover Back from Oracle RAC (kiwi81 and kiwi82) to (kiwi91).  Remember the switchover command must be executed on both the primary and standby node.  In this case the standby instance was only running on kiwi91 - so no need to shutdown the second instance on kiwi92 as it was not running.

Below is a sample output from the Graceful Switchover command when executed on kiwi81.

No Format
oracle@kiwi81[/usr/dbvisit/standby]: ./dbv_oraStartStop switchover DEV1 2
=============================================================
Dbvisit Standby Database Technology (7.0.54.15715) (pid 24731)
dbv_oraStartStop started on kiwi81: Thu Apr  7 19:13:12 2016 ()
=============================================================

=============================================================
Graceful Switchover starting on Primary Database DEV1.
Timestamp: 201604071913.

>>> RAC Database DEV will be shutdown and restarted as single instance <<<
Ensure Dbvisit is no longer scheduled.

Obtaining archive log gap....
Contacting Standby Database DEV1 on kiwi91...
Next standby sequence required for recovery (85) for thread 1.

Archive Log Gap for thread 1 is: 0. This is correct to continue.
Contacting Standby Database DEV1 on kiwi91...
Next standby sequence required for recovery (29) for thread 2.

Archive Log Gap for thread 2 is: 1. This is correct to continue.

Please enter unique key to begin graceful switchover for database DEV1.
The same key must be entered on both primary and standby server.

Please start command: dbv_oraStartStop switchover DEV1
on kiwi91 if not already started.

Batch key will be used: 2
Key 2 entered.

Contacting kiwi91 to ensure the same unique key is entered for DEV1.
Waiting for Key 1 on kiwi91...
Checkpoint 1 completed. Key found on kiwi91
Waiting for Checkpoint 2 on kiwi91...
Checkpoint 2 completed. Key found on kiwi91
Waiting for Checkpoint 3 on kiwi91...
Checkpoint 3 completed. Key found on kiwi91
Regular Database DEV1 shutdown successfully.
Starting Regular Database DEV1...
Regular Database DEV1 started restrict.
Performing Oracle Checkpoint.
    Waiting 3 seconds for log switch completion...

Creating standby control file as '/usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.standbycontrolfile'...
Waiting for Checkpoint 4 on kiwi91...
Checkpoint 4 completed. Key found on kiwi91
Copying new archives for DEV1 to kiwi91...
Compressing  thread_1_seq_85.266.908565303...
  > Transferring 'thread_1_seq_85.266.908565303.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [15294 KB/s] - done.
Compressing  thread_2_seq_29.267.908564645...
  > Transferring 'thread_2_seq_29.267.908564645.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [3734 KB/s] - done.
Compressing  thread_2_seq_30.265.908565267...
  > Transferring 'thread_2_seq_30.265.908565267.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [17527 KB/s] - done.
Shutting down regular Database DEV1...
Regular Database DEV1 shutdown successfully.
Copying subsequent new archives for DEV1 to kiwi91...
Copying redo logs ... this may take a while...
Compressing  X.dbvisit.2.DEV1.redo_1.log...
  > Transferring 'X.dbvisit.2.DEV1.redo_1.log.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [116545 KB/s] - done.
Compressing  X.dbvisit.2.DEV1.redo_2.log...
  > Transferring 'X.dbvisit.2.DEV1.redo_2.log.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [62454 KB/s] - done.
Compressing  X.dbvisit.2.DEV1.redo_3.log...
  > Transferring 'X.dbvisit.2.DEV1.redo_3.log.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [31124 KB/s] - done.
Compressing  X.dbvisit.2.DEV1.redo_4.log...
  > Transferring 'X.dbvisit.2.DEV1.redo_4.log.gz' to server kiwi91:7890
    Progress: 0%...20%...40%...60%...80%...100% [74331 KB/s] - done.
Waiting for Checkpoint 5 on kiwi91...
Checkpoint 5 completed. Key found on kiwi91
Backing up current control files for DEV1 kiwi81...
Database DEV1 on kiwi81 is already down. No action taken.
Starting Regular Database DEV1...
Regular Database DEV1 started nomount.
Control file backed up as /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.controlfile.
Shutting down standby Database DEV1...
Standby Database DEV1 shutdown successfully.
Waiting for Checkpoint 6 on kiwi91...
Checkpoint 6 completed. Key found on kiwi91
Waiting for Checkpoint 7 on kiwi91...
Checkpoint 7 completed. Key found on kiwi91
Waiting for Checkpoint 8 on kiwi91...
Checkpoint 8 completed. Key found on kiwi91
Waiting for Checkpoint 9 on kiwi91...
Checkpoint 9 completed. Key found on kiwi91
Waiting for Checkpoint 10 on kiwi91...
Checkpoint 10 completed. Key found on kiwi91
Waiting for Checkpoint 11 on kiwi91...
Checkpoint 11 completed. Key found on kiwi91
Waiting for Checkpoint 12 on kiwi91...
Checkpoint 12 completed. Key found on kiwi91
Database DEV1 on kiwi81 is already down. No action taken.
Starting Regular Database DEV1...
Regular Database DEV1 started nomount.
STANDBY control file(s) restored from /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.standbycontrolfile.
Shutting down standby Database DEV1...
Standby Database DEV1 shutdown successfully.
Starting Standby Database DEV1...
Standby Database DEV1 started .
Waiting for Checkpoint 13 on kiwi91...
Checkpoint 13 completed. Key found on kiwi91
Waiting for Checkpoint 14 on kiwi91...
Checkpoint 14 completed. Key found on kiwi91
File /usr/dbvisit/standby/conf/dbv_DEV1.env copied to /usr/dbvisit/standby/conf/dbv_DEV1.env.201604071913.
Dbvisit Database configuration (DDC) file /usr/dbvisit/standby/conf/dbv_DEV1.env has been updated and variables have been reversed between primary and
standby server.

SOURCE=kiwi91 DESTINATION=kiwi81.

Waiting for Checkpoint 15 on kiwi91...
Checkpoint 15 completed. Key found on kiwi91
Waiting for Checkpoint 16 on kiwi91...
Checkpoint 16 completed. Key found on kiwi91
Standby file +DATADR/dev/onlinelog/redo_1_1.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_1_2.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_2_1.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_2_2.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_3_1.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_3_2.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_4_1.log renamed to +DATADR in database DEV1.
Standby file +DATADR/dev/onlinelog/redo_4_2.log renamed to +DATADR in database DEV1.
Shutting down standby Database DEV1...
Standby Database DEV1 shutdown successfully.
Starting Standby Database DEV1...
Standby Database DEV1 started .
Waiting for Checkpoint 17 on kiwi91...
Checkpoint 17 completed. Key found on kiwi91
Waiting for Checkpoint 18 on kiwi91...
Checkpoint 18 completed. Key found on kiwi91

Graceful switchover completed.

This database (DEV1) is now a standby database.

To keep this new standby database in synch,
reschedule Dbvisit as per normal:
	dbvisit DEV1
=============================================================
dbv_oraStartStop ended on kiwi81: Thu Apr  7 19:19:30 2016
=============================================================

 

Example output from kiwi91:

No Format
oracle@kiwi91[/usr/dbvisit/standby]: ./dbv_oraStartStop switchover DEV1 2
=============================================================
Dbvisit Standby Database Technology (7.0.54.15715) (pid 26734)
dbv_oraStartStop started on kiwi91: Thu Apr  7 19:13:03 2016 ()
=============================================================

=============================================================
Graceful Switchover starting on Standby Database DEV1.
Timestamp: 201604071913.
Database DEV1 will be shutdown and restarted!
Ensure Dbvisit is no longer scheduled.

Please enter unique key to begin graceful switchover for database DEV1.
The same key must be entered on both primary and standby server.

Please start command: dbv_oraStartStop switchover DEV1
on kiwi81 if not already started.

Batch key will be used: 2
Key 2 entered.

Contacting kiwi81 to ensure the same unique key is entered for DEV1.
Waiting for Key 1 on kiwi81...
Checkpoint 1 completed. Key found on kiwi81
Waiting for Checkpoint 2 on kiwi81...
Checkpoint 2 completed. Key found on kiwi81
Init parameter CLUSTER_DATABASE parameter is set to TRUE.
To proceed with switchover CLUSTER_DATABASE will be set to FALSE.
Database uses spfile +DATA/dev/spfiledev.ora.
CLUSTER_DATABASE will be set to FALSE in spfile.
Waiting for Checkpoint 3 on kiwi81...
Checkpoint 3 completed. Key found on kiwi81
Tempfiles dropped.
Waiting for Checkpoint 4 on kiwi81...
Checkpoint 4 completed. Key found on kiwi81
Shutting down standby Database DEV1...
Standby Database DEV1 shutdown successfully.
Waiting for Checkpoint 5 on kiwi81...
Checkpoint 5 completed. Key found on kiwi81
Uncompressing 1_85_884290120.arc.gz...
Rename 2_29_884290120.arc to 2_29_884290120.arc.201604071913...
Uncompressing 2_29_884290120.arc.gz...
Uncompressing 2_30_884290120.arc.gz...
Uncompressing X.dbvisit.2.DEV1.redo_1.log.gz...
Uncompressing X.dbvisit.2.DEV1.redo_2.log.gz...
Uncompressing X.dbvisit.2.DEV1.redo_3.log.gz...
Uncompressing X.dbvisit.2.DEV1.redo_4.log.gz...
Waiting for Checkpoint 6 on kiwi81...
Checkpoint 6 completed. Key found on kiwi81
Waiting for Checkpoint 7 on kiwi81...
Checkpoint 7 completed. Key found on kiwi81
Backing up current control files for DEV1 kiwi91...
Database DEV1 on kiwi91 is already down. No action taken.
Starting Standby Database DEV1...
Standby Database DEV1 started nomount.
Control file backed up as /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.stdby_ctl_bck.
Shutting down standby Database DEV1...
Standby Database DEV1 shutdown successfully.
Waiting for Checkpoint 8 on kiwi81...
Checkpoint 8 completed. Key found on kiwi81
Starting Standby Database DEV1...
Standby Database DEV1 started nomount.
PRIMARY control file(s) restored from /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.controlfile.
Mount Database DEV1...
Database DEV1 mounted.
Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_1.log to +DATA/DEV/onlinelog/redo_1_1.log
File +DATADR/dev/onlinelog/redo_1_1.log renamed to +DATA/DEV/onlinelog/redo_1_1.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_1.log to +DATA/DEV/onlinelog/redo_1_2.log
File +DATADR/dev/onlinelog/redo_1_2.log renamed to +DATA/DEV/onlinelog/redo_1_2.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_2.log to +DATA/DEV/onlinelog/redo_2_1.log
File +DATADR/dev/onlinelog/redo_2_1.log renamed to +DATA/DEV/onlinelog/redo_2_1.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_2.log to +DATA/DEV/onlinelog/redo_2_2.log
File +DATADR/dev/onlinelog/redo_2_2.log renamed to +DATA/DEV/onlinelog/redo_2_2.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_3.log to +DATA/DEV/onlinelog/redo_3_1.log
File +DATADR/dev/onlinelog/redo_3_1.log renamed to +DATA/DEV/onlinelog/redo_3_1.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_3.log to +DATA/DEV/onlinelog/redo_3_2.log
File +DATADR/dev/onlinelog/redo_3_2.log renamed to +DATA/DEV/onlinelog/redo_3_2.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_4.log to +DATA/DEV/onlinelog/redo_4_1.log
File +DATADR/dev/onlinelog/redo_4_1.log renamed to +DATA/DEV/onlinelog/redo_4_1.log.

Copying redo log /usr/dbvisit/standby/tmp/GS/DEV1/X.dbvisit.2.DEV1.redo_4.log to +DATA/DEV/onlinelog/redo_4_2.log
File +DATADR/dev/onlinelog/redo_4_2.log renamed to +DATA/DEV/onlinelog/redo_4_2.log.

Waiting for Checkpoint 9 on kiwi81...
Checkpoint 9 completed. Key found on kiwi81
Recovering new primary database...
Catalog archivelog '/u01/app/oracle/dbvisit_archdest/DEV/1_85_884290120.arc'...
Catalog archivelog '/u01/app/oracle/dbvisit_archdest/DEV/2_29_884290120.arc'...
Catalog archivelog '/u01/app/oracle/dbvisit_archdest/DEV/2_30_884290120.arc'...
Completed.
Waiting for Checkpoint 10 on kiwi81...
Checkpoint 10 completed. Key found on kiwi81
Archive log all for Database DEV1...
Completed.
Tempfiles dropped.
Waiting for Checkpoint 11 on kiwi81...
Checkpoint 11 completed. Key found on kiwi81
Open Database DEV1...
Database DEV1 opened.
Waiting for Checkpoint 12 on kiwi81...
Checkpoint 12 completed. Key found on kiwi81
Waiting for Checkpoint 13 on kiwi81...
Checkpoint 13 completed. Key found on kiwi81
Waiting for Checkpoint 14 on kiwi81...
Checkpoint 14 completed. Key found on kiwi81
File /usr/dbvisit/standby/conf/dbv_DEV1.env copied to /usr/dbvisit/standby/conf/dbv_DEV1.env.201604071913.
Dbvisit Database configuration (DDC) file /usr/dbvisit/standby/conf/dbv_DEV1.env has been updated and variables have been reversed between primary and standby server.

SOURCE=kiwi91 DESTINATION=kiwi81.

Waiting for Checkpoint 15 on kiwi81...
Checkpoint 15 completed. Key found on kiwi81
Tempfiles created.

FORCE LOGGING is left turned off in the primary database DEV1 on kiwi91.
Waiting for Checkpoint 16 on kiwi81...
Checkpoint 16 completed. Key found on kiwi81
Compressing  1_85_884290120.arc...
Compressing  2_29_884290120.arc...
Compressing  2_30_884290120.arc...
Waiting for Checkpoint 17 on kiwi81...
Checkpoint 17 completed. Key found on kiwi81
Waiting for Checkpoint 18 on kiwi81...
Checkpoint 18 completed. Key found on kiwi81

Graceful switchover completed.

This database (DEV1) 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 kiwi81 in synch with this primary database,
reschedule Dbvisit as per normal:
	dbvisit DEV1

Init parameter CLUSTER_DATABASE parameter is set to FALSE. To change single instance database to RAC database set:
SQL>alter system set cluster_database = true scope = spfile;
SQL>alter system set cluster_database_instances = x scope = spfile;
and restart all instances.
=============================================================
dbv_oraStartStop ended on kiwi91: Thu Apr  7 19:19:29 2016
=============================================================

 

To complete the process, you have to run the two commands as shown, followed by restarting the instances, example:

 

On the new primary kiwi91:

No Format
oracle@kiwi91[/home/oracle]: . oraenv
ORACLE_SID = [oracle] ? DEV1
The Oracle base remains unchanged with value /u01/app/oracle
oracle@kiwi91[/home/oracle]: sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 7 19:24:48 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect / as sysdba
Connected.
SQL> alter system set cluster_database=true scope=spfile;
System altered.

SQL> alter system set cluster_database_instances=2 scope=spfile;
System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options


oracle@kiwi91[/home/oracle]: srvctl start database -d DEV

oracle@kiwi91[/home/oracle]: srvctl status database -d DEV -v
Instance DEV1 is running on node kiwi91. Instance status: Open.
Instance DEV2 is running on node kiwi92. Instance status: Open.

 

On the standby database kiwi81:

No Format
oracle@kiwi81[/usr/dbvisit/standby]: sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 7 19:28:14 2016

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect / as sysdba
Connected.
SQL> alter system set cluster_database=true scope=spfile;
System altered.

SQL> alter system set cluster_database_instances=2 scope=spfile;
System altered.

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

oracle@kiwi81[/usr/dbvisit/standby]: srvctl start database -d DEV -o mount

oracle@kiwi81[/usr/dbvisit/standby]: srvctl status database -d DEV -v
Instance DEV1 is running on node kiwi81. Instance status: Mounted (Closed).
Instance DEV2 is running on node kiwi82. Instance status: Mounted (Closed).

 

 

You can now run dbvisit standby as normal to send/apply logs.