patternsqlModerate
Why isn't the objectname and indexname populated in deadlock graph?
Viewed 0 times
populatedwhythegraphobjectnamedeadlockindexnameandisn
Problem
I got a request to check out some errors on a 2008 sp3 server (10.0.5500.0 - Enterprise Edition (64-bit)) and see if I could find deadlocks that were happening earlier.
Traceflag 1222 wasn't enabled and the server owners did not want to enable it either. I used extended events and pulled out some info using the following query:
I received a lot of info back that looked like this:
How can I found out what the deadlocks are if objectname="" indexname="" ?
Traceflag 1222 wasn't enabled and the server owners did not want to enable it either. I used extended events and pulled out some info using the following query:
SELECT CAST(event_data.value('(event/data/value)[1]',
'varchar(max)') AS XML) AS DeadlockGraph
FROM ( SELECT XEvent.query('.') AS event_data
FROM ( -- Cast the target_data to XML
SELECT CAST(target_data AS XML) AS TargetData
FROM sys.dm_xe_session_targets st
JOIN sys.dm_xe_sessions s
ON s.address = st.event_session_address
WHERE name = 'system_health'
AND target_name = 'ring_buffer'
) AS Data -- Split out the Event Nodes
CROSS APPLY TargetData.nodes('RingBufferTarget/
event[@name="xml_deadlock_report"]')
AS XEventData ( XEvent )
) AS tab ( event_data )I received a lot of info back that looked like this:
How can I found out what the deadlocks are if objectname="" indexname="" ?
Solution
I can't answer as to why there is information missing, but I can point out how to extract it.
First, move to that database:
Take that result and:
Now find out what these hobt_ids represent:
You can also find the batches involved (if they're still around) using:
The offsets are there in the
EDIT Mr. Sandwiches pointed out the following Connect item (no longer available), where Microsoft has stated that this bug is fixed in SQL Server 2012. It won't be fixed in 2008/R2.
First, move to that database:
SELECT DB_NAME(25);Take that result and:
USE ;Now find out what these hobt_ids represent:
SELECT OBJECT_SCHEMA_NAME(object_id), OBJECT_NAME(object_id)
FROM sys.partitions
WHERE hobt_id IN (72057594099728384, 72057594099793920);You can also find the batches involved (if they're still around) using:
SELECT * FROM sys.dm_exec_sql_text(0x03001900b9667f2bc41ade003ea000000100000000000000);
SELECT * FROM sys.dm_exec_sql_text(0x03001900f28a732c051bde003ea000000100000000000000);
SELECT * FROM sys.dm_exec_sql_text(0x030019002cf5fc35c2449200d2a000000100000000000000);The offsets are there in the
ExecutionStack so you can drill deeper into that output if you like (many examples of using offsets online).EDIT Mr. Sandwiches pointed out the following Connect item (no longer available), where Microsoft has stated that this bug is fixed in SQL Server 2012. It won't be fixed in 2008/R2.
http://connect.microsoft.com/SQLServer/feedback/details/635391/objectname-indexname-not-populated-in-deadlock-graph-in-sql2008-sp1-and-sql2008-r2Code Snippets
SELECT DB_NAME(25);USE <db_name>;SELECT OBJECT_SCHEMA_NAME(object_id), OBJECT_NAME(object_id)
FROM sys.partitions
WHERE hobt_id IN (72057594099728384, 72057594099793920);SELECT * FROM sys.dm_exec_sql_text(0x03001900b9667f2bc41ade003ea000000100000000000000);
SELECT * FROM sys.dm_exec_sql_text(0x03001900f28a732c051bde003ea000000100000000000000);
SELECT * FROM sys.dm_exec_sql_text(0x030019002cf5fc35c2449200d2a000000100000000000000);Context
StackExchange Database Administrators Q#28996, answer score: 10
Revisions (0)
No revisions yet.