Sql-server – How to Find Pages/Sec from sys.dm_os_performance_counters

performanceperformance-tuningsql serversql-server-2012

How do we find pages/sec from dm_os_performance_counters DMV, I do not see it here:

SELECT * FROM sys.dm_os_performance_counters
where counter_name like '%page%'

Monitor Memory Usage

Pages/sec Definition: The Pages/sec counter indicates the number of
pages that either were retrieved from disk due to hard page faults or
written to disk to free space in the working set due to page faults.

Best Answer

The page you reference talks about monitoring a system running SQL Server, but it does not make any implicit or explicit promise that Memory:Pages/sec will be available specifically in the DMV sys.dm_os_performance_counters. This is more about general system monitoring using performance monitor, 3rd party tools, etc.

The DMV only exposes a specific subset of counters that are SQL Server-specific (according to someone, since it can be subjective). Memory:Pages/sec is, at least currently, not one of them - primarily because it measures for the whole operating system, not for the current instance of SQL Server. You can see what counters are available simply by querying the DMV. If the DMV is empty, Erik's link is a good one.

You can also look directly at the perf-{instance}sqlctr.ini in your instance's Binn folder. You may be tempted to hack the ini file to stuff your desired counters into the DMV, but I haven't tried this, don't recommend it, and am sure you will be on your own in terms of support. Better solution is to use a different method to monitor performance counters (both those you can get from the DMVs and those you can't).