x

cpu utilization

Good Morning , From task manager noticed CPU utilization for sqlserver.exe is 90%.We are using sql server 2008. How to understand which sql process is occupying that 90% of CPU volume? is there any query ? command? dmv? on which database it can be run to understand 90% of CPU utilized by which processess?

Can you please advise

Thank you

more ▼

asked Sep 18, 2012 at 07:57 AM in Default

avatar image

pits
830 89 92 95

You can use this DMV :)

SELECT TOP 10 (total_worker_time 1.0) / 1000000 AS CPU_Utilized_in_Seconds, text, FROM sys.dm_exec_query_stats CROSS APPLY sys.dm_exec_sql_text(sql_handle)

Sep 18, 2012 at 11:59 AM SumitRana
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

I use the query below in relation to using Process explorer.

 SELECT 
  r.session_id, st.text, qp.query_plan, r.status, os_thread_id
 FROM 
  sys.dm_os_threads AS ot
  JOIN sys.dm_os_tasks AS t ON t.worker_address = ot.worker_address
  JOIN sys.dm_exec_requests AS r ON t.session_id = r.session_id
  CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS st
  CROSS APPLY sys.dm_exec_query_plan(r.plan_handle) AS qp

A video from Jonathan that will walk you through it is here (saved me a few times - thanks!)

I work with 2 monitors, so that you can have PE in one windows showing the tread that is consuming high CPU and the query in the other windows with the related SQL.

more ▼

answered Sep 18, 2012 at 08:37 AM

avatar image

sp_lock
10.5k 27 37 37

(comments are locked)
10|1200 characters needed characters left

You can use this DMV :)

SELECT TOP 10 (total_worker_time 1.0) / 1000000 AS CPU_Utilized_in_Seconds, text, FROM sys.dm_exec_query_stats CROSS APPLY sys.dm_exec_sql_text(sql_handle)

more ▼

answered Sep 18, 2012 at 12:00 PM

avatar image

SumitRana
180 8 9 14

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x290
x27

asked: Sep 18, 2012 at 07:57 AM

Seen: 1167 times

Last Updated: Jun 05 at 12:27 AM

Copyright 2016 Redgate Software. Privacy Policy