sys.dm_os_performance_counters (Transact-SQL)

sys.dm_os_performance_counters (Transact-SQL)

 

Updated: August 23, 2016

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)yesAzure SQL DatabaseyesAzure SQL Data Warehouse yesParallel Data Warehouse

Returns a row per performance counter maintained by the server. For information about each performance counter, see Use SQL Server Objects.

System_CAPS_ICON_note.jpg Note


To call this from Azure SQL Data Warehouse or Parallel Data Warehouse, use the name sys.dm_pdw_nodes_os_performance_counters.

Column nameData typeDescription
object_namenchar(128)Category to which this counter belongs.
counter_namenchar(128)Name of the counter. To get more information about a counter, this is the name of the topic to select from the list of counters in Use SQL Server Objects.
instance_namenchar(128)Name of the specific instance of the counter. Often contains the database name.
cntr_valuebigintCurrent value of the counter.

 Note: For per-second counters, this value is cumulative. The rate value must be calculated by sampling the value at discrete time intervals. The difference between any two successive sample values is equal to the rate for the time interval used.
cntr_typeintType of counter as defined by the Windows performance architecture. See WMI Performance Counter Types on MSDN or your Windows Server documentation for more information on performance counter types.
pdw_node_idintApplies to: Azure SQL Data Warehouse, Parallel Data Warehouse

The identifier for the node that this distribution is on.

If the installation instance of SQL Server fails to display the performance counters of the Windows operating system, use the following Transact-SQL query to confirm that performance counters have been disabled.

SELECT COUNT(*) FROM sys.dm_os_performance_counters;  

If the return value is 0 rows, this means that the performance counters have been disabled. You should then look at the setup log and search for error 3409, "Reinstall sqlctr.ini for this instance, and ensure that the instance login account has correct registry permissions." This denotes that performance counters were not enabled. The errors immediately before the 3409 error should indicate the root cause for the failure of performance counter enabling. For more information about setup log files, see View and Read SQL Server Setup Log Files.

Requires VIEW SERVER STATE permission on the server.

The following example returns performance counter values.

SELECT object_name, counter_name, instance_name, cntr_value, cntr_type  
FROM sys.dm_os_performance_counters;  
  

Dynamic Management Views and Functions (Transact-SQL)
SQL Server Operating System Related Dynamic Management Views (Transact-SQL)
sys.sysperfinfo (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft