Rebuild the log file to reduce VLFs

  • Hi all

    So I've been poking around one of the databases and as part of my ongoing health checks, I reviewed the VLF numbers with a quick DBCC LOGINFO.

    This particular database has 628... *sigh*

    So I start to look to rebuild this, and when I take my log backup, it gives me a warning that there are replication publications on this.

    Now in this case, the subscriber replication agent pops up once or twice a day and pulls everything across. And to complicate things, there are 2 subscribers.

    So I'm looking for suggestions on how I can rebuild this log file to reduce the number of VLFs without breaking the subscriptions and causing huge amounts of pain.

    Suggestions? Or do I just leave it alone. Performance is acceptable, so this is, in part, optimisation for the sake of optimising.

  • Find a quiet time when the active portion of the log is at the beginning of the log file. Shrink the log as small as possible. Grow it back to full size in the number of operations that will give you the VLF count that you want.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Between the two different subscriptions to replication, I'm not sure when that'll be!

    Thanks for the advice.

  • Here is a good post I used last month we are VLF issue with over 1000

    http://www.sqlskills.com/blogs/kimberly/post/8-Steps-to-better-Transaction-Log-throughput.aspx

    Thanks

  • I've read Kimberlys article and the follow up (http://www.sqlskills.com/BLOGS/KIMBERLY/post/Transaction-Log-VLFs-too-many-or-too-few.aspx)

    What I was more interested in getting some help with was managing the delayed replication, which appears to be preventing me from shrinking the log file.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply