开发者

SQL Server trace - translating PAGE information to actual resource

开发者 https://www.devze.com 2023-01-05 21:07 出处:网络
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 deadlock

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!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消