sleeping是连上了sqlserver,等待下一次运行的进程

解决方案 »

  1.   

    http://www.cnblogs.com/buro79xxd/archive/2010/04/21/1717217.htmlThe process is probably waiting on a disk read, while it is sleeping. What is the waittype from sysprocesses?A status of sleeping means the session is connected but not actively running anything (e.g. the simplest definition, while perhaps not 100% accurate, is that there is nothing for that session_id in sys.dm_exec_requests).sp_who2 'active' filters out any spid that has a status of sleeping or has a last command of AWAITING COMMAND, LAZY WRITER or CHECKPOINT SLEEP. No I did not memorize what sp_who2 does; I simply looked at the source code:EXEC master..sp_helptext sp_who2;
    Note that sp_who2 is undocumented and unsupported, and sysprocesses is deprecated and currently present only for backward compatibility reasons. You will be better served, I think, with a procedure like Adam Machanic's sp_whoisactive. Or at the very least knowing how to use the more modern DMVs like sys.dm_exec_sessions and sys.dm_exec_requests.
      

  2.   

    sleeping就是连上了sql server,但是可能连接上的会话,没事干,或者是没有执行任何命令,于是就处于sleeping状态了,就是正在睡觉
      

  3.   

    老的msdn上还带了一句
    http://technet.microsoft.com/zh-cn/library/ms177648(v=sql.90).aspx睡眠。没有要做的工作。
      

  4.   

    你就理解成在SSMS里打开了一个查询窗口但没做任何查询就对了。