One database using most of the CPU

HI,
On one of our SQL server, the CPU was really high. I ran a query to find out which database was using most of the CPU. We have about 30 databases on that server. 
Database 1 is using 90% of the CPU 
Database 2 3.5%
Database 3 1.5%.
etc...
The database 1 in our Intranet and i really don't understand why it's using all the CPU available. We have just a few people connected at once. 
I'd like to know if there's any way to find out why that database is using all the CPU? Memory leak, bad code, etc...
Thank you

---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):
select * 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
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • When initiating an e mail to someone with several addresses used in the past the one I use most often does not come up in the first position.  How can I get these multiple e mails prioritized?

    When initiating an e mail to someone with several addresses used in the past the one I use most often does not come up in the first position.  How can I get these multiple e mails prioritized?

    We are talking about the Mail app, right? In the Mail menubar, click on Window and then Previous Recipients:
    That eliminates the previous recipients. If you are talking about the suggestions because there are 10 people with the name 'Steve' in your Contacts, then I do not know how to eliminate those unless you change the name slightly or wait until you type the last name or some other differentiator.

  • How to backup more than one database using powershell

    I am Trying to backup more than one database using the following script but no luck. I want user to type on command line the database they want to backup, e.g all databases that have "test" at the front like test.inventory, test.sales so i want
    user to type test.* and it backs up all databases related to test. Here is the script
        #$date = Get-Date -Format yyyyMMddHHmmss
        #$dbname = 'test.inventory'
        $dbToBackup = "test.inventory"
        cls
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | 
        Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.ConnectionInfo") 
        | Out-Null
        [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoEnum") | Out-
        Null
        Add-Type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral,   
        PublicKeyToken=89845dcd8080cc91"
        $server = New-Object Microsoft.SqlServer.Management.Smo.Server($env:ComputerName) 
        $server.Properties["BackupDirectory"].Value = "C:\_DBbackups"
        $server.Alter()
        $backupDirectory = $server.Settings.BackupDirectory
        #display default backup directory
        "Default Backup Directory: " + $backupDirectory
        $db = $server.Databases[$dbToBackup]
        $dbName = $db.Name
        $timestamp = Get-Date -format yyyyMMddHHmmss
        $smoBackup = New-Object ("Microsoft.SqlServer.Management.Smo.Backup")
        #BackupActionType specifies the type of backup.
        #Options are Database, Files, Log
        #This belongs in Microsoft.SqlServer.SmoExtended assembly
        $smoBackup.Action = "Database"
        $smoBackup.BackupSetDescription = "Full Backup of " + $dbName
        $smoBackup.BackupSetName = $dbName + " Backup"
        $smoBackup.Database = $dbName
        $smoBackup.MediaDescription = "Disk"
        $smoBackup.Devices.AddDevice($backupDirectory + "\" + $dbName + "_" + $timestamp +   
        ".bak", "File")
        $smoBackup.SqlBackup($server)
        #let's confirm, let's list list all backup files
        $directory = Get-ChildItem $backupDirectory
        $backupFilesList = $directory | where {$_.extension -eq ".bak"}
        $backupFilesList | Format-Table Name, LastWriteTime

    Or i am using this script which backs up everything except tempdb but dont know how to modify this so that it backs up up all test related databases
    Is there a way that i use test.*
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
    $s = new-object ("Microsoft.SqlServer.Management.Smo.Server") $instance
    $bkdir = "C:\_DBbackups" #We define the folder path as a variable 
    $dbs = $s.Databases
    foreach ($db in $dbs) 
         if($db.Name -ne "tempdb") #We don't want to backup the tempdb database 
         $dbname = $db.Name
         $dt = get-date -format yyyyMMddHHmm #We use this to create a file name based on the timestamp
         $dbBackup = new-object ("Microsoft.SqlServer.Management.Smo.Backup")
         $dbBackup.Action = "Database"
         $dbBackup.Database = $dbname
         $dbBackup.Devices.AddDevice($bkdir + "\" + $dbname + "_db_" + $dt + ".bak", "File")
         $dbBackup.SqlBackup($s)

  • The ads load slowly, even it uses 95% of the cpu of any computer.

    heyy
    i am using open-x ad server
    the ads load slowly, even it uses 95% of the cpu of any computer.
    any one can advice?!!!
    here is the site links:
    www.alarab.net
    اخبار
    مسلسلات وفيديو مشاهدة افلام مباشرة
    اخبار موقع العرب
    مسلسلات تركية ومشاهدة افلام مباشرة
    اغاني mp3
    مشاهدة افلام اجنبية مباشرة
    أغاني MP3
    العاب فلاش
    البوم صور
    افلام عربية
    برامج تلفزيون
    فيديو كليب
    مسرحيات
    مسلسلات تركية
    مسلسلات عربية
    مسلسلات كرتون
    ابراج وعلم الغيب

    To amplify on what PB asked...
    These questions below may be for a different product... but the information you need to
    supply is the same, for the products you use
    More information needed for someone to help... please click these links and provide the
    requested information
    -Information FAQ http://forums.adobe.com/message/4200840
    -Effective questions http://forums.adobe.com/thread/416679
    -How to get help quickly http://forums.adobe.com/thread/419406
    What are you editing, and does your project match your video?
    Importing Video http://forums.adobe.com/thread/1065281
    -and project settings http://forums.adobe.com/thread/1112086
    When your project sequence is correct, you will not see a red line over your timeline
    at first import, before you do anything to the video
    Read Bill Hunt on a file type as WRAPPER http://forums.adobe.com/thread/440037
    What is a CODEC... a Primer http://forums.adobe.com/thread/546811
    What CODEC is INSIDE that file? http://forums.adobe.com/thread/440037
    Report back with the codec details of your file, use the programs below... a screen
    shot works well to SHOW people what you are doing
    http://forums.adobe.com/thread/592070?tstart=30
    For PC http://mediainfo.sourceforge.net/en or http://www.headbands.com/gspot/
    For Mac http://mediainspector.massanti.com/

  • I have two apple id's because my hotmail account is no longer active. How can I delete the old one and use or update the new one?  Every time I try it won't allow me and now my iPad thinks there are two accounts and they are arguing with each other. Help!

    I have two apple id's because my hotmail account is no longer active. How can I delete the old one and use or update the new one?  Every time I try it won't allow me and now my iPad thinks there are two accounts and they are arguing with each other. Help!

    You can't merge accounts or copy content to a different account, so anything that you bought or downloaded via the old account is tied to that account - so any updates that those apps get you will only be able to download via that account. You can change which account is logged in on the iPad via Settings > Store

  • I want to copy songs from my old ipad to a new one. laptop used in configuring the old ipad crashed and cant be used again.

    i want to copy songs from my old ipad to a new one. laptop used in configuring the old ipad crashed and cant be used again

    You may be able to re download iTunes purchases for free directly on the new iPad.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Note: Previously purchased music is only available through iTunes in the Cloud in Australia, Canada, Cypress, France, Ireland, Luxembourg, Malta, Mexico, New Zealand, Spain, the United Kingdom, and the United States. Previously purchased TV shows are only available through iTunes in the Cloud in the United States.

  • Can I sync two computers when one is using lion and the other snow leopard

    can I sync two computers when one is using lion and the other snow leopard

    will my data be shared well using Mobile Me?

  • HT201441 I buy may iPhone 5 from the UK store ,, It s A new one and no one has used it before ,, the problem that it asked for an other apple ID !!! ,, my order for my iPhone is here in the UK store .. what should i do now ????     ,,, help me please

    I buy may iPhone 5 from the UK store ,, It s A new one and no one has used it before ,, the problem that it asked for an other apple ID !!! ,, my order for my iPhone is here in the UK store .. what should i do now ????     ,,, help me please

    Take it back and ask for a refund or a replacement.

  • Firefox hangs at random moments and uses 25% of the CPU (one core)

    Hello,
    On random websites and moments, I notice Firefox using 25%CPU. I have 4 cores. I don't know what's causing it, and it is pretty annoying. It just hangs and becomes unresponsive for about ~ 30-45 seconds. After that it happily continues without problems. It doesn't actually crash, it only hangs.
    I think it's something with an extension that's causing it. I have this as well on my laptop, that has Hyperthreading. (this PC doesn't) - On the laptop it uses 13% CPU when the same issue appears.
    I have Firefox 5 fully updated. Addons I use:
    Ghostery
    Adblock Plus
    HTTPS Everywhere
    WOT (Web of Trust)
    I use on both computers Windows 7 Professional. One of them is English, the other Dutch. Both legal and with all updates.
    I also have the Flash and Silverlight plugin, up-to-date.
    If there's any other information you need please let me know. Would like to have the issue resolved :)
    Thanks,
    Niels

    Nope - no fix yet :( I have installed a few new addons though: HTTPSEverywhere, Ghostery and NoScript. I'm not sure which one is causing it, but one of them caused the problem to drastically reduce. I have it once a month now, maybe.. Before that I had it multiple times a day.
    It's probably Ghostery or Noscript fixing it, due to the things they forbid from loading :)
    Niels

  • Plugin container exe uses half of the cpu and that heats the motherboard, cores. some times temperature in motherboard is about 90 degree which is unacceptable. it is like that even only one page or tab is open. regards

    computer features(hp pavilion dv5)
    intel centrino2 inside
    2.26 hz,
    4gb of ram,

    Ive downgraded from FF4 to 3.6 at this point. The CPU usage is out of control on OS X.

  • Firefox using most of my CPU and Memory on my Vista notebook

    I have been working on this for almost a month now. I have changed settings in FF found in the settings using ""about commands used on this Forum. I did correct a memory leak with a patch from Microsoft that was accuring with SVSHOST.exe that was doing the same thing on a smaller scale. This is what happens, Before starting FF this is what the memory has in use 18%, and the 2.4 ghz CPU is using between 0 and 3% in short bursts. Next Exe FF and open up just one page at first. you will see that the CPU will jump up to 75% at first then settle back to about 18%. The memory is a different story however as it will start to climb higher and higher till about 10 minutes in the memory used by FF will keeps climbing until it stops at around 898,000 and the Page file starts to be accessed. This is 96% of the memory of this Notebook. I realize that my computer is older with its RAM being Maxed at only 1.26GB but FF's 898,724 of RAM is excessive.
    I have been running FF on this computer for over 10 years now and this issue seems to get worse year by year. There seems to be a memory leak somewhere that causes this as there are no themes or addons installed. I have done a fresh install of Vista and reset FF several times and no change. I remember when I first switched to FF years ago, It was because IE was using too many resources and slowing down the computer. FF at that time was much leaner and more responsive at that time but now it seems like FF has become bloated as well.
    After 15 minutes the top 3 memory users are FF @ 898,724. Next will be SVCHOST with 32,656 and then the Malware Engine at 8,920. I have tried the new FF beta version with the same results.
    Oh, one more thing, when FF memory get to the top the screen will Grey out and a message appears an states Fire Fox is not responding and the HD never stops. It must be trying to access the page file I guess.
    I'm open to any suggestions.

    Yes you are correct there is no noticeable change. There must be a simple reason for this. I have read many complaints on the web with the same issues and no remedy. I think my next step would be to replace FF with Chrome.
    Thanks for trying.

  • IPhoto is using 190% of the CPU

    Can anyone please advise why my iPhoto is using upto 190% of the CPU. The % does fluctuate but it is still high between 50% and 190%.
    this does cause my MacBook to become slow and operates rather warm.

    My iPhoto library is in pictures folder and I had ready carried out the repair prior to your reply. What if ant damage could have this caused and if I repeatedly get this message should I be concerned?
    A repair can be necessary,
    if iPhoto crashed or you force quit it. Then iPhoto may not be able to close all open files properly, and the internal databases can be left in an inconsistent condition.
    It can be necessary, if the iPhoto library has been accessed from the Finder and not using the iPhoto interface.
    It can be necessary, if the iPhoto library has been accessed by other applications, that try to clean your Mac or to save space.
    If you are seeing reported prompts to repair, the library may be corrupted more than a simple repair can solve or your hard drive may be failing.  In that case make sure, you are having a good backup and try all options from the Library First Aid Tools, first of all repairing permissions, and then a "Rebuild Database".
    If all fails, rebuild with iPhoto Library Manager (download here: iPhoto Library Manager), as described by Terence Devlin in this post:
    uprgraded to yosemite all good but iphoto crashes every time I attempt to upgrade the photo library

  • Upgrade to 10.5 fails - Not enough diskspace in Common Partition - db_hist using most of the space

    Hi All,
    Tried upgrading our UCCX 9.0(2) SU1 HA deployment to 10.5(1) last night and it failed with the following message -
    There is not enough disk space in the common partition to perform the upgrade. Please use either the Platform Command Line Interface or the Real-Time Monitoring Tool (RTMT) to free space on the common partition.
    RTMT reported the Common diskspace used as 94%. Using RTMT we set the LogPartitionHighWaterMarkExceeded to 55% and waited for diskspace to free up. No such luck.
    A little more investigation and it turns out there is a database called db_hist_dbs in the Common partition that is 33GB in size. This is the command and returned output we used to find this out -
    show diskusage common
    8.0K    /common/moh
    33G     /common/var-uccx/dbc/db_hist_dbs
    1.6G    /common/var-uccx/dbc/temp_uccx_dbs
    201M    /common/var-uccx/dbc/uccx_er_dbs
    1.6G    /common/var-uccx/dbc/uccx_ersb_dbs
    37G     /common/var-uccx/dbc
    37G     /common/var-uccx
    16M     /common/ontape_backup.gz
    8.0K    /common/cancel_upgrade
    Using this command - show uccx dbserver disk - we can see that the db_hist database file is actually 80% free! Output from the command here -
    SNO. DATABASE NAME      TOTAL SIZE (MB) USED SIZE (MB) FREE SIZE (MB) PERCENT FREE
     4    db_hist                            34508.6                 6836.9                  27671.7             80%
    Anyone have any ideas on how to shrink the file size of the database in question? Is it even possible? Or what are our options to get around this and perform the upgrade.
    Thanks in advance
    Jeff

    You may be running into this bug: CSCul18667
    Symptom:
    CUIC log purge does not clean up JMX folder. Upgrade may fail due to lack of space.
    "show status" command show's that logging is consuming 99% of space
    Workaround:
    Can delete by going to RTMT -> Trace & Log Central -> Remote Browse -> Nodes -> "specific node" -> UCCX -> Cisco Unified Intelligence Center Servicability Service -> jmx -> select all -> Delete

  • Export - use 100% of the CPU

    I have a problem do export images and sounds with the
    captivate.... When i use the projetc, this is use 100% of de CPU,
    somebody have any idea how can I change this???? if it´s
    possible....
    []'s

    If you don't get an answer here, and if you know Japanese well, you may want to search/ask in the Japanese forums:
    https://discussionsjapan.apple.com

  • IMac using 100% of the CPU, but no processes in Activity Monitor show usage over 3%. What's going on?

    This iMac is about 5 years old. It has the 2GHz Intel Core 2 Duo processors, 2GB RAM, and is running 10.8.5. After rebooting the machine, CPU usage is low. After about 30 seconds, when using Activity Monitor, CPU usage bumps up to 100% and stays there without budging. When viewing the CPU tab near the botom, % User is about 95+%, and % System makes up the other 5%. They change slightly every second. The problem is, if I sort my Processes by % CPU, the largest user is Activity Monitor with around 2.3%. Everything else is at 0.0%. So there's something weird going on causing the CPU to max out and run hot, but I can't figure out what's causing it. Checking for applications to force quit doesn't show any issues, and repairing permissions doesn't do anything. Is there any way to figure out what's going on? I read about how to reset the System Management Controller, is this something I should do? Thank you for ANY help, it's driving me crazy!
    EDIT: I figured it out! Browsing All Processes, I'm running a folding@home program, but I thought I uninstalled it! The process is called FahCore_a4. Is there any way to prevent it from showing up on boot? I want to get rid of it but I deleted the applications!

    Be certain to check that you are viewing "All Processes" as opposed to "My Processes"

Maybe you are looking for

  • How do I turn an image into a transparency?

    Hi, There's a question I've seen asked dozens or hundreds of times, and I thought I found an answer a few years ago. I've since forgotten how to do it: Turn an image into a transparency. Now, the obvious solution is to set the layer to "multiply." Ye

  • AQ-adapter and correlation

    Hi! I have a problem with the AQ-adapter and correlation when I try to dequeue a message in mid-process. Then main purpose of my process is to insert a record in a table (db-adapter) and then wait for an AQ-message to magically come back. What ID sho

  • Problem with SQLJ

    I am using SQLJ but cant seem to get the Named Iterators to work. // None None package db_interface; import oracle.jdbc.OracleDriver; import oracle.jdbc.*; import entity.*; import java.sql.SQLException; import java.sql.PreparedStatement; import java.

  • Local mac tutoring Tulsa

    I need help with learning to use some of the features of my Mac.  It's too late to get an Apple One to One membership as I have had the computer for a couple of years.  Would think there would be experienced individuals in my area that could provide

  • No verification e-mail

    When I registered for this site, the verification e-mail came instantly and worked properly. When I try to log in to BestBuy.com, I get asked for a verification code that never comes. I checked my inbox, spam, archive, and trash. Using Gmail. Solved!