SQL SERVER – How to Break Mirroring?

While I am not a high availability expert, I sometimes get questions related to it while I am helping my clients with a Comprehensive Database Performance Health Check. Today we will see a very simple script to break mirroring in SQL Server.

SQL SERVER - How to Break Mirroring? breakmirroring-800x254

If you have configured mirroring on your environment and due to some reason, you need to break the mirroring, here is the simple script for the same.

Remove Mirroring

ALTER DATABASE [DatabaseName] SET PARTNER OFF;

Bring Mirrored Database Online

RESTORE DATABASE <database_name> WITH RECOVERY;

Well, that’s it. A very short blog post today. Do send me your questions and I will be happy to do answer you on my blog.

Here are my few recent videos and I would like to know what is your feedback about them. Do not forget to subscribe SQL in Sixty Seconds series.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

, ,
Previous Post
SQL SERVER – Prevent Users from Changing Index
Next Post
SQL SERVER – Types of Triggers

Related Posts

1 Comment. Leave new

  • Good one. May be can add Failover and Suspend too.

    ALTER DATABASE [DatabaseName] SET PARTNER FAILOVER;

    ALTER DATABASE [DatabaseName] SET PARTNER SUSPEND;

    Have a question. Whenever failover to happens, Identity value is reset to next whole number. If you take a case that identity value was 245 or 455 then it changes to 1000.

    Reply

Leave a Reply

Menu