Wednesday, May 7, 2014

Mirrored Databases disconnect and goes in-recovery state after a server restart

Recently, I had a situation where a production server was restarted and soon after the restart we found that the database mirroring was disconnected.
And as a bonus, one of the mirrored database was hung in recovery state.

When I investigated further, I found the below message in the SQL Server Logs.

Bypassing recovery for database '<DB 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.

This clearly says the connection between the principal and  the mirror is not established properly and the combination of a Mirrored Database with a big log file and a server restart caused the "In Recovery State" of the mirrored database.
To fix this error, I had to Restart the Database Mirroring Endpoint.

--To Stop the Endpoint
ALTER ENDPOINT <EndPoint Name> STATE=STOPPED

--To Start the Endpoint
ALTER ENDPOINT <EndPoint Name> STATE=STARTED

3 comments:

  1. where you had this situatiion sir?//?

    ReplyDelete
  2. Today i learn very interesting point and easy fix.

    ReplyDelete
  3. Helpful explanation of the *Microsoft.ACE.OLEDB.12.0 provider is not registered* error. Many developers run into this issue when importing Excel or Access data into SQL Server or .NET applications. Usually it happens because the Microsoft Access Database Engine or Office data connectivity components are not installed on the system, preventing SQL Server from interacting with Office files. Articles like this are great for troubleshooting common development problems. Learning technical skills through a **Java course Chennai**, **Python course**, **Data Science / Data Analyst training**, **UI/UX course**, or **Full Stack Development course** can also help developers strengthen their programming and software skills.

    ReplyDelete