Solved

How to find SQL Server Job process CPU usage?

Posted on 2011-02-10
3
798 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 40

Accepted Solution

by:
Sharath earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

810 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