Category Archives: vlf

Getting VLF stats for multiple databases

After watching Paul Randal’s (blog | twitter) MCM video on log files, I wanted to find a quick way to get VLF (Virtual Log File) statistics across multiple databases and servers. I went two routes, PowerShell and T-SQL. Our internal monitoring uses T-SQL already, so I wanted to be able to easily work with the existing framework. I wanted to create a PowerShell version, as some others might find it useful and I just like working with PowerShell.

T-SQL Version
I wound up making my table structure the same as David Levy in this blog post. Michelle Ufford has a very similar script at her blog post.

PowerShell Version
Thanks to Aaron Nelson (blog | twitter) for giving me an idea to tweak this.

More on VLFs: