Failover & Role switch

  • From the link http://msdn.microsoft.com/en-us/library/ms178117%28SQL.90%29.aspx

    Changing Roles Between Primary and Secondary Servers

    After you have failed over to a secondary server, you can configure your secondary database to act as a primary database. Then, you will be able to swap primary and secondary databases as needed.

    Performing the Initial Role Change

    The first time you want to fail over to the secondary database and make it your new primary database, there is a series of steps you must take. After you have followed these initial steps, you will be able to swap roles between the primary database and the secondary database easily.

    1. Manually fail over from the primary database to a secondary database. Be sure to back up the active transaction log on your primary server with NORECOVERY. For more information, see Failing Over to a Log Shipping Secondary.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. On your secondary database (the database you want to be the new primary), configure log shipping using SQL Server Management Studio. For more information, see How to: Enable Log Shipping (SQL Server Management Studio). Include the following steps:

    * Use the same share for creating backups that you created for the original primary server.

    * When adding the secondary database, in the Secondary Database Settings dialog box, enter the name of the original primary database in the Secondary database box.

    * In the Secondary Database Settings dialog box, select No, the secondary database is initialized.

    Swapping Roles

    After you have completed the steps above for the initial role change, you can change roles between the primary database and the secondary database by following the steps in this section. To perform a role change, follow these general steps:

    1. Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server).

    Here, I did the following:

    1.brought the secondary online by restoring all the available log backups from Primary(backed up the active transaction log on primary server with NORECOVERY and the Primary database is in Recovery state.)

    2.Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server

    3. On your secondary database (the database you want to be the new primary), configure log shipping using SQL Server Management Studio

    following steps:

    * Use the same share for creating backups that you created for the original primary server.

    * When adding the secondary database, in the Secondary Database Settings dialog box, enter the name of the original primary database in the Secondary database box.

    * In the Secondary Database Settings dialog box, select No, the secondary database is initialized.

    I did the above and Log shipping is configured from Secondary to Primary successfully.

    I'm confused with below steps:

    Swapping Roles

    After you have completed the steps above for the initial role change, you can change roles between the primary database and the secondary database by following the steps in this section. To perform a role change, follow these general steps:

    1. Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server)

    The Secondary is already online. So how can we again bring the secondary online ?[/b]

    please advice

  • The issue is that you are calling your current server, the one you failed over to, the secondary. Once you failover, it's the primary. all log shipping starts from that server.

    If I start with

    - ServerA as the primary

    - ServerB as the secondary.

    ServerA fails. I then bring up ServerB, bring it through recovery, and have clients connect to it. Now I have

    - ServerB as the primary

    - ServerA as the secondary.

    If I want to move back to ServerA, I need to failover, just as I did to get to ServerB

  • Thanks Steve,

    The issue is that you are calling your current server, the one you failed over to, the secondary. Once you failover, it's the primary. all log shipping starts from that server.

    As you said, After failing over to secondary, all the log shipping starts from secondary, is that happen automatically? Or we need to configure log shipping again from the secondary to Primary? (if primary is available)

    Let me put it in this way. It's just a DR Test NOT the actual disaster. I'm testing & preparing document on what to do if a real disaster occurs.

    If I start with

    - ServerA as the primary

    - ServerB as the secondary.

    Before DR test:

    I disable log shipping backup job on ServerA and I then bring up ServerB, bring it through recovery, moving logins, jobs, and disable copy & restore jobs and have clients connect to it (Clients will connect from secondary location itself. Because we have DR application servers too and I just point these clients to secondary instance, ServerB and Nothing is coming from Primary location).

    Now, its called failover. No role switch right?

    If I want to role switch, then what exacltly I need to do?

    My actual concern is:

    After bringing the Secondary online, clients will connect and test some transactions and sign off. Now my task is to make the primary & secondary as they were before the start of DR test. To achive this:

    1. I want to configure log shipping again back from Primary to Secondary.To dothis:

    -> do I need disable log shipping from primary database(which will delete all log shipping jobs on Primary & secondary) ?

    ->and then delete the database on secondary

    ->take the backup on primary & restore it on secondary with NORECOVERY

    ->configure log shipping from primary database

    Is this the only method to follow? OR we can go back to the state before the start of DR Test? We have 50 GB database and if I need reconfigure log shipping, I need to copy that .bak of primary database to secondary location which will take 15 hrs and restore takes 1 hr. So after DR test there will be No log shipping for one whole day. Is this the only way to do?

    So I just want to know how you guys test the DRT using Log shipping.

    please give some exact steps to test DRT by considering a single database in Primary & Primary is available

    please advice..

  • After failing over to secondary, all the log shipping starts from secondary, is that happen automatically? Or we need to configure log shipping again from the secondary to Primary? (if primary is available)

    You need to configure it again from your new primary(secondary previously) to current secondary(primary previously).

    MJ

  • The log shipping from your DR server (now your PRIMARY) is not automatic. The primary is the server that is sending logs to the other server. If you failover, that is not the primary, and you would either need to take a full backup of your DR server and restore it on the main server, and make that the primary again, or reset log shipping from the DR ("B" serveR) to the main one.

    For your test, you did not do a roll switch. so, if you make transactions that need to get back to production, you would need to reset your "A" server from a backup of the "B" server. If these transactions do not need to go to production, you need a new full backup of the "A" server restored on the "B" server.

    note that for DR, you can't count on logins, jobs, etc. moving over in log shipping or getting them from A. When you set this up, be sure you move all logins to B, and all jobs (disabled). If you make a system change on A, new login or job, you need to manually do that on B as well.

  • Role Switch is only possible when Primary Instance is available right?

    please correct me if I misunderstood

    thanks

  • From the link http://msdn.microsoft.com/en-us/library/ms178117%28SQL.90%29.aspx

    Changing Roles Between Primary and Secondary Servers

    After you have failed over to a secondary server, you can configure your secondary database to act as a primary database. Then, you will be able to swap primary and secondary databases as needed.

    Performing the Initial Role Change

    The first time you want to fail over to the secondary database and make it your new primary database, there is a series of steps you must take. After you have followed these initial steps, you will be able to swap roles between the primary database and the secondary database easily.

    1. Manually fail over from the primary database to a secondary database. Be sure to back up the active transaction log on your primary server with NORECOVERY. For more information, see Failing Over to a Log Shipping Secondary.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. On your secondary database (the database you want to be the new primary), configure log shipping using SQL Server Management Studio. For more information, see How to: Enable Log Shipping (SQL Server Management Studio). Include the following steps:

    * Use the same share for creating backups that you created for the original primary server.

    * When adding the secondary database, in the Secondary Database Settings dialog box, enter the name of the original primary database in the Secondary database box.

    * In the Secondary Database Settings dialog box, select No, the secondary database is initialized.

    Swapping Roles

    After you have completed the steps above for the initial role change, you can change roles between the primary database and the secondary database by following the steps in this section. To perform a role change, follow these general steps:

    1. Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server).

    Here, after Performing the Initial Role Change steps, I'm able to see that Secondary is acting as Primary and Primary acting as Secondary. Then I did NOT understand why we need to do the 2nd set of Steps, "Swapping roles" (these steps are again same as Initial role change steps!!)

    plz plz clarify me..I'm stuck here.

    thanks

  • 2nd set of tasks are just a genralised approach to do role swapping. As its working for you and you have already follwed the steps you needn't worry.

    MJ

  • rambilla4 (11/3/2009)


    From the link http://msdn.microsoft.com/en-us/library/ms178117%28SQL.90%29.aspx

    Changing Roles Between Primary and Secondary Servers

    After you have failed over to a secondary server, you can configure your secondary database to act as a primary database. Then, you will be able to swap primary and secondary databases as needed.

    Performing the Initial Role Change

    The first time you want to fail over to the secondary database and make it your new primary database, there is a series of steps you must take. After you have followed these initial steps, you will be able to swap roles between the primary database and the secondary database easily.

    1. Manually fail over from the primary database to a secondary database. Be sure to back up the active transaction log on your primary server with NORECOVERY. For more information, see Failing Over to a Log Shipping Secondary.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. On your secondary database (the database you want to be the new primary), configure log shipping using SQL Server Management Studio. For more information, see How to: Enable Log Shipping (SQL Server Management Studio). Include the following steps:

    * Use the same share for creating backups that you created for the original primary server.

    * When adding the secondary database, in the Secondary Database Settings dialog box, enter the name of the original primary database in the Secondary database box.

    * In the Secondary Database Settings dialog box, select No, the secondary database is initialized.

    [\quote]

    [\quote]

    This one if you did it for the first time

    Swapping Roles

    After you have completed the steps above for the initial role change, you can change roles between the primary database and the secondary database by following the steps in this section. To perform a role change, follow these general steps:

    1. Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server).

    You already done, if you want to swap the roles again to failover from Primary(originally Secondary) to Secondary(originally Primary)- then follow this step.

    At this point, you all ready to go dont worry about the Swapping roles again.

    Here, after Performing the Initial Role Change steps, I'm able to see that Secondary is acting as Primary and Primary acting as Secondary. Then I did NOT understand why we need to do the 2nd set of Steps, "Swapping roles" (these steps are again same as Initial role change steps!!)

    plz plz clarify me..I'm stuck here.

    thanks

  • Krishna Potlakayala (11/4/2009)


    rambilla4 (11/3/2009)


    From the link http://msdn.microsoft.com/en-us/library/ms178117%28SQL.90%29.aspx

    Changing Roles Between Primary and Secondary Servers

    After you have failed over to a secondary server, you can configure your secondary database to act as a primary database. Then, you will be able to swap primary and secondary databases as needed.

    Performing the Initial Role Change

    The first time you want to fail over to the secondary database and make it your new primary database, there is a series of steps you must take. After you have followed these initial steps, you will be able to swap roles between the primary database and the secondary database easily.

    1. Manually fail over from the primary database to a secondary database. Be sure to back up the active transaction log on your primary server with NORECOVERY. For more information, see Failing Over to a Log Shipping Secondary.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. On your secondary database (the database you want to be the new primary), configure log shipping using SQL Server Management Studio. For more information, see How to: Enable Log Shipping (SQL Server Management Studio). Include the following steps:

    * Use the same share for creating backups that you created for the original primary server.

    * When adding the secondary database, in the Secondary Database Settings dialog box, enter the name of the original primary database in the Secondary database box.

    * In the Secondary Database Settings dialog box, select No, the secondary database is initialized.

    [\quote]

    This one if you did it for the first time

    Swapping Roles

    After you have completed the steps above for the initial role change, you can change roles between the primary database and the secondary database by following the steps in this section. To perform a role change, follow these general steps:

    1. Bring the secondary database online, backing up the transaction log on the primary server with NORECOVERY.

    2. Disable the log shipping backup job on the original primary server, and the copy and restore jobs on the original secondary server.

    3. Enable the log shipping backup job on the secondary server (the new primary server), and the copy and restore jobs on the primary server (the new secondary server).

    You already done, if you want to swap the roles again to failover from Primary(originally Secondary) to Secondary(originally Primary)- then follow this step.

    At this point, you all ready to go dont worry about the Swapping roles again.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply