Help to interpret a trace to find a sql server deadlock
First of all I must say that I have somewhat basic knowledge of sql server and with that I'm trying to figure out how to resolve a deadlock.
I ran dbcc traceon (1204, -1), executed the culprit code and finally executed the xp_readerrorlog stored proc which gave me the following output:
Deadlock encountered .... Printing deadlock information
Wait-for graph
NULL
Node:1
OBJECT: 9:1093578934:0 CleanCnt:2 Mode:IX Flags: 0x1
Grant List 2:
Grant List 3:
Owner:0x000000008165A780 Mode: IX Flg:0x40 Ref:2 Life:02000000 SPID:57 ECID:0 XactLockInfo: 0x0000000082F00EC0
SPID: 57 ECID: 0 Statement Type: EXECUTE Line #: 1
Input Buf: RPC Event: Proc [Database Id = 9 Object Id = 1877581727]
Requested by:
ResType:LockOwner Stype:'OR'Xdes:0x0000000082E02E80 Mode: S SPID:56 BatchID:0 ECID:0 TaskProxy:(0x00000000826EE538) Value:0x81a6f9c0 Cost:(0/1492)
NULL
Node:2
APPLICATION: 9:0:[Proligent Analytics]:(6ff56412) CleanCnt:2 Mode:X Flags: 0x5
Grant List 2:
Owner:0x000000008165DE40 Mode: X Flg:0x40 Ref:1 Life:00000000 SPID:56 ECID:0 XactLockInfo开发者_开发百科: 0x0000000082E02EC0
SPID: 56 ECID: 0 Statement Type: OPEN CURSOR Line #: 27
Input Buf: RPC Event: Proc [Database Id = 9 Object Id = 1966630049]
Requested by:
ResType:LockOwner Stype:'OR'Xdes:0x0000000082F00E80 Mode: X SPID:57 BatchID:0 ECID:0 TaskProxy:(0x00000000827B8538) Value:0x83e29d40 Cost:(0/250576)
NULL
Victim Resource Owner:
ResType:LockOwner Stype:'OR'Xdes:0x0000000082E02E80 Mode: S SPID:56 BatchID:0 ECID:0 TaskProxy:(0x00000000826EE538) Value:0x81a6f9c0 Cost:(0/1492)
My problem is that I have no idea how to use this to find out what's going on. I've read that you can get the stored procedure that is getting locked but I don't know how.
Please a few pointers would be appreciated.
Thanks
As @Martin Smith says in his comment: select db_name(9), object_name(1093578934,9), object_name(1966630049,9), object_name(1877581727,9) should give you some of the objects.
精彩评论