Check if database mirroring in use/active

  • Nunnery

    Ten Centuries

    Points: 1289

    I'm in the process of migrating an older database server to a new instance of SQL Server 2017 via database mirroring.  The old server appears to have a database mirroring endpoint already created. I'd like to drop this and create a new one utilizing windows authentication rather than certificates.  What would be the best way to ensure that the old endpoint is no longer being used? sys.database_mirroring has null values in each column for every database ID listed. Is it safe to assume that it is safe to remove the endpoint?

  • Eddie Wuerch

    SSChampion

    Points: 12271

    SELECT db_name(database_id), * 
    FROM sys.database_mirroring
    WHERE mirroring_state IS NOT NULL;

    From the online documentation for sys.database_mirroring:

    Contains one row for each database in the instance of SQL Server. If the database is not ONLINE or database mirroring is not enabled, the values of all columns except database_id will be NULL.

    Eddie Wuerch
    MCM: SQL

  • Sue_H

    SSC Guru

    Points: 90260

    If nothing shows in the database_mirroring DMV, you should be fine but may want to consider disabling the endpoint for awhile before deleting.

    Sue

  • Nunnery

    Ten Centuries

    Points: 1289

    Thank you for the replies.  Had thought about disabling the endpoint for the interim to be safe and will proceed with that approach.  Have a wonderful day!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply