Maison  >  Article  >  base de données  >  SQL SERVER 查询性能优化分析事务与锁(五)

SQL SERVER 查询性能优化分析事务与锁(五)

WBOY
WBOYoriginal
2016-06-07 17:43:081057parcourir

SQL SERVER 查询性能优化分析事务与锁(一) SQL SERVER 查询性能优化分析事务与锁(二) SQL SERVER 查询性能优化分析事务与锁(三) 上接SQL SERVER 查询性能优化分析事务与锁(四) (四)未检测到的分布式死锁 在SQL2005(2008) 中 执行代码,即SQL SERVE

      SQL SERVER 查询性能优化——分析事务与锁(一)

      SQL SERVER 查询性能优化——分析事务与锁(二)

      SQL SERVER 查询性能优化——分析事务与锁(三)

 

上接SQL SERVER 查询性能优化——分析事务与锁(四)

 

(四)未检测到的分布式死锁

 

 

      在SQL 2005(2008)执行代码,服务器空间,即SQL SERVER 查询性能优化——分析事务与锁(二)中的“例一”,也就是下面的代码,美国服务器,香港虚拟主机,得到如下图。

select spid 进程,STATUS 状态, 登录帐号=SUBSTRING(SUSER_SNAME(sid),1,30) ,用户机器名称=SUBSTRING(hostname,1,12) ,是否被锁住=convert(char(3),blocked) ,数据库名称=SUBSTRING(db_name(dbid),1,20),cmd 命令,waittype as 等待类型 ,last_batch 最后批处理时间,open_tran 未提交事务的数量 from master.sys.sysprocesses spid in (select blocked from master.sys.sysprocesses) and blocked=0

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn