My database log is growing out of control, I recently removed the database from an availability group by when I look at the log reuse wait description it shows "AVAILABILITY_REPLICA"

I have tried to set the database to simple mode and then shrink the log file, I have tried full backups, log backups (in full mode after a full backup). But the status will not change and I cannot shrink the log file.

Any suggestions?

  • what version of sql server are you using and what is the patch level ? What do you get from this select a.*, b.name from sys.dm_hadr_database_replica_states a LEFT JOIN sys.databases b ON a.database_id = b.database_id ?
    – Kin Shah
    Jul 29, 2018 at 21:24

2 Answers 2


Take your database offline then back online. This should clear the AVAILABILITY_REPLICA wait, then you can shrink whatever you need to shrink.


Sometimes when you delete a database from the AG, and even delete the AG, a database will still stay in AVAILABILITY_REPLICA wait mode. (At least in 2019 without cumulative updates).

A restart of the SQL service solves it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.