Home > dba, powershell, sql, vlf > Getting VLF stats for multiple databases

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:


Categories: dba, powershell, sql, vlf Tags:
  1. retracement
    December 11th, 2010 at 02:10 | #1

    Good post there Eric. I wrote something similar in C# with GUI front end a long time ago now, but I really think the Powershell version is a great example of a good reason for DBAs to be learning PS -its simplicity and power.

  1. No trackbacks yet.

%d bloggers like this: