?
Solved

How to find SQL Server Job process CPU usage?

Posted on 2011-02-10
3
Medium Priority
?
823 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

801 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