Solved

Steps for fail over log shipping database from primary to secondary during DR drill and switch back

Posted on 2016-10-17
2
79 Views
Last Modified: 2016-10-19
Hi there,

  Could anyone share the steps involved during DR drill for failing over the log shipped databases and app team is gonna do some tests on the secondary database(which will become primary after faiover) then switch it back to the original stake after testing(ie., secondary will again goes to standy/read only) and primary will become active with the logs should resume its syn up job.

Please note, I am running MS SQL Server 2008 R2 enterprise edition on both the servers.

thanks
Deepak
0
Comment
Question by:Deepak Kumar
2 Comments
 
LVL 16

Accepted Solution

by:
Emmanuel Adebayo earned 500 total points
ID: 41847804
Hi,

To fail over to a secondary log shipping server, follow this 10-step process:

    1. Disable all backup jobs that might back up the database on both log shipping partners.
    2. Disable the log shipping jobs.
    3. Run each log shipping job in order (i.e., backup, copy, and restore).
    4. Drop log shipping.
    5. Manually back up the log of the primary database using the NORECOVERY option. Use the command

    BACKUP LOG [DatabaseName]
      TO DISK = 'BackupFilePathname'
      WITH NORECOVERY;

    where DatabaseName is the name of the database whose log you want to back up and BackupFilePathname is the backup file’s pathname (e.g., Z:\SQLServerBackups\TLog.bck).
    6. Restore the log backup on the secondary database using the RECOVERY option, and bring the secondary database online. The primary and secondary databases have now switched positions.
    7. Back up the log of the new primary database (optional).
    8. Restore the log on the new secondary database using the NORECOVERY option (optional).
    9. Reconfigure log shipping.
    10. Re-enable any backup jobs that were disabled.
For more info check the following links
http://dbasqlserver13.blogspot.co.uk/2013/12/failover-and-failback-in-logshipping.html
https://msdn.microsoft.com/en-us/library/ms191233.aspx

regards
0
 

Author Closing Comment

by:Deepak Kumar
ID: 41851435
Thanks Emmanuel for your help!! I really appreciate it.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now