get the deadlock information from sql server
https://stackoverflow.com/questions/12422986/sql-query-to-get-the-deadlocks-in-sql-server-2008
You can use a deadlock graph and gather the information you require from the log file.
The only other way I could suggest is digging through the information by using EXEC SP_LOCK (Soon to be deprecated), EXEC SP_WHO2 or the sys.dm_tran_locks table.
SELECT L.request_session_id AS SPID,
DB_NAME(L.resource_database_id) AS DatabaseName,
O.Name AS LockedObjectName,
P.object_id AS LockedObjectId,
L.resource_type AS LockedResource,
L.request_mode AS LockType,
ST.text AS SqlStatementText,
ES.login_name AS LoginName,
ES.host_name AS HostName,
TST.is_user_transaction as IsUserTransaction,
AT.name as TransactionName,
CN.auth_scheme as AuthenticationMethod
FROM sys.dm_tran_locks L
JOIN sys.partitions P ON P.hobt_id = L.resource_associated_entity_id
JOIN sys.objects O ON O.object_id = P.object_id
JOIN sys.dm_exec_sessions ES ON ES.session_id = L.request_session_id
JOIN sys.dm_tran_session_transactions TST ON ES.session_id = TST.session_id
JOIN sys.dm_tran_active_transactions AT ON TST.transaction_id = AT.transaction_id
JOIN sys.dm_exec_connections CN ON CN.session_id = ES.session_id
CROSS APPLY sys.dm_exec_sql_text(CN.most_recent_sql_handle) AS ST
WHERE resource_database_id = db_id()
ORDER BY L.request_session_id
http://www.sqlmag.com/article/sql-server-profiler/gathering-deadlock-information-with-deadlock-graph
get the deadlock information from sql server的更多相关文章
- sql server deadlock problem
https://www.red-gate.com/simple-talk/sql/learn-sql-server/how-to-track-down-deadlocks-using-sql-serv ...
- Migrating Oracle on UNIX to SQL Server on Windows
Appendices Published: April 27, 2005 On This Page Appendix A: SQL Server for Oracle Professionals Ap ...
- 了解和解决SQL SERVER阻塞问题(copy)
http://support.microsoft.com/kb/224453 Summary In this article, the term "connection" refe ...
- 非常全面的SQL Server巡检脚本来自sqlskills团队的Glenn Berry 大牛
非常全面的SQL Server巡检脚本来自sqlskills团队的Glenn Berry 大牛 Glenn Berry 大牛会对这个脚本持续更新 -- SQL Server 2012 Diagnost ...
- SQL Server 诊断查询-(2)
Query #13 SQL Server Error Log(FC) -- Shows you where the SQL Server failover cluster diagnostic log ...
- P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1
P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1 May ...
- 转载:Character data is represented incorrectly when the code page of the client computer differs from the code page of the database in SQL Server 2005
https://support.microsoft.com/en-us/kb/904803 Character data is represented incorrectly when the cod ...
- SQL Server 损坏修复
目录: 一. 常见错误解读 二. DBCC CHECKDB 三 .不同部位损坏的应对 四. Database Mirroring和AlwaysOn的页面自动修复功能 一 常见错误解读 SQL Serv ...
- SQL Server 2008性能故障排查(一)——概论
原文:SQL Server 2008性能故障排查(一)--概论 备注:本人花了大量下班时间翻译,绝无抄袭,允许转载,但请注明出处.由于篇幅长,无法一篇博文全部说完,同时也没那么快全部翻译完,所以按章节 ...
随机推荐
- CET-6 分频周计划生词筛选(番外篇:百词斩)
点我阅读 番外-百词斩 2016.09.18 12:00pm transverse counterpart accessory cult gorgeous sediment assimilate st ...
- 编程语言 - 大数据 - Hadoop
Hive - 特例函数 rlike
- 20190818 On Java8 第八章 复用
第八章 复用 组合语法 初始化引用有四种方法: 当对象被定义时.这意味着它们总是在调用构造函数之前初始化. 在该类的构造函数中. 在实际使用对象之前.这通常称为延迟初始化.在对象创建开销大且不需要每次 ...
- [已解决]报错: Error response from daemon: conflict
报错内容: Error response from daemon: conflict: unable to delete f5b6ef70d79b (must be forced) - image i ...
- luoguP1311 选择客栈 题解(NOIP2011)
P1311 选择客栈 题目 #include<iostream> #include<cstdlib> #include<cstdio> #include<c ...
- php ecshop采集商品添加规则
ecshop采集商品添加规则 <?phpheader("Content-type:text/html;charset=utf-8"); function get($url) ...
- ECharts 图表导出
Echarts图形是由Javascript亲自在前端网页上绘制的 1.用ECharts配置项手册中的toolbox.feature.saveAsImage toolbox: { show: true, ...
- C#设计模式:策略者模式(Stragety Pattern)
一,什么是策略模式? 1,针对同一命令或行为,不同的策略做不同的动作. 2,比如针对一组算法,将每个算法封装到具有公共接口的独立的类中,从而使它们可以相互替换.策略模式使得算法可以在不影响到客户端的情 ...
- JS面向对象——工厂模型
工厂模型抽象了创建具体对象的过程,以下示例代码说明工厂类型: <!DOCTYPE html> <html> <head> <title>工厂模型< ...
- ES2015箭头函数与普通函数对比理解
直接返回表达式 var odds = evens.map(v => v + 1); var nums = evens.map((v, i) => v + i); var odds = ev ...