Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Database mirroring Expand / Collapse
Posted Saturday, March 21, 2009 1:22 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, July 14, 2014 1:05 PM
Points: 386, Visits: 318
[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


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 :)
Post #680862
Posted Sunday, March 22, 2009 9:54 PM


Group: General Forum Members
Last Login: Yesterday @ 1:00 AM
Points: 2,993, Visits: 2,590
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.

Post #681220
Posted Monday, March 23, 2009 10:35 AM



Group: General Forum Members
Last Login: Tuesday, September 16, 2014 8:20 AM
Points: 1,616, Visits: 1,544
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
Twitter: @SQLSoldier
My book: Pro SQL Server 2008 Mirroring
Microsoft Certified Master: SQL Server 2008
Principal DBA: Outerwall, Inc.
Also available for consulting: SQL DBA Master
Post #681633
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse