• georgian2133 - Friday, May 12, 2017 8:19 AM

    How to check Database mirroring is enabled  or Log shipping is enabled on MS SQL Server server ?

    One option is that you could query the tables that would have information for any databases involved in mirroring or log shipping.
    SELECT * FROM sys.database_mirroring
    SELECT * FROM log_shipping_primary_databases

    database_mirroring will have a row for every database but the values of the columns with the name starting with mirroring_xxx would be null. So I guess you could get the database names for those using something like:
    SELECT d.name as MirroredDB
    FROM sys.database_mirroring m
    INNER JOIN sys.databases d on
    m.database_id = d.database_id
    WHERE m.mirroring_guid is not null

    SELECT primary_database as LogShippedDB
    FROM msdb.dbo.log_shipping_primary_databases
    WHERE primary_database is not null

    Sue