While continuing to look at what is causing blocks, you come across another format of information in the waitresource column in sysprocesses. This time you see:
PAG: 7:1:11223344
Again - thanks for the help SQL - object_ID too much trouble for you I guess?? Anyway, gives a DBA something to do I suppose.
This time it's not a hobt_id, but a page id, and is read as "DB_id, file_id, page_id"
To get this one into text, we need to do a couple of things.
First Run:
DBCC TraceOn (3604)
- this just tells DBCC commands to output to the screen rather than errorlog, and just lasts for your current connection, otherwise the next command just tells you "DBCC execution completed" which is even less helpful than "PAG 7:1:11223344"!
Then run
DBCC PAGE (7, 1, 11223344)
(Note you could run this adding WITH TABLERESULTS for an even tidier output)
From the result set returned, you should be able to spot a few useful Id's, such as
Metadata: IndexId
Metadata: ObjectId
From here, with OBJECT_NAME() or just scanning sys.indexes, you should be able to ascertain what table and index you are being blocked by.
Showing posts with label blocks. Show all posts
Showing posts with label blocks. Show all posts
Wednesday, 25 January 2012
Friday, 14 October 2011
Decipher blocked process waitresource
When attempting to identify blocking issues, you may find yourself looking in sysprocesses at the waitresource column, and trying to decipher the meaning of something along the lines of:
KEY: 32:72057594097827840 (f5593d0e605b)
Thanks - you couldn't just tell me the actual object could you?!
But help is at hand - apparently this key consists of the database id, followed by a a hobt_id - no, not a small person with large feet from New Zealand, but a "Heap or B-Tree" id.
This id value can be found in the sys.partitions table, so a quick join from that to sys.indexes, and back to sys.obejcts finally reveals the index we are blocked on.
E.g.
SELECT o.name, i.name
FROM sys.partitions p
JOIN sys.objects o ON p.object_id = o.object_id
JOIN sys.indexes i ON p.object_id = i.object_id
AND p.index_id = i.index_id
WHERE p.hobt_id = 72057594097827840
KEY: 32:72057594097827840 (f5593d0e605b)
Thanks - you couldn't just tell me the actual object could you?!
But help is at hand - apparently this key consists of the database id, followed by a a hobt_id - no, not a small person with large feet from New Zealand, but a "Heap or B-Tree" id.
This id value can be found in the sys.partitions table, so a quick join from that to sys.indexes, and back to sys.obejcts finally reveals the index we are blocked on.
E.g.
SELECT o.name, i.name
FROM sys.partitions p
JOIN sys.objects o ON p.object_id = o.object_id
JOIN sys.indexes i ON p.object_id = i.object_id
AND p.index_id = i.index_id
WHERE p.hobt_id = 72057594097827840
Subscribe to:
Posts (Atom)