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

后端 未结 6 2089
闹比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:36

    You can run the SQL Profiler, and filter by CPU or Duration so that you're excluding all the "small stuff". Then it should be a lot easier to determine if you have a problem like a specific stored proc that is running much longer than it should (could be a missing index or something).

    Two caveats:

    • If the problem is massive amounts of tiny transactions, then the filter I describe above would exclude them, and you'd miss this.
    • Also, if the problem is a single, massive job (like an 8-hour analysis job or a poorly designed select that has to cross-join a billion rows) then you might not see this in the profiler until it is completely done, depending on what events you're profiling (sp:completed vs sp:statementcompleted).

    But normally I start with the Activity Monitor or sp_who2.

提交回复
热议问题