热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何在Sybase中杀死一个不守规矩的spid?-HowdoIkillanunrulyspidinSybase?

IvegotacoupleofroguespidsinmydatabasethatIcanseearesleepingwhenIloginassaand

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 个解决方案

#1


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可以被杀死。(等等...)

#2


0  

I have a client application that sometimes does similar things. The client is usually in the middle of a select, but is no longer retrieving rows. (This may be a client side cursor, but I'm not sure). These spids seem un-killable. I have to find the user and ask them to log off.

我有一个客户端应用程序,有时做类似的事情。客户端通常位于select的中间,但不再检索行。 (这可能是客户端游标,但我不确定)。这些spid似乎是不可杀戮的。我必须找到用户并要求他们注销。

The other scenario in which I've had these is after errors or stacktraces on the server. Check your errorlog to see if there's any dodgy entries in there. If there is then a restart is going to be your only option.

我有这些的另一种情况是在服务器上出现错误或堆栈跟踪之后。检查您的错误日志,看看那里是否有任何狡猾的条目。如果有,那么重启将是您唯一的选择。


推荐阅读
author-avatar
mobiledu2502895435
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有