SQL Server Mirroring – Witness Server Configuration

mirroringsql serversql-server-2012

Inherited a new SQL estate that has never been touched by a full time DBA. Mirroring has been setup and removed on multiple servers but not fully, old witness servers are still active.

Is there anyway from the witness server to determine if a principle/mirror is still communicating or active.

I have picked through the DMV's with the DMV below being the most helpful but one of the four witness instances does report a connection, any advice would be helpful.

sys.dm_db_mirrroing_connections

Best Answer

Not exactly understand the need, but i guess below might help:

To get the information between Principal and mirror via witness query the dmv sys.database_mirroring_witnesses

You can get the info from columns

principal_server_name -- Name of partner server whose copy of the database is currently the principal database

mirror_server_name --Name of the partner server whose copy of the database is currently the mirror database.

Also, check out the cool commands from dbatools Get-DbaDbMirror

PS C:\> Get-DbaDbMirror -SqlInstance  sql2016

Gets properties of database mirrors and mirror witnesses on sql2016 SQL Server instance