Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple question - SQL Server RID interpretation

Status
Not open for further replies.

Sooty70

Programmer
Oct 14, 2004
16
US
Hi Folks,

I've been looking high and low for the answer to this question for the last couple of hours with no success. I've switched on the trace 1204 to try and figure out what the cause of some deadlocks are. I already kinda know but I want to be exact. In the log I see this:
RID: 19:1:97:0

According to the docs that I have managed to find, this equates to: DATABASE : FILE : PAGE. I then run:
dbcc page(19, 1, 97)

and from that I can determine the object id of the table. I can tell from the log that the lock type is eXclusive. What I want to know is:
1) RID has 4 arguments above, what does the 0 mean?
2) I know that there is an eXclusive lock and I know which table it is on, how can I tell what level the lock is at? Below is the full text for the node that I am interested in:

Code:
2004-10-14 12:45:04.11 spid3     Node:2
2004-10-14 12:45:04.11 spid3     RID: 19:1:97:0                 CleanCnt:1 Mode: X Flags: 0x2
2004-10-14 12:45:04.11 spid3      Grant List 1::
2004-10-14 12:45:04.11 spid3        Owner:0x780bd1e0 Mode: X        Flg:0x0 Ref:0 Life:02000000 SPID:148 ECID:0
2004-10-14 12:45:04.11 spid3        SPID: 148 ECID: 0 Statement Type: UPDATE Line #: 68
2004-10-14 12:45:04.11 spid3        Input Buf: RPC Event: sp_executesql;1
2004-10-14 12:45:04.11 spid3      Requested By: 
2004-10-14 12:45:04.11 spid3        ResType:LockOwner Stype:'OR' Mode: S SPID:397 ECID:0 Ec:(0x3B8C3540) Value:0x780bd160 Cost:(0/0)

I also read that I should be able to view a SPID's transaction history using SQL Profiler but all I can get it to do is show me the deadlocks and deadlock chains. I would love to see the statement that is associated witht he sp_executesql above but I don't know how.

Any assistance that you can give me re: tracking down the exact code that is causing the deadlocks is much appreciated. I have read a bunch about locking and deadlocks and I'm not new to databases, it's SQL Server's diagnostic tools that I am having most trouble with.

Cheers, Max
 
Anybody know the answer to this? I would have thought that something like the row identifier (RID) should be documented in SQL BOL but I can't see it. Let me correct that, I've seen an explanation for RID aa:bb:cc but not RID aa:bb:cc:dd. My understanding is:
aa - database if
bb - file
cc - page
dd - ??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top