January 04, 2010

How to capture SQL Server PerfMon Counters without running Performance Monitor

The performance monitor is a great tool to monitor the performance of your network. You can use PerfMon to view SQL Server objects and performance counters as well as the behavior of other objects. However if you want to know an alternative method to capture SQL Server PerfMon Counters without running the Performance Monitor Tool, then use a SQL Server Operating System Related Dynamic Management View called sys.dm_os_performance_counters

SELECT * FROM sys.dm_os_performance_counters

I would still prefer the GUI, but knowing an alternate way of capturing PerfMon Counters does not hurt!

About The Author

Suprotim Agarwal, ASP.NET Architecture MVP works as an Architect Consultant and provides consultancy on how to design and develop Web applications.

Suprotim is also the founder and primary contributor to DevCurry, DotNetCurry and SQLServerCurry. He has also written an EBook 51 Recipes using jQuery with ASP.NET Controls.

Follow him on twitter @suprotimagarwal


Troy said...

One thing you need to be cautious about when using this DMV is that many of these counters are incremental from the last time the SQL Server was started. Themselves, the numbers may not mean anything. It's only when you establish a baseline and analyze "further" activity, that this wonderful DMV shows it's true worth.

BTW, in SQL Server 2000, one can query "master.dbo.sysperfinfo" to obtain the same information.

Suprotim Agarwal said...

Troy: Thanks for your useful comment!

Tom said...

Great for knowing what components are actually doing. For example is your disk mainly reading or writing.