September 21, 2009 at 5:39 am
how to findout the deadlock happend?
how to resolve it?
September 21, 2009 at 6:05 am
September 21, 2009 at 6:30 am
Sergey Vavinskiy (9/21/2009)
Here are a couple a good strategies:
You can choose, do you want to know the process, or just catch it to investigte?
1. Traceon can cath your deadock info so you can investigate and maybe correct some bad coding.
2. get te SPID of the blocking process, and use it in DBCC INPUTBUFFER(spidid in here)
example:
DBCC INUTBUFFER(234)
Result will show the query running/was running..
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle
September 21, 2009 at 6:35 am
It's a very good idea to turn on TRACEFLAG 1222. It can be difficult to interpret, but at least you're assured of capturing the information as each deadlock occurs. Otherwise, in order to capture the information, you'll need to run a trace 24/7. This can be a bit of a pain to maintain.
To set the traceflag on:
DBCC TRACEON (1222,-1);
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply