Thursday 2 August 2012

Most Important Queries To Remember For Database Mirroring Administration


How to manually fail over a database mirroring session?
1.       Connect to the principal server.
2.       Set the database context to the master database.
3.       ALTER DATABASE <database_name> SET PARTNER FAILOVER

How to Force Service in a Database Mirroring Session?
1.       Connect to the mirror server.
2.       Issue the following statement.
3.      
ALTER DATABASE <database_name> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS  

How to Resume a Database Mirroring Session?
1.       Connect to either partner.
2.       Issue the following T-SQL statement.
3.      
ALTER DATABASE <database_name> SET PARTNER RESUME 


How to pause a database mirroring session?
1.       Connect to either partner.
2.       Issue the following T-SQL statement.
3.      
ALTER DATABASE <database_name> SET PARTNER SUSPEND 


How to turn ON transaction safety?
1.       Connect to the principal server.
2.       Issue the following T-SQL statement.
3.      
ALTER DATABASE <database_name> SET PARTNER SAFETY FULL

How to turn OFF transaction safety?
1.       Connect to the principal server.
2.       Issue the following statement.
3.      
ALTER DATABASE <database_name> SET PARTNER SAFETY OFF
 
How to remove Database Mirroring?
1.       Connect to either partner.
2.       Issue the following T-SQL statement.
3.       ALTER DATABASE <database_name> SET PARTNER OFF


How to Remove the Witness from a Database Mirroring Session?
1.       Connect to either partner.
2.       Issue the following statement.
3.       ALTER DATABASE <database_name> SET WITNESS OFF

No comments:

Post a Comment