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.
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.
- MAX Columns Ever Existed in Table – SQL in Sixty Seconds #182
- Tuning Query Cost 100% – SQL in Sixty Seconds #181
- Queries Using Specific Index – SQL in Sixty Seconds #180
- Read Only Tables – Is it Possible? – SQL in Sixty Seconds #179
- One Scan for 3 Count Sum – SQL in Sixty Seconds #178
- SUM(1) vs COUNT(1) Performance Battle – SQL in Sixty Seconds #177
- COUNT(*) and COUNT(1): Performance Battle – SQL in Sixty Seconds #176
Reference: Pinal Dave (http://blog.SQLAuthority.com)
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.