作者:mobiledu2502895435 | 来源:互联网 | 2023-08-26 12:03
I've got a couple of rogue spid's in my database that I can see are sleeping when I log in as sa
and use sp_who
, but attempts to use kill
to eliminate them have failed and I don't actually have access to the server itself to bounce it. Is there any other way of killing these things off?
我在我的数据库中有几个流氓spid,我可以看到当我以sa登录并使用sp_who时正在睡觉,但是尝试使用kill
来消除它们已经失败了,我实际上无法访问服务器本身就可以反弹它。有没有其他办法杀死这些东西?
2 个解决方案
3
System processes cannot be killed. For example in the output of sp_who where cmd is NETWORK HANDLER, MIRROR HANDLER and CHECKPOINT SLEEP (or rarely, CHECKPOINT) and AUDIT PROCESS cannot be killed. If they have status as "recv sleep", "send sleep", "alarm sleep" and "lock sleep" , they can be killed.
系统进程无法被杀死。例如,在sp_who的输出中,cmd是NETWORK HANDLER,MIRROR HANDLER和CHECKPOINT SLEEP(或很少,CHECKPOINT)和AUDIT PROCESS无法被杀死。如果他们的状态为“recv sleep”,“send sleep”,“alarm sleep”和“lock sleep”,则可以将其杀死。
In sp_who output, you cannot tell whether a process whose status is "recv sleep" belongs to a user who is using SQL Server, but may be pausing to examine the results of a command, or whether the process indicates that a user has rebooted a PC or other terminal, and left a stranded process.You can learn more about a questionable process by querying the sysprocesses table for information. For ex :
在sp_who输出中,您无法判断状态为“recv sleep”的进程是属于正在使用SQL Server的用户,还是可能暂停以检查命令的结果,或者进程是否指示用户已重新引导PC或其他终端,并留下了搁浅的进程。您可以通过查询sysprocesses表获取有关可疑进程的更多信息。例如:
select hostprocess, program_name from sysprocesses where spid = 8
从sysprocesses中选择hostprocess,program_name,其中spid = 8
If program_name is isql you know that this spid can be killed.(and so forth ... )
如果program_name是isql,你知道这个spid可以被杀死。(等等...)