Availability Group Database Not Synchronizing / Recovery Pending State

Availability Group Database Not Synchronizing / Recovery Pending State:


When SQL Server is unable to access the database log files of your Availability Group Database/Databases, this error message appears. This problem can occur on both the Primary and Secondary Replicas.

Issue happened on Primary Replica:

You can check the SQL Server error log on Primary Replicas to see if the database log file is available or not.
If the log file is inaccessible, the error number 9001 is also reported.

We can fix the problem on Primary Replicas by doing the following:

  1. Ascertain that the database files are accessible.
  2. Attempt to SUSPEND and RESUME the Availability Group database; however, this may not resolve the issue.
  3. Set the database ONLINE using the ALTER command below ALTER database DBNAME set ONLINE
  4. Wait a few minutes and verify the database status; it should now be GREEN and HEALTHY.

If the Issue Reappears on the Secondary Replica:

If the database log file is available or inaccessible, look for error messages in the SQL Server error log. If the log file is inaccessible, the error number 9001 is logged.

To fix the problem on secondary replicas, follow these steps:

  1. Ascertain that the database files are accessible.
  2. Attempt to SUSPEND and RESUME the Availability Group database; however, this may not resolve the issue.
  3. Since the secondary replica is in the process of being restored, we can’t use the Alter command to bring the Availability Group database online. However, the db status on the sys.databases reports is ONLINE.
  4. We need to RESTART the secondary replica SQL Instance since it will start the recovery process for all databases. It will also assist in successfully recovering the faulty Availability Group database and synchronizing the database with the primary replica.