|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, January 02, 2009 4:46 AM
Points: 2,
Visits: 11
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, October 15, 2004 10:40 AM
Points: 1,
Visits: 1
|
|
DONT WORKED!! I just try it with the scripts bellow: DBCC TRACEON (3604) DBCC TRACEON (1204) GO begin transaction select top 1000000 cod_p from p (tablockx) select top 1000000 p.cod_p,d.cod_d from p (tablockx) join d (tablockx) on d.cod_d=p.cod_p commit
DBCC TRACEON (3604) DBCC TRACEON (1204) GO begin transaction select top 1000000 cod_d from d (tablockx) select top 1000000 p.cod_p,d.cod_d from p (tablockx) join d (tablockx) on d.cod_d=p.cod_p commit
I opnend 2 querys at query analyzer. I succeded to create a deadlock but its dont writed to error log. Jean, i need some help at lock timeout and deadlock.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, July 04, 2007 7:11 AM
Points: 31,
Visits: 1
|
|
I've got to ask a follow up question. I am not certain when I should execute the DBCC TRACEON(3604) DBCC TRACEON(1294) commands. For example, I've got a situation in which a deadlock occurs, but maybe only once every three or four weeks. Do I just go into Query Analyzer, execute those commands now, and wait a few weeks until the problem shows up? Or do I only execute those commands while the deadlock is in process?
Doctor Who
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Thursday, April 25, 2013 3:57 PM
Points: 10,
Visits: 19
|
|
This did the trick for me. I had an instance where I was getting row level dead lock and needed to know how to get the table name based on the informaiton in the RID print out. This lead me to the table I felt was causing the problem. THANK YOU!!!!!!!!!!!!!!!!
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, November 08, 2012 1:57 PM
Points: 96,
Visits: 60
|
|
thats is really excellent, but i would like to ask a question that its only track the information SPID (Server Process ID), how one can locate that this SPID was running which one query or stored procedure.because if SPID 65 generate the deadlock than , information track is only SPID and delete and after some time this SPID is assgned to other one waiting for a respose
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Thursday, November 08, 2012 1:57 PM
Points: 96,
Visits: 60
|
|
thats is really excellent, but i would like to ask a question that its only track the information SPID (Server Process ID), how one can locate that this SPID was running which one query or stored procedure.because if SPID 65 generate the deadlock than , information track is only SPID and delete and after some time this SPID is assgned to other one waiting for a respnose
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, April 06, 2007 12:57 AM
Points: 53,
Visits: 1
|
|
Once you have executed these commands, the error log starts filling up, so you may want to keep an eye on it from time to time and turn it off if its size is worrying you.
You may want to turn it on for a while, and check the logs for "Deadlock encountered.... Printing deadlock information", then turn it off.
To the Author:
I'd like to know once you have identified what tables etc are part of the problem, how do you go about solving the problem in the first place?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, July 27, 2007 7:48 AM
Points: 3,
Visits: 1
|
|
I suppose I'm starting to develop a mild if somewhat exasperated affection for SQL Server, but then something like this comes along and annoys me all over again. It's ludicrous to have to go to this amount of trouble to diagnose something as straightforward as a deadlock. On DB2 on the mainframe (what a lot of your readers would regard as 'legacy') the thread which gets chucked out receives an error code (a -911 if my memory serves me correctly) and my all-time favourite error message: "This agent has been selected as the victim of a deadlock", which sounds like an instruction from the CIA But no diagnosis is necessary, nor should it be. As for how to fix it, it's caused by 2 processes accessing and locking (exclusively) the same data in a different order: Process 1 has A and is waiting for B. Process 2 has B and is waiting for A. And there they will sit until kingdom come unless the system selects one to kill. A few things to try: reduce your lock size - table to page, page to row, and force it to stay there. This has CPU and memory implications, so be careful. Change your clustering sequence on one of the tables involved (again, look at the bigger picture first). Ideally, design your apps to access things in the same order. A lot of deadlocks are just the result of bad and inconsistent coding. If you have a real database hotspot, like a maximum key which gets both read and updated, try adding a very long field to the table, or a very high fill factor, so you only get one row per page. If you are deadlocking at row level, rethink your design. Dinosaur tricks, but they might work. good luck! Caroline
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Wednesday, June 13, 2012 11:19 AM
Points: 42,
Visits: 48
|
|
DBCC TRACEON (3604) & DBCC TRACEON (1204) doesn't seem to work on SQL 2005.....I executed both, in that order on the server and watched the logs only to discover users were, in fact, receiving deadlock errors yet nothing was written to the log?? Any suggestions? 
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, April 08, 2013 1:10 PM
Points: 263,
Visits: 848
|
|
for SQL 2005 run DBCC TRACEON (1204, -1) DBCC TRACEON (1222, -1) -- to check the status DBCC TRACESTATUS(-1) for more information please check BOL. ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/2ed3e3e7-5080-4fa3-b79a-585470602bc2.htm
|
|
|
|