<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://petersap.nl/SybaseWiki/index.php?action=history&amp;feed=atom&amp;title=Deadlock_investigation_thru_the_errorlog</id>
		<title>Deadlock investigation thru the errorlog - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://petersap.nl/SybaseWiki/index.php?action=history&amp;feed=atom&amp;title=Deadlock_investigation_thru_the_errorlog"/>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;action=history"/>
		<updated>2026-04-04T20:51:20Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;diff=1717&amp;oldid=prev</id>
		<title>Psap at 20:57, 1 August 2007</title>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;diff=1717&amp;oldid=prev"/>
				<updated>2007-08-01T20:57:25Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 20:57, 1 August 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A technique is described here to investigate the deadlock information and with a tool this task is automated and statistics can be gathered. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A technique is described here to investigate the deadlock information and with a tool this task is automated and statistics can be gathered. &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Software download link: http://www.petersap.nl/documents/deadlock.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;zip &lt;/del&gt;(8 Kb)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Software download link: http://www.petersap.nl/documents/deadlock.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;tar.gz &lt;/ins&gt;(8 Kb)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Sample deadlock message==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Sample deadlock message==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key website-mw_:diff:version:1.11a:oldid:1682:newid:1717 --&gt;
&lt;/table&gt;</summary>
		<author><name>Psap</name></author>	</entry>

	<entry>
		<id>http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;diff=1682&amp;oldid=prev</id>
		<title>Psap at 15:07, 8 June 2007</title>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;diff=1682&amp;oldid=prev"/>
				<updated>2007-06-08T15:07:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 15:07, 8 June 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Sybase ASE locking schemas==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Sybase ASE locking schemas==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sybase ASE (version 11.9.2 and later) uses three different locking schemas: AllPages, DataPages and DataRows. Sybase stores rows for a table or index within pages. Depending on the locking schema, information is locked at the page or at the row level. The following table shows how each locking schema locks information.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sybase ASE (version 11.9.2 and later) uses three different locking schemas: AllPages, DataPages and DataRows. Sybase stores rows for a table or index within pages. Depending on the locking schema, information is locked at the page or at the row level. The following table shows how each locking schema locks information.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Locking Schema Locks on Index Locks on Data &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;All Pages Page Page &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;DataPages Not locked Page &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;DataRows Not locked Row &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| border=&amp;quot;1&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|+ &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;The ASE on Linux-distro working matrix:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|+&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Locking Schema !! Locks on Index !! Locks on Data&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Locking Schema !! Locks on Index !! Locks on Data&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key website-mw_:diff:version:1.11a:oldid:1680:newid:1682 --&gt;
&lt;/table&gt;</summary>
		<author><name>Psap</name></author>	</entry>

	<entry>
		<id>http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;diff=1680&amp;oldid=prev</id>
		<title>Psap at 14:59, 8 June 2007</title>
		<link rel="alternate" type="text/html" href="http://petersap.nl/SybaseWiki/index.php?title=Deadlock_investigation_thru_the_errorlog&amp;diff=1680&amp;oldid=prev"/>
				<updated>2007-06-08T14:59:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;When the configuration option &amp;quot;print deadlock information&amp;quot; has been switched on, an informational message is put into the Sybase ASE errorlog when a deadlock is detected. The information can be used to see if the tables involved in a deadlock can benefit from a change of their locking schema.&lt;br /&gt;
&lt;br /&gt;
A technique is described here to investigate the deadlock information and with a tool this task is automated and statistics can be gathered. &lt;br /&gt;
&lt;br /&gt;
Software download link: http://www.petersap.nl/documents/deadlock.zip (8 Kb)&lt;br /&gt;
&lt;br /&gt;
==Sample deadlock message==&lt;br /&gt;
This is an (abbreviated) sample of the information shown in the errorlog when a deadlock has been detected:&lt;br /&gt;
&lt;br /&gt;
 Deadlock Id 1 detected&lt;br /&gt;
 1 deadlock chain(s) involved.&lt;br /&gt;
 &lt;br /&gt;
 Process (Familyid 0, Spid 21, Suid 4) was executing a INSERT command in the procedure 'objid 0'.&lt;br /&gt;
 SQL Text: insert into books(BookId,Title) select 208513,&amp;quot;Sybase DBA guide&amp;quot;&lt;br /&gt;
 Process (Familyid 0, Spid 25, Suid 4) was executing a UPDATE command in the procedure 'sp_priceBook'.&lt;br /&gt;
 SQL Text: exec sp_priceBook &amp;quot;My Pet Goat&amp;quot;,6.99&lt;br /&gt;
 &lt;br /&gt;
 Process (Familyid 0, Spid 25) was waiting for a 'exclusive page' lock on '''page 660720''' of the ''''books' table''' in '''database 4''' but process (Familyid 0, Spid 21) already held a 'exclusive page' lock on it.&lt;br /&gt;
 Process (Familyid 0, Spid 21) was waiting for a 'shared page' lock on '''page 652391''' of the ''''bookPrice' table''' in '''database 4''' but process (Familyid 0, Spid 25) already held a 'exclusive page' lock on it.&lt;br /&gt;
 &lt;br /&gt;
 Process (Familyid 0, Spid 21) was chosen as the victim. End of deadlock information.&lt;br /&gt;
&lt;br /&gt;
The highlighted text shows in which database, object and page number the deadlock was encountered.&lt;br /&gt;
&lt;br /&gt;
==Sybase ASE locking schemas==&lt;br /&gt;
Sybase ASE (version 11.9.2 and later) uses three different locking schemas: AllPages, DataPages and DataRows. Sybase stores rows for a table or index within pages. Depending on the locking schema, information is locked at the page or at the row level. The following table shows how each locking schema locks information.&lt;br /&gt;
&lt;br /&gt;
Locking Schema Locks on Index Locks on Data &lt;br /&gt;
All Pages Page Page &lt;br /&gt;
DataPages Not locked Page &lt;br /&gt;
DataRows Not locked Row &lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ The ASE on Linux-distro working matrix:&lt;br /&gt;
! Locking Schema !! Locks on Index !! Locks on Data&lt;br /&gt;
|-&lt;br /&gt;
! All Pages&lt;br /&gt;
| Page || Page&lt;br /&gt;
|-&lt;br /&gt;
! DataPages&lt;br /&gt;
| Not locked || Page&lt;br /&gt;
|-&lt;br /&gt;
! DataRows&lt;br /&gt;
| Not locked || Row&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The table shows that, for instance, the DataPages locking schema does not lock indexes but data is locked at the page level. When a single page is locked, all rows on that page are locked with it. (NB: with the DataPages and DataRows locking schema indexes are locked through latches, a non-transactional locking method)&lt;br /&gt;
&lt;br /&gt;
==Moving from AllPages to DataPages to DataRows==&lt;br /&gt;
Deadlock information can be used to tune the locking schema for a table. When a table uses the AllPages schema and deadlocks occur mostly on pages that contain rows for indexes, a move to DataPages might reduce the change of hitting a deadlock. Also, when deadlocks are frequently occurring on the data level, a move to the DataRows locking schema is an option.&lt;br /&gt;
&lt;br /&gt;
When a table is already using the DataRows locking schema other techniques must be used to eliminate deadlocks. Be aware of the fact that deadlocks cannot always be avoided and the application logic should deal with it by re-submitting the transaction.&lt;br /&gt;
&lt;br /&gt;
Large and busy systems might want to avoid moving all tables to the DataRows locking schema because of the overhead involved. It is not uncommon to see configurations with &amp;quot;number of locks&amp;quot; configured to a value of several million and still hitting that limit. This situation can easily occur through a combination of a high transaction isolation level and the DataRows locking schema. Try to avoid these situations by tuning the locking schema, the transaction isolation level, lock promotion thresholds or other settings.&lt;br /&gt;
&lt;br /&gt;
Servers short of physical ram should be aware of the fact that locks consume memory (approx. 140 Mb per 1 million locks).&lt;br /&gt;
&lt;br /&gt;
==Index or Data?==&lt;br /&gt;
The deadlock information in the errorlog doesn't show if the deadlock was related to an index or to data. However, with the undocumented dbcc page command, this can be determined easily. For instance, dbcc page(4,652391) will tell what type of page is involved, through the indid.&lt;br /&gt;
&lt;br /&gt;
Below is an example of the dbcc page(4,652391) output:&lt;br /&gt;
&lt;br /&gt;
 Page not found in Cache: default data cache.&lt;br /&gt;
 Page read from disk.&lt;br /&gt;
 &lt;br /&gt;
 BUFFER:&lt;br /&gt;
 Buffer header for buffer 0x0x446d3800 (Mass head)&lt;br /&gt;
   page=0x0x446d3000 bdnew=0x(nil) bdold=0x(nil) bhash=0x(nil)&lt;br /&gt;
   bmass_next=0x(nil) bmass_prev=0x(nil) bvirtpg=134242919 '''bdbid=4'''&lt;br /&gt;
   bmass_head=0x0x446d3800 bmass_tail=0x0x446d3800 bcache_desc=0x0x446d6310&lt;br /&gt;
   bpool_desc=0x(nil) bdbtable=0x(nil)&lt;br /&gt;
   Mass bkeep=0 Mass bpawaited=0 Mass btripsleft=0 Mass btripsleft_orig=0&lt;br /&gt;
   bmass_size=2048 (2K pool) bunref_cnt=0&lt;br /&gt;
   bmass_stat=0x0800 (0x00000800 (MASS_NOTHASHED))&lt;br /&gt;
   bbuf_stat=0x0 (0x00000000)&lt;br /&gt;
   Buffer blpageno=652391 bpg_size=2k Mass blpageno=652391 (Buffer slot #: 0)&lt;br /&gt;
   bxls_pin=0x(nil) bxls_next=0x(nil) bspid=0&lt;br /&gt;
   bxls_flushseq=0 bxls_pinseq=0 bcurrxdes=0x(nil)&lt;br /&gt;
 Latch and the wait queue:&lt;br /&gt;
 Latch (address: 0x0x446d3820)&lt;br /&gt;
   latchmode: 0x0 (FREE_LATCH) latchowner: 0 latchnoofowners: 0&lt;br /&gt;
   latchwaitq: 0x(nil) latchwaitqt: 0x(nil)&lt;br /&gt;
 &lt;br /&gt;
 Latch wait queue:&lt;br /&gt;
 &lt;br /&gt;
 PAGE HEADER:&lt;br /&gt;
 Page header for page 0x0x446d3000&lt;br /&gt;
 '''pageno=652391''' nextpg=655160 prevpg=652390 objid=233048835 timestamp=0000 01f2b4c2&lt;br /&gt;
 nextrno=32 level=0 '''indid=0''' freeoff=1961 minlen=39&lt;br /&gt;
 page status bits: 0x101 (0x0100 (PG_ADDEND), 0x0001 (PG_DATA))&lt;br /&gt;
&lt;br /&gt;
The output shows that indid has a value of 0, and so this page is used to store data. Remember that 0 is used for data, values &amp;gt; 0 and &amp;lt; 255 are used for indexes and 255 itself is used for off-row-objects including text and image data.&lt;br /&gt;
&lt;br /&gt;
==The deadlock analyzer tool==&lt;br /&gt;
The output of a single deadlock is by far not enough to make a decision on. The tool provided here reads through the errorlog, makes the required dbcc page commands and scans the output. At the end several statistics are shown. The tool is a Unix/Linux shell script, executing statements with isql and using bcp.&lt;br /&gt;
&lt;br /&gt;
==Sample output==&lt;br /&gt;
Below is a sample output from the analyzer. The first report shows deadlocks occurring at the table level, the second report shows the total number of deadlock per table at page and or row level and the last one shows the number of deadlocks per table and indid.&lt;br /&gt;
&lt;br /&gt;
 Object                                                       Deadlocks on table &lt;br /&gt;
 -----------------------------------------------------------  ------------------- &lt;br /&gt;
 pubs..authors                                                                  8 &lt;br /&gt;
 pubs..publishers                                                             252 &lt;br /&gt;
 (2 rows affected)&lt;br /&gt;
 &lt;br /&gt;
 Object                                           Page/Row    Deadlocks per table &lt;br /&gt;
 -----------------------------------------------  ----------  --------------------- &lt;br /&gt;
 pubs..roysched                                   P                              10&lt;br /&gt;
 pubs..authors                                    P                              91&lt;br /&gt;
 pubs..sales                                      P                             212 &lt;br /&gt;
 pubs..salesdetail                                R                             244 &lt;br /&gt;
 (4 rows affected)&lt;br /&gt;
 &lt;br /&gt;
 Object                                                indid    Deadlocks per index &lt;br /&gt;
 ----------------------------------------------  -----------  --------------------- &lt;br /&gt;
 pubs..authors                                             0                     91 &lt;br /&gt;
 pubs..roysched                                            0                      5 &lt;br /&gt;
 pubs..roysched                                            2                      5 &lt;br /&gt;
 pubs..sales                                               0                    212 &lt;br /&gt;
 pubs..salesdetail                                         0                    244 &lt;br /&gt;
 (5 rows affected)&lt;br /&gt;
&lt;br /&gt;
[[category:ASE]]&lt;/div&gt;</summary>
		<author><name>Psap</name></author>	</entry>

	</feed>