Skip to content

Instantly share code, notes, and snippets.

@ronascentes
Created November 24, 2017 18:12
Show Gist options
  • Select an option

  • Save ronascentes/06f47cac7d875a55c6663ce413b47a64 to your computer and use it in GitHub Desktop.

Select an option

Save ronascentes/06f47cac7d875a55c6663ce413b47a64 to your computer and use it in GitHub Desktop.
SELECT N'Perfmon' as [Category], [object_name],counter_name, cntr_value
FROM sys.dm_os_performance_counters WITH (NOLOCK)
WHERE [object_name] LIKE N'%Memory Manager%'
AND (counter_name LIKE N'Total Server Memory (KB)%' OR counter_name LIKE N'Target Server Memory (KB)%'
OR counter_name = N'Memory Grants Outstanding' OR counter_name = N'Memory Grants Pending')
OR ([object_name] LIKE N'%Buffer Manager%' AND counter_name = N'Page life expectancy')
OR ([object_name] LIKE N'%General Statistics%' AND counter_name = N'Transactions')
OR ([object_name] LIKE N'%General Statistics%' AND counter_name = N'User Connections')
OR ([object_name] LIKE N'%SQL Statistics%' AND counter_name = N'Batch Requests/sec')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment