How do I find out what is hammering my SQL Server?

后端 未结 6 2105
闹比i
闹比i 2020-12-07 08:45

My SQL Server CPU has been at around 90% for the most part of today.

I am not in a position to be able to restart it due to it being in constant use.

Is it p

6条回答
  •  误落风尘
    2020-12-07 09:20

    Run either of these a few second apart. You'll detect the high CPU connection. Or: stored CPU in a local variable, WAITFOR DELAY, compare stored and current CPU values

    select * from master..sysprocesses
    where status = 'runnable' --comment this out
    order by CPU
    desc
    
    select * from master..sysprocesses
    order by CPU
    desc
    

    May not be the most elegant but it'd effective and quick.

提交回复
热议问题