大网数据广告活动
数据库与应用安全

Mirrored databases are disconnected

· 52CE 我爱测

This article provides a resolution for the problem where mirrored databases are left in a Disconnected or In Recovery state.

This article helps you resolve the problem where mirrored databases are left in a Disconnected or In Recovery state.

Original product version:   SQL Server
Original KB number:   2490051

Symptom

Consider the following scenario:

  • You have a computer that's running a secondary instance of Microsoft SQL Server in a two-server database mirror.

  • CPU usage reaches 100 percent on the computer, and you can't stop the SQL Server service by using SQL Server Management Tools.

  • You end the process of the SQL Server secondary instance by using Task Manager.

  • You restart the secondary instance of SQL Server.

In this scenario, all mirrored databases are in a Disconnected or In Recovery state. Additionally, an error message that resembles the following is logged in the SQL Server error log for each database:

Bypassing recovery for database 'Database Name' because it is marked as an inaccessible database mirroring database. A problem exists with the mirroring session. The session either lacks a quorum or the communications links are broken because of problems with links, endpoint configuration, or permissions (for the server account or security certificate). To gain access to the database, figure out what has changed in the session configuration and undo the change.

Cause

This issue occurs because of problems in the SQL Server database mirroring endpoints.

Resolution

To resolve this issue, use the following methods. If the first method doesn't resolve the issue, use the second method.

Method 1

Recycle the endpoint on the database mirror. To do this, follow these steps:

  1. On the principal database, run the following SQL script to stop the endpoint:

    ALTER ENDPOINT <Endpoint Name> STATE=STOPPED
    
  2. Execute the following SQL script to restart the endpoint:

    ALTER ENDPOINT <Endpoint Name> STATE=STARTED
    

    [!NOTE] If communication between the endpoints doesn't restart after you execute the scripts, run the scripts on the database mirror. However, the database may enter a Suspended state after you do this. If this issue occurs, run the following SQL script:

    ALTER DATABASE <Database Name> SET PARTNER RESUME
    

Method 2

Delete and re-create the database mirroring endpoints on both servers.

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 11/05/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。