Solved

How to find SQL Server Job process CPU usage?

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

728 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