Friday, 22 June 2012

SQL Server Mirroring Disconnected - Debug

If mirroring is showing as suspended it should only be necessary to run the resume command. If it is showing as disconnected the following may help to track down and fix the problem.

Check all things mirroring from the following tables:

SELECT * FROM sys .dm_db_mirroring_auto_page_repair SELECT * FROM sys .dm_db_mirroring_past_actions SELECT * FROM sys .dm_db_mirroring_connections SELECT * FROM sys .database_mirroring SELECT * FROM sys .database_mirroring_endpoints


Check the error log

Check that the route between servers is accessible.

Audit Database Mirroring Login Database Mirroring State Chang Database Mirroring Connection Broker: Connection


Try resuming mirror by running the following on the principal for each database:

ALTER DATABASE dbName SET PARTNER RESUME


Try restarting the endpoints on both servers.

ALTER ENDPOINT endpointName state = STOPPED ALTER ENDPOINT endpointName state = STARTED