Skip to content

Database for the Availability Group is Not Synchronizing / Recovery Pending State

  • by

Database for the Availability Group is not synchronising and recovery is pending.

This error message comes when SQL Server is unable to access the database log files of your availability group database or databases. Both the Primary and Secondary Replicas are susceptible to this issue.

Problem on Primary Replica:

To determine whether the database log file is there or not, check the SQL Server error log on Primary Replicas.
The error code 9001 is also displayed in cases where the log file cannot be accessed.
In order to resolve the issue on Primary Replicas, we should:

  1. Check the database files’ accessibility.
  2. Try suspending and restarting the availability group database; this might not fix the problem.
  3. Use the ALTER command listed below ALTER database DBNAME set ONLINE to make the database ACTIVE.
  4. Check the database status after a few minutes; it should now be GREEN and HEALTHY.

If the problem recurs on the second copy:

Check the SQL Server error log for any error messages to determine whether the database log file is accessible or unavailable. The error code 9001 is recorded if the log file cannot be accessed.
The actions below should be followed to fix the issue on secondary replicas:

  1. Check the database files’ accessibility.
  2. Try suspending and resuming the availability group database; this might not fix the problem.
  3. We are unable to execute the Alter command to activate the Availability Group database since the secondary replica is being restored. On the sys.databases reports, the database status is ONLINE, though.
  4. Since the secondary replica SQL Instance will initiate the recovery process for all databases, we must RESTART it. Additionally, it will help with database synchronization with the primary replica and successful recovery of the problematic Availability Group database.

Leave a Reply

%d bloggers like this: