2008-12-09 8 views
6

J'essaie de tracer un interblocage qui se produit dans notre base de données SQL 2005 (64 bits). Actuellement, l'isolation d'instantané n'est pas activée.Sql Server Deadlock ID d'objet sont trop grands

J'ai allumé le tf-1204 et j'ai reçu la sortie ci-dessous.

À partir de cette sortie, je suis en mesure de déterminer que le nœud 1 est une procédure stockée qui sélectionne des données et ne modifie que les valeurs des tables #temp.

Le noeud 2 est une autre procédure stockée qui effectue une mise à jour basée sur une clé primaire simple sur une seule ligne de données.

Ce que je ne peux pas déterminer est la ressource réelle qui était en conflit ici. Les clés de 10: 72057594060734464 et 10: 72057594038910976 me permettent de déterminer la base de données, mais ces identifiants d'objet ne peuvent pas être résolus avec object_name. En fait, ils devraient être int valeurs, donc je ne suis pas sûr d'où viennent ces grands nombres. En recherchant le problème, j'ai pu obtenir des valeurs similaires à partir du moniteur d'activité pour l'identification de l'objet.

Comment résoudre ces identifiants d'objet?

est ici l'impasse sortie tf-1204:

 
2008-12-05 07:48:28.19 spid4s  ---------------------------------- 
2008-12-05 07:48:28.19 spid4s  Starting deadlock search 634 
2008-12-05 07:48:28.19 spid4s  Target Resource Owner: 
2008-12-05 07:48:28.19 spid4s  ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980 
2008-12-05 07:48:28.19 spid4s  0:Insert new node: Node:1  ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980 
2008-12-05 07:48:28.19 spid4s  1:SearchOR Considering new blocker - task: 0000000000EC5198, Worker 00000000C89881C0 
2008-12-05 07:48:28.19 spid4s  2:Insert new node: Node:2  ResType:LockOwner Stype:'OR'Xdes:0x00000000808F1A80 Mode: S SPID:79 BatchID:0 ECID:0 TaskProxy:(0x0000000129E82598) Value:0x1063d000 
2008-12-05 07:48:28.19 spid4s  3:SearchOR Considering new blocker - task: 0000000000C3FC18, Worker 00000000F847C1C0 
2008-12-05 07:48:28.19 spid4s  4:InsertKnown Cycle found between old res owner: [ ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980] and new res owner [ ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980] 
2008-12-05 07:48:28.19 spid4s  4:InsertKnown search result: Deadlock found (blocking owner is on a stack) 
2008-12-05 07:48:28.19 spid4s  3:SearchOR search result: Deadlock found (cycle on this level or before) 
2008-12-05 07:48:28.19 spid4s  1:SearchOR search result: Deadlock found (cycle on this level or before) 
2008-12-05 07:48:28.19 spid4s  
2008-12-05 07:48:28.19 spid4s  Deadlock cycle was encountered .... verifying cycle 
2008-12-05 07:48:28.19 spid4s  0:Insert new node: Node:1  ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980 Cost:(0/1544) 
2008-12-05 07:48:28.19 spid4s  1:SearchOR Considering new blocker - task: 0000000000EC5198, Worker 00000000C89881C0 
2008-12-05 07:48:28.19 spid4s  2:Insert new node: Node:2  ResType:LockOwner Stype:'OR'Xdes:0x00000000808F1A80 Mode: S SPID:79 BatchID:0 ECID:0 TaskProxy:(0x0000000129E82598) Value:0x1063d000 Cost:(0/0) 
2008-12-05 07:48:28.19 spid4s  3:SearchOR Considering new blocker - task: 0000000000C3FC18, Worker 00000000F847C1C0 
2008-12-05 07:48:28.19 spid4s  4:InsertKnown Cycle found between old res owner: [ ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980 Cost:(0/1544)] and new res owner [ ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980 Cost:(0/1544)] 
2008-12-05 07:48:28.19 spid4s  4:InsertKnown search result: Deadlock found (blocking owner is on a stack) 
2008-12-05 07:48:28.19 spid4s  3:SearchOR search result: Deadlock found (cycle on this level or before) 
2008-12-05 07:48:28.19 spid4s  1:SearchOR search result: Deadlock found (cycle on this level or before) 
2008-12-05 07:48:28.19 spid4s  Deadlock encountered .... Printing deadlock information 
2008-12-05 07:48:28.19 spid4s  Wait-for graph 
2008-12-05 07:48:28.19 spid4s  
2008-12-05 07:48:28.19 spid4s  Node:1 

2008-12-05 07:48:28.19 spid4s  KEY: 10:72057594060734464 (c80089667602) CleanCnt:3 Mode:S Flags: 0x0 
2008-12-05 07:48:28.19 spid4s  Grant List 1: 
2008-12-05 07:48:28.19 spid4s   Owner:0x000000011063CDC0 Mode: S  Flg:0x0 Ref:1 Life:00000000 SPID:79 ECID:0 XactLockInfo: 0x00000000808F1AB8 
2008-12-05 07:48:28.19 spid4s   SPID: 79 ECID: 0 Statement Type: INSERT Line #: 220 
2008-12-05 07:48:28.19 spid4s   Input Buf: RPC Event: Proc [Database Id = 10 Object Id = 1751794144] 
2008-12-05 07:48:28.19 spid4s  Requested By: 
2008-12-05 07:48:28.19 spid4s   ResType:LockOwner Stype:'OR'Xdes:0x00000000813B8700 Mode: X SPID:77 BatchID:0 ECID:0 TaskProxy:(0x00000000CE6D8598) Value:0x1043f980 Cost:(0/1544) 
2008-12-05 07:48:28.19 spid4s  
2008-12-05 07:48:28.19 spid4s  Node:2 

2008-12-05 07:48:28.19 spid4s  KEY: 10:72057594038910976 (0c0092f62b82) CleanCnt:2 Mode:X Flags: 0x0 
2008-12-05 07:48:28.19 spid4s  Grant List 0: 
2008-12-05 07:48:28.19 spid4s   Owner:0x000000011043F300 Mode: X  Flg:0x0 Ref:0 Life:02000000 SPID:77 ECID:0 XactLockInfo: 0x00000000813B8738 
2008-12-05 07:48:28.19 spid4s   SPID: 77 ECID: 0 Statement Type: UPDATE Line #: 23 
2008-12-05 07:48:28.19 spid4s   Input Buf: RPC Event: Proc [Database Id = 10 Object Id = 1791462302] 
2008-12-05 07:48:28.19 spid4s  Requested By: 
2008-12-05 07:48:28.19 spid4s   ResType:LockOwner Stype:'OR'Xdes:0x00000000808F1A80 Mode: S SPID:79 BatchID:0 ECID:0 TaskProxy:(0x0000000129E82598) Value:0x1063d000 Cost:(0/0) 
2008-12-05 07:48:28.19 spid4s  
2008-12-05 07:48:28.19 spid4s  Victim Resource Owner: 
2008-12-05 07:48:28.19 spid4s  ResType:LockOwner Stype:'OR'Xdes:0x00000000808F1A80 Mode: S SPID:79 BatchID:0 ECID:0 TaskProxy:(0x0000000129E82598) Value:0x1063d000 Cost:(0/0) 
2008-12-05 07:48:28.19 spid4s  End deadlock search 634 ... a deadlock was found. 
2008-12-05 07:48:28.19 spid4s  ---------------------------------- 

Répondre

10

Ces ID se réfèrent en fait à hobts ​​(Heap ou Binary Tree), trouvé dans sys.partitions. Essayez la requête suivante dans la base de données 10, et vous trouverez quel objet et quel index est affecté.

SELECT hobt_id, object_name(p.[object_id]), index_id 
FROM sys.partitions p 
WHERE hobt_id = 72057594060734464 
Questions connexes