October 14, 2005 at 5:43 am
Given an extent lock reported in the fashion EXT 1:408680 (sp_lock or deadlock graph) is there any way to find out what object the lock was placed on?
With a page lock I can use DBCC Page to get the object ID. Is there any such method to get the object that owns an extent (or objects, in the case of mixed extents)?
Thanks
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 14, 2005 at 6:33 am
How about:
DBCC PAGE (dbid, 1, 408680, printopt)
DBCC PAGE (dbid, 1, 408681, printopt)
DBCC PAGE (dbid, 1, 408682, printopt)
DBCC PAGE (dbid, 1, 408683, printopt)
DBCC PAGE (dbid, 1, 408684, printopt)
DBCC PAGE (dbid, 1, 408685, printopt)
DBCC PAGE (dbid, 1, 408686, printopt)
DBCC PAGE (dbid, 1, 408687, printopt)
October 14, 2005 at 6:36 am
And another alternative is of course DBCC EXTENTINFO ('DBNAME')
October 14, 2005 at 7:19 am
Thanks. Didn't know that the number was actually a page number.
Never seen that DBCC command before either. (even in the list of DBCC commands that I found)
Thanks.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 14, 2005 at 7:45 am
Extent numbers always refer to the first page (of 8) in the extent. So an extent number % 8 always equals 0.
September 21, 2023 at 5:24 pm
Hello,
Would any of you know how to reduce or prevent EXTENT locks?
Processing records on a large table in my db is creating tens of thousands of EXT locks which I think may be affecting performance.
I tried to force a table lock on my table in my query hoping it would reduce the EXTENT locks with:
select TOP 1 * from #ledger with (TABLOCKX,holdlock)
I can see with sp_lock that I have a TAB type lock with mode: X but still am getting thousands of EXT locks.
Any assistance would be appreciated and thank you in advance.
Mike
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply