October 13, 2008 at 5:11 am
Does enyone know some native way to handle deadlocks in SQL Server, or some thirth party tool ?
Is there any chance to catch or avoid deadlock before it happens ?
How to analyze who was involved (I meen what processes) when it happend ?
October 13, 2008 at 5:36 am
Plz check this link:
http://www.sql-server-performance.com/tips/deadlocks_p1.aspx
October 13, 2008 at 8:23 am
The best thing to do with deadlocks is find the cause and fix it. Typically deadlocks are caused by bad code, bad indexing or both.
Set traceflag 1204 on and SQL will write the deadlock graph into the error log whenever a deadlock occurs. You can use that to find the cause of the deadlock
DBCC TRACEON (1204,-1)
or add -T1204 to SQL's startup parameters.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 13, 2008 at 8:29 am
The way to stop deadlocks is to trace them down and then fix the code so it doesn't allow deadlocks.
October 13, 2008 at 9:16 am
Adding to what Steve and Shaw said you have first track down the code involved in deadlock and then you need to change the code or tune the code to be very precise.
Make use of steps mentioned under this link:
http://blogs.msdn.com/bartd/archive/2006/09/09/Deadlock-Troubleshooting_2C00_-Part-1.aspx
Make use of trace flag 1204 as Gail suggested. The above link is talking abbout 1222 as it is there in SQL 2005, rest of the steps are same.
HTH,
MJ
October 14, 2008 at 12:22 am
Thanks to all of you guys.
I read all the links, and now I will start that flag.
Then we will see.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply