SQL Server Switchover

Follow

This section will provide you with details on how to perform a Graceful Switchover for SQL Server (GS).  A GS is done in a controlled manner with zero data loss.  During this process, the primary and standby databases switch roles.

There is a number of checks and steps to be performed as part of this process. The observer or the Automated standby update feature (if enabled) will be automatically stopped/disabled before the switchover. We however encourage users to manually disable those for getting more familiar with the process.

During the GS process, transaction log backup WITH NORECOVERY option is taken and this puts the primary in restoring mode. The backed up transaction log backup is transferred and restored in standby and the database is put to online mode.

You can initiate GS by selectin “Graceful switchover” Option from the ACTIONS pane:

image-20250326-164657.png

Following page will show various information:

image-20250326-164855.png

You will be able to determine/perform:

  • Current logshipping direction (1)

  • Confirmation that switchover can be performed (2)

  • Option to execute user scripts (3) See User Scripts for more details

  • Start GS (4)

Once GS process is started, you will be able to see task in the task bar:

image-20250326-165156.png

And see its details:

image-20250326-165218.png

The Switchover has following steps:

  1. Preparing the environment for switchover by checking the status of the configuration and observer and disabling it. Disabling the automated standby update.

  2. Convert the standby to primary by taking the backup with norecovery option which puts the primary database in restoring mode

  3. Synchronize the standby by restoring the backup taken on step 1

  4. Activating the standby database by bringing the standby database to Online status

  5. Now the standby becomes primary and the primary becomes the standby and the agentmanager will check the status of the databases

  6. Synchronising new standby by taking a new transaction log backup from the new primary and then restoring the transaction log backup in new standby

  7. The last step is the check the Automated standby update state and observer and enable it.

After the switchover process completes, the log shipping configuration is reversed in the dashboard:

image-20250326-165251.png

To revert your configuration back, you can simply execute GS again.

Have more questions? Submit a request

Comments