简体   繁体   English

当CPU为100%时如何终止SQL Server上的查询

[英]How to kill queries on SQL Server when CPU is 100%

Today I have launched a profiler on sql server, CPU went at 100% and I couldn't connect to the database to kill the query. 今天,我在sql server上启动了探查器,CPU达到了100%,并且我无法连接到数据库以终止查询。

Is there a management console? 有管理控制台吗? How can I use it to kill a query / process? 如何使用它杀死查询/进程?

http://technet.microsoft.com/en-us/library/ms178068(v=sql.105).aspx http://technet.microsoft.com/en-us/library/ms178068(v=sql.105).aspx

The dedicated administrator connection runs on a separate thread. 专用管理员连接在单独的线程上运行。 You might be able to get using this back door. 您也许可以使用此后门。

Unless you enabled the remote part of the DAC, you will have to Remote Desktop onto the server (MSTSC). 除非您启用DAC的远程部分,否则您将必须将远程桌面连接到服务器(MSTSC)。

Here are instructions on how to enable remote DAC connections. 以下是有关如何启用远程DAC连接的说明。

http://www.mssqltips.com/sqlservertip/1801/enable-sql-server-2008-dedicated-administrator-connection/ http://www.mssqltips.com/sqlservertip/1801/enable-sql-server-2008-dedicated-administrator-connection/

If you get in, use sp_who2 to see if there is blocking/deadlock. 如果进入,请使用sp_who2查看是否存在阻止/死锁。 Kill the processes that have the lease amount of CPU/IO otherwise the rollback might not be pretty. 杀死具有CPU / IO租用量的进程,否则回滚可能会很不好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM