Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to switch to the mirror backup database when the SQLServer2012 image master database fails?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "how to switch from SQLServer2012 image master database to image backup database". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Failure phenomenon:

SQLServer2012 mirrored environment:

Master Node 1

Slave Node 1

The main library service of the primary node is down and cannot be started.

Forcibly start the slave library.

Execute in the standby library:

USE master

ALTER DATABASE ec SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS

After that, it will be restored for two minutes, and the standby database will be available.

Database log:

The mirrored database "ec" is changing roles from "MIRROR" to "PRINCIPAL" because the mirroring session or availability group failed over due to FORCE_SERVICE_ALLOW_DATA_LOSS. This is an informational message only. No user action is required.

Starting up database 'ec'.

1 transactions rolled forward in database 'ec' (7:0). This is an informational message only. No user action is required.

0 transactions rolled back in database 'ec' (7:0). This is an informational message only. No user action is required.

CHECKDB for database 'ec' finished without errors on 2016-09-01 151533 local time. This is an informational message only; no user action is required.

If the mainframe is restored, cut it back.

-- the original primary server is restored and can continue to work. The image needs to be reset and an error may be reported for the first time.

Execute in the standby library:

USE master

ALTER DATABASE ec SET PARTNER RESUME;-restore the mirror

ALTER DATABASE ec SET PARTNER FAILOVER;-switch between master and slave

Master / standby switchover complete.

This is the end of the content of "how to switch to the image backup database when the SQLServer2012 image master database is hung up". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report