知方可补不足~sqlserver中使用sp_who查看sql的进程

回到目录

在SQLSERVER中每个会话,即每个查询分析器窗口都会产生一个SQL进程,对于那些持续时间短的进程,它们转瞬即失,而对于持续时间比较长的,我们需要希望查看它的运行状态,就可以借助SQL提供的sp_who命令,下面是对它的具体介绍,主要选自MSDN.

sp_who [ [ @loginame = ] 'login' | session ID | 'ACTIVE' ]
你可以在sp_who后面加你的SPID号(sessionID),登陆名,线程状态等

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkoAAACnCAIAAABhBOS7AAAgAElEQVR4nO1du24kObLNr1msI0F2WmMssLYAyV5nUL4GEIT1+g9UAwho7CdcoLHGFZDfMLhWG+3Vx9Q18sEg48FHMjMjVDxIDHqyyGAwGMHDYJXI7tfPv759+/ZbQ0NDQ0PDF0K30Nt1M2wqfM9W9unIPrDVF1vaKkR1A7YRqQiLxjShs0dvv37+Vf2B3LmF/N1a2acj+zy2+mJLW4VPdQO2Ean4WDSmFZ0bvSlqYrfHVl9saavwafSm+bFoTCs6N3pT1MRuj62+2NJW4dPoTfNj0ZhWdLZDb58vD/cvww7mZhqyMqLlgyJauGlr90k14PgmwbDxWEgW1Z4d5i7VOm/0fL483L9opTcu9qqbO7mhpCYEJTWF+lrC2Lcv1ehN0xDs+TR60/w0eqvQO8aZtdJb5shpyd5uhN6Maqu1g1oM2OhNz+iUPTdLb0zhw+hteL3ruq7ruofXH78+Xx7uH5/vxxeP32FPPl8euhkF9Oaq3719ji/fn2d5zx8ZDSV05P3t3lX//rSI654/friP4CDN//assb2jROY7Z4rH76EZQRc+Xx7uX96elj7+9Svs9V9wZBf7TH0khiZb26B1rDk9OntpruThDUgFnfPP9+fMWKD8hGjidixfPjqL/fPMIk2SO3rU43c8UuQc4ioGM89Ui5tdQ5WYafwoent/Xtx9sgXoz9P7rO6Pt/t55vp4zKe3H2/3wLiBwJ/vz93d20dqQ6kdwXWDWYMYV1/Ikd7pmWIaC2gc2JfPl4fOf0/2ehxZ+I+plWBo8r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VILKHp/gzVpezVfCC7KfwUUp4uiJk4YhdS+jNDX0wCRBqX+YLTVH/5AtxSvYDjNCb25wsv9Q0nr0F83z4PgNyvDEy89I3ponJKYgNZxClbAGw+HP+Ktx2f/ViLFIruy9KkT64ZfQ2reJhLl0i8FqQ80U8Myl7i7vxofRG+T/pz9E3ThjKwAKjQx2CKmEAMh9BG6WHp1w425gpm5NATzp783XiMjxObKbONuhteL1bfjAJ/12R3uBWsOceRSYR4k2QWTGkh1PX0dlbrACenRKDP1qrtC/akDG4q797WyFwqg4zdrlW3DODcYRxwihJQojB3b578/y/kN5AEhfN3rgqrhiWRoVNVnjKhRnwxvQrc6MvdR/kbkShm/3u7eOxc9nbNj8t8dcX8zZ5oUEkc7PfuNXI3twUNXqHP7ze7sTl3Pfngfxxnv+KSQGdsfw3IGcIymT2RSvSB9ffkpEZgIq+IoGER6WokeKZXJbGLtVpsAZk9Ywgg96w/9PUhXuH/RkFF92XK7AVFY+O3kJpfuCMI5QQnp4Z+cL5xvTGFc6XEXrzTEeyHhZfh95KPao6It+9fX+a89mn9wJuS6C38M98gr/GyLIN1wopc3lZpYkl+Q/3J/q+X2JmKXA5933fh837GpF5mJPSg/j0BRFl8vqiE2WD60/4SfRWLBB7VLRWkmf6G0vsKjy2UJMnUErPCLKyN+T/qRuP2J89e2B6o2yFqow9nteVSBp8CVcirhCdVi7F+cIlxgTqyHszdPfRKsDzFPm7N2l6rO5R1dFOLTmiiYPXNBO+Br01JKK6AbcdkWN3tXaHRffWr/P/Az6hUhNIRLh/AAAAAElFTkSuQmCC" alt="" />

下面对status执行状态作一个简单的说明,选自MSDN

background:会话正在运行一个后台任务,例如死锁检测。

rollback: 会话具有正在处理的事务回滚。

pending: 会话正在等待工作线程变为可用。

runnable: 会话的任务在等待获取时间量程时位于计划程序的可运行队列中。

spinloop: 会话的任务正在等待调节锁变为可用。

suspended: 会话正在等待事件(如 I/O)完成。

注意:如果你的代码处理数据比较大,SQL会创建子线程进行并行处理,子线程的标示为ecid。

别外,如果希望查看SQL进程的详细信息,可以使用下面代码

SELECT * FROM sys.sysprocesses

查看被锁住的对象,可以使用下面代码

SELECT * FROM sys.syslockinfo

如果希望查看指定会话(SQL进程)的语句(从客户端发过来的SQL语句),可以使用下面语句

dbcc inputbuffer(Session_ID)

如果希望查看正在被阻塞的语句(sysprocesses的blocked),可以使用下面语句

dbcc inputbuffer(Blocked)

回到目录

上一篇:二丶CSS


下一篇:javascript 语法规范错误提示代码