Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2016-10-17
2
Medium Priority
?
548 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 18

Accepted Solution

by:
Emmanuel Adebayo earned 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

783 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