views:

10

answers:

1

I am researching deadlocks that are happening in our application. I turned trace on for 1204, 1205 and 3605. I got the deadlock trace alright. But I am unable to figure out the resource it is deadlocking on. I have read many forums and they all say that the trace should contain something called a KEY/RID which would point to the resource in question. But my trace files does not contain KEY/RID at all. Instead it contains something called as PAGE.

For example, 06/30/2010 16:29:52,spid4s,Unknown,PAGE: 8:1:16512 CleanCnt:2 Mode:IX Flags: 0x2 06/30/2010 16:29:52,spid4s,Unknown,PAGE: 8:1:5293 CleanCnt:2 Mode:IX Flags: 0x2

How can I determine what this resource is, based on this PAGE information I am getting? Thanks in advance for your help!

A: 

it looks like the lock is being done at a page level. Check out http://msdn.microsoft.com/en-us/library/aa937573(SQL.80).aspx > Using Trace Flag 1204 > Terms in a Trace Flag 1204 Report > PAG

PAG

Identifies the page resource on which a lock is held or requested.

PAG is represented in Trace Flag 1204 as PAG: db_id:file_id:page_no; for example, PAG: 7:1:168.

Edit

  1. Use DBCC PAGE (http://support.microsoft.com/kb/83065 or http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server/26555/Determining-table-for-a-particular-File-id-Page-No) to get the object id from the page information,

  2. then use OBJECT_NAME (http://msdn.microsoft.com/en-us/library/ms186301.aspx) or query sys.objects to get the resource

potatopeelings
Thanks potatopeeling. I got that far. What I am trying to figure out is come up with a query that will point me to the resource being locked based on the db_id, file_id and page_no that is in this PAGE information.
etrast81
realized that after i submitted the answer :-). just added the rest as an edit.
potatopeelings
Excellent! Thats what I was looking for. Thank you very much!
etrast81