Is there a way to find which database is using how much of total CPU

Posted on 2011-10-31
Last Modified: 2012-05-12
hi all,
Is there a way to find particularly on database to database like how much of CPU is a particular database using?

Question by:msdba
    LVL 28

    Accepted Solution

    This won't tell you a percent, but you should be able to get an idea of the load for each DB:

    --This first thing to check if CPU is at 100% is to look for parallel queries:
    -- Tasks running in parallel (filtering out MARS requests below):
    * from sys.dm_os_tasks as t 
    where t.session_id in (
    select t1.session_id 
    from sys.dm_os_tasks as t1 
    group by t1.session_id 
    having count(*) > 1 
    and min(t1.request_id) = max(t1.request_id));
    -- Requests running in parallel:
    select *
    from sys.dm_exec_requests as r 
    join (
    select t1.session_id, min(t1.request_id)
    from sys.dm_os_tasks as t1 
    group by t1.session_id 
    having count(*) > 1 
    and min(t1.request_id) = max(t1.request_id)
    ) as t(session_id, request_id)
    on r.session_id = t.session_id 
    and r.request_id = t.request_id;

    Open in new window


    Author Closing Comment


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    754 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

    20 Experts available now in Live!

    Get 1:1 Help Now