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

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

WBOY
WBOYOriginal
2016-06-07 17:43:081057browse

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn