SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database mirroring


Database mirroring

Author
Message
rajganesh.dba
rajganesh.dba
SSC Eights!
SSC Eights! (884 reputation)SSC Eights! (884 reputation)SSC Eights! (884 reputation)SSC Eights! (884 reputation)SSC Eights! (884 reputation)SSC Eights! (884 reputation)SSC Eights! (884 reputation)SSC Eights! (884 reputation)

Group: General Forum Members
Points: 884 Visits: 323
[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 Smile
happycat59
happycat59
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8809 Visits: 3281
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.



Robert Davis
Robert Davis
SSCertifiable
SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)SSCertifiable (6.8K reputation)

Group: General Forum Members
Points: 6768 Visits: 1632
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 MVP
Database Engineer at BlueMountain Capital Management
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search