sql server deadlock problem
Event: Proc [Database Id = 12 Object Id = 525453146]
执行以下的sql语句,可以得到数据库名字和object名字
SELECT OBJECT_NAME(525453146) ,
DB_NAME(12);
https://www.cnblogs.com/rush/archive/2012/02/19/2358209.html
trace追踪的时候,选择deadlock:graph,deadlock:lock,deadlock:chain
Mentioned below are trace flags which are classical way to enable Deadlock trace in SQL Server Editions.
- Enable Trace Flag 1204 - Here data are captured in node level.
Dbcc traceon (T1204,-1)
- Enable Trace Flag 1222 - Here data is returned in XML Format. Also one can see the processes information also which are involved in deadlock.
DBCC Traceon (T1222,-1)
- Run SQL Profiler Trace to capture the Deadlock events.
This deadlock information can be viewed in SQL Server Error Logs and Trace Files.
DBCC TRACEON(1204, -1);
DBCC TRACEON(1222, -1);
DBCC TRACEON - Trace Flags
Trace flags are used to set specific server characteristics or to alter a particular behavior.
For example, trace flag 3226 is a commonly used startup trace flag which suppresses successful backup messages in the error log.
Trace flags are frequently used to diagnose performance issues or to debug stored procedures or complex computer systems, but they may also be recommended by Microsoft Support to address behavior that is negatively impacting a specific workload.
All documented trace flags and those recommended by Microsoft Support are fully supported in a production environment when used as directed.
Note that trace flags in this list may have additional considerations regarding their particular usage, so it is advisable to carefully review all the recommendations given here and/or by your support engineer.
Also, as with any configuration change in SQL Server, it is always best to thoroughly test the flag in a non-production environment before deploying.
1204
Returns the resources and types of locks participating in a deadlock and also the current command affected. For more information, see this Microsoft Support article.
Scope: global only
SQL Server technical bulletin - How to resolve a deadlock
1222
Returns the resources and types of locks that are participating in a deadlock and also the current command affected, in an XML format that does not comply遵从 with any XSD schema.
Scope: global only
DBCC TRACESTATUS
Displays the status of trace flags.
DBCC TRACESTATUS(1204,-1);
DBCC TRACESTATUS(1222,-1);
DBCC TRACESTATUS(-1);
sql server deadlock problem的更多相关文章
- sql server deadlock跟踪的四种方法
最近写程序常会遇到deadlock victim,每次一脸懵逼.研究了下怎么跟踪,写下来记录下. 建测试数据 CREATE DATABASE testdb; GO USE testdb; CREATE ...
- Check SQL Server Deadlock
Sometimes a script keeps running for a long time and can't stop, then a db blocking is occurring. We ...
- SQL Server Lock Escalation - 锁升级
Articles Locking in Microsoft SQL Server (Part 12 – Lock Escalation) http://dba.stackexchange.com/qu ...
- SQL Server 得到SPID,唯一的sessionID
像.net中的session一样,假设能知道了数据库中的sessionID,那全部的操作都能知道了,由于有了这个唯一的身份识别的标识. 能够做的事情有非常多,如:当前哪个用户在做什么操作,在运行什么s ...
- Problem to create "New Database Diagram" in Microsoft SQL Server Management Studio for SQL Server 2012
Error: when click "New Database Diagram", a error popped up and said "Attempted to re ...
- (转)SQL Server上的一个奇怪的Deadlock及其分析方法
原文地址:http://blogs.msdn.com/b/apgcdsd/archive/2012/02/28/sql-server-deadlock.aspx 最近遇到了一个看上去很奇怪,分析起来很 ...
- SQL Server technical bulletin - How to resolve a deadlock
https://support.microsoft.com/en-us/help/832524/sql-server-technical-bulletin-how-to-resolve-a-deadl ...
- How to solve a login problem of SQL Server?
Sometimes when we attempting to login the SQL Server 20xx Management Studio, when we type in the cor ...
- Microsoft SQL Server Trace Flags
Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...
随机推荐
- 如何学习TP框架
1.学习访问方法 2.控制器的写法 3.视图的写法 4.模型的写法 5.扩展类的用法 6.扩展插件的用法
- python3 - 动态添加属性以及方法
给实例动态添加方法,需引入types模块,用其的MethodType(要绑定的方法名,实例对象)来进行绑定:给类绑定属性和方法,可以通过 实例名.方法名(属性名) = 方法名(属性值) 来进行绑定.给 ...
- 2318: Spoj4060 game with probability Problem
2318: Spoj4060 game with probability Problem Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 356 Sol ...
- Cocos2d-x Lua中网格动作
GridAction它有两个主要的子类Grid3DAction和TiledGrid3DAction,TiledGrid3DAction系列的子类中会有瓦片效果,如下图所示是Waves3D特效(Grid ...
- eclipse下设置tomcat,修改Java代码不必重启tomcat
1.本文目的:用tomcat进行web开发时,修改Java代码往往要重启代码,当工程较大启动较慢时,严重影响效率,本文通过eclipse下tomcat开发和发布web程序时,对一些Java代码一般修改 ...
- FZU 2099 魔法阵(计算几何)
Problem 2099 魔法阵 Accept: 120 Submit: 289 Time Limit: 1000 mSec Memory Limit : 32768 KB Probl ...
- 初步认识dubbo--小案例
Dubbo是Alibaba开源的分布式服务框架,它最大的特点是按照分层的方式来架构,使用这种方式可以使各个层之间解耦合(或者最大限度地松耦合).从服务模型的角度来看,Dubbo采用的是一种非常简单的模 ...
- influxDB选择类函数
1)TOP()函数 作用:返回一个字段中最大的N个值,字段类型必须是长整型或float64类型. 语法: SELECT TOP(<field_key>[,<tag_keys>] ...
- webpack安装和简单配置
1.webpack是一个基于node的项目,所以先装好node和npm 参考我的随笔:https://www.cnblogs.com/jtnote/p/6230384.html 2.先创建 ...
- 从“关于Java堆与栈的思考”一帖看错误信息的传播
我对转贴的信息一直有敌意,原因如下:首先,除了制造更多的信息垃圾,转贴不会带来新的价值,想收藏的话一个链接足矣:其次,将错误信息以讹传讹,混淆视听.不妨选一个典型的例子说明一二. 相信<关于Ja ...