Solved

How to find SQL Server Job process CPU usage?

Posted on 2011-02-10
3
775 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article I will describe the Backup & Restore 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.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now