: : We have Sybase SQL Server 4.9.2 (HP-UX) where a deadlock situation is
: : occurring, but the only client output is that the process was chosen
: : as a deadlock victim (w/error number 1205). Are there some trace
: : flags we can use (or other debugging steps) to determine what
: : processes were running, what table locks were in effect, or other
: : useful information at the time when the deadlock occurred?
: There are some traceflags that will provide you with more information
: regarding deadlocks (602, 603, 1204 and 1205). Check out Q1.4 at the
: Sybase FAQ http://reality.sgi.com/pablo/Sybase_FAQ/
Thanks to all the suggested using flag 1204 and how to set it. The
below logfile has narrowed the problem down for us.
We are experiencing a deadlock condition on the sysindexes table in
tempdb (Sybase 4.9.2), where it appears that simultaneously creating
indices on 2 separate #temp tables (2 diff spid's) causes this issue.
Any easy way to avoid this, besides upgrading to Sybase XI? errorlog
output as follows (from dbcc traceflag 1204):
---------------------------------------------------------------------
Deadlock Id 2 detected. 2 deadlock chain(s) involved.
Process 7 was executing a command at line 1.
Process 6 was executing a CREATE INDEX command at line 1.
Process 6 was waiting for a 'shared page' lock on page 28 of the
'sysindexes' ta ble in database 2 but process 7 already held a
'exclusive page' lock on it.
Process 7 was waiting for a 'exclusive page' lock on page 25 of the
'sysindexes' table in database 2 but process 6 already held a 'shared
page' lock on it.
Process 7 was executing a command at line 1.
Process 6 was executing a CREATE INDEX command at line 1.
Process 6 was waiting for a 'shared page' lock on page 28 of the
'sysindexes' ta ble in database 2 but process 7 already held a
'exclusive page' lock on it.
Process 7 was waiting for a 'exclusive page' lock on page 25 of the
'sysindexes' table in database 2 but process 6 already held a 'shared
page' lock on it.
Process 6 encountered multiple deadlocks.
Process 6 was chosen as the victim. End of deadlock information.
---------------------------------------------------------------------
Any insights/thoughts/comments/workarounds/fixes would be greatly appreciated!
Regards,
Bryan Althaus