SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
georgian2133
georgian2133
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 3
How to check Database mirroring is enabled or Log shipping is enabled on MS SQL Server server ?
Sue_H
Sue_H
SSC Guru
SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)SSC Guru (58K reputation)

Group: General Forum Members
Points: 58907 Visits: 12859
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



georgian2133
georgian2133
SSC-Enthusiastic
SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)SSC-Enthusiastic (106 reputation)

Group: General Forum Members
Points: 106 Visits: 3
Thank you Sue for quick reply.

I have checked on our production server with the commands you shared and its give me the details as i need.
In current environment Mirroring is enabled.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search