Availability Group Database Not Synchronizing / Recovery Pending State

Availability Group Database Not Synchronizing / Recovery Pending State:


This may occur when SQL Server is unable to access the database log files of your Availability Group Database/Databases.This issue can be occurred on Primary Replica and also on Secondary Replica .

Issue happened on Primary Replica:

On Primary Replicas you can check SQL Server error log for database log file is being accessible or inaccessible
Also the error number 9001 is being recorded if the log file is inaccessible

To Resolve the issue on Primary Replicas we can do the following :

  1. Make sure Database files are Accessible.
  2. Try to SUSPEND and RESUME the Availability Group database ,sometimes it may not work and the issue still persists.
  3. Use the below ALTER command to set the database ONLINE ALTER database DBNAME set ONLINE
  4. Wait for few minutes and check the DB status it comes to GREEN and HEALTHY state.

If the Same Issue happens on Secondary Replica:

Check for error message in SQL Server error log for database log file is being accessible or inaccessible, Also the error number 9001 is being recorded if the log file is inaccessible

To Resolve the issue on secondary Replicas do the following :

  1. Make sure Database files are Accessible.
  2. Try to SUSPEND and RESUME the Availability Group database ,sometimes it may not work and the issue still persists.
  3. Here we cannot use Alter command to set the Availability Group database to online as the secondary replica will be on restoring state, the db status showing on sys.databases reports as ONLINE.
  4. We need to RESTART the secondary replica SQL Instance as it will initiate the recovery process of all databases, it also helps to recover the problematic Availability Group database Successfully and
    the DB gets synchronization with Primary Replica.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.