Database mirroring

  • [font="Times New Roman"][/font]Hi .

    Database mirrored servers A & B

    A - PROD server - Principal server

    B - COB server - Mirror server

    Two server A and B configured for mirroring , after some period Databases in Mirror B server was brought up by taking the tail transaction log backup and restoring it

    After which Database mirroring was configured freshly from B - A

    Currently:

    B - COB server - Principal server

    A - PROD server - Mirror server

    Now my question here is i want to return to old state without breaking mirroring or configuring it newly as given below , is it possible ?(Becoz database size is in TB , time consuming for new configuration)

    Example : Needed

    A - PROD server - Principal server

    B - COB server - Mirror server

    Immediate Feedback appreciable 🙂

  • The ALTER DATABASE commands that are used to change the role of each database do not require you to break or configure mirroring at all. You should not need to use ANY form of restore command to achieve this either (I am not even sure that you can use them to switch roles).

    You should be able to switch roles using Management Studio (right click on the database and using the appropriate options for database mirroring) or with the equivalent ALTER DATABASE command.

  • By your description above, it sounds like you are not using a witness server. As such, I am assuming that you are running mirroring asynchronously.For this setup, there is a 2 step process for failing the mirror over to the other server.

    When running synchronously, you simply issue the partner failover command on either server:

    Alter Database [Database Name] Set Partner Failover;

    When running asynchronously, you need to first enable safety and then allow the databases to get synchronized. Then you can failover the mirror:

    Alter Database [Database Name] Set Partner Safety Full;

    ...... wait

    Alter Database [Database Name] Set Partner Failover;

    Then after the failover is complete, you can turn safety off again:

    Alter Database [Database Name] Set Partner Safety Off;

    If you want to automate this process, you can query sys.database_mirroring for the database miroring state in a loop until it reaches synchronization. When I do this, I suggest using a WaitFor Delay timer to limit it to a single loop per set time interval and count the number of loops and exit the loop with an error if the loop reaches a preset count. I generally use a max counter value of 300 and a waitfor delay of 1 second which equates to 5 minutes total time to synchrnoize.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

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