SQL Server 2014 – Resolving High VLF Count in Availability Group

availability-groupssql serversql server 2014

(SQL 2014 Ent Ed.) – do I need to break my Availability Group if I need to reduce the number of VLFs in a database that is participating in an AG? Does anyone have the process documented? I am thinking the process goes something like this:

  1. Remove secondary nodes from the AG
  2. Delete the database from the secondary nodes
  3. Remove the database from the primary node of AG
  4. Shrink the log file and regrow to proper size
  5. Add the database back to the AG
  6. Add the secondary nodes back to the AG and allow to sync

Thank you for any direction you can help me with!

Best Answer

I just tested this on a SQL Server 2012 database that is in an availability group, and the log shrink is replicated to the secondary node(s). Accordingly, you can simply shrink log files and then resize them as you would on a database that is not in an availability group.