Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jhunu
Starting Member
18 Posts |
Posted - 2011-11-22 : 13:58:47
|
query to find out the CPU utilization |
|
vikki.seth
Yak Posting Veteran
66 Posts |
Posted - 2011-11-22 : 14:08:36
|
Here is your Query.SELECT(ROUND(CAST (A.cntr_value1 AS NUMERIC) / CAST (B.cntr_value2 AS NUMERIC), 3))*100 AS [CPU Utilization Percentage]FROM(SELECT cntr_value AS cntr_value1FROM sys.dm_os_performance_countersWHERE object_name = 'MSSQL$INSTANCENAME:Resource Pool Stats'and counter_name = 'CPU usage %' ) AS A,(SELECT cntr_value AS cntr_value2FROM sys.dm_os_performance_countersWHERE object_name = 'MSSQL$URINSTANCENAME:Resource Pool Stats'and counter_name = 'CPU usage % base' ) AS B |
|
|
|
|
|