[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to find SQL Server Job process CPU usage?

Posted on 2011-02-10
3
Medium Priority
?
834 Views
Last Modified: 2012-06-21
We are running many jobs in Prod. SQL Server 2008 (windows 2008 R2). Currently it is showing more than 90% CPU usage. Can you please tell me how to find out which SQL Server jobs are taking more CPU USAGE? And also I need to find out CPU usage is more due to SQL Server issue or Application issue. Please guide me. Thanks.
0
Comment
Question by:PKTG
3 Comments
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 34867089
What process is "eating" your cpu?... what is the name that appears in the task manager?
0
 
LVL 41

Accepted Solution

by:
Sharath earned 2000 total points
ID: 34867316
What steps ( or SQL statements) you have in your job? You can see the current running queries and can determine which one is taking long time. Below scripts may be useful for you.

http://blog.sqlauthority.com/2009/01/07/sql-server-find-currently-running-query-t-sql/


SELECT TOP 100
        (qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count as [Avg IO],
        substring (qt.text,qs.statement_start_offset/2, 
         (case when qs.statement_end_offset = -1 
        then len(convert(nvarchar(max), qt.text)) * 2 
        else qs.statement_end_offset end -    qs.statement_start_offset)/2) 
        as query_text,
    qt.dbid,
    qt.objectid 
FROM sys.dm_exec_query_stats qs
cross apply sys.dm_exec_sql_text (qs.sql_handle) as qt
ORDER BY [Avg IO] DESC

Open in new window

0
 
LVL 22

Expert Comment

by:8080_Diver
ID: 34867382
You might want to investigate Confio's Ignite (or a similar tool) that shows the wait-states for the processes running on the database.  It will show you which queries are the worst offenders and what the nature of their Waits are.

We use that tool where I work and it has often pointed to poorly written queries that were eating PCU cycles and to missing indexes that contributed to the lostt of cycles.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question