database mirroring queries

SELECT db.name, m.mirroring_role_desc,mirroring_state_desc,mirroring_safety_level,
mirroring_partner_name,mirroring_partner_instance,mirroring_witness_name,mirroring_witness_state_desc,*
FROM sys.database_mirroring m
JOIN sys.databases db
ON db.database_id = m.database_id
where db.name='DBNamehere'


SELECT 
   databases.name AS DatabaseName,
   database_mirroring.mirroring_state_desc,
   database_mirroring.mirroring_role_desc,
   database_mirroring.mirroring_safety_level,
   database_mirroring.mirroring_safety_level_desc,
   database_mirroring.mirroring_safety_sequence,
   database_mirroring.mirroring_witness_name,
   database_mirroring.mirroring_witness_state,
   database_mirroring.mirroring_witness_state_desc   
FROM sys.database_mirroring    
INNER JOIN sys.databases ON databases.database_id=database_mirroring.database_id
WHERE databases.database_id > 4 

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server