其实本篇文章算是翻译Finding a table name from a page ID这篇文章,只是不想直接翻译。用自己的理解叙说出来。算是对上一篇博客"SQL Server如何找出一个表包含的页信息(Page)"的承前启后。

 

我们如果从日志或dump文件中发现页信息,那么能否通过页信息找到其关联的对象呢? 答案是可以,而且非常简单。如下所示,这个DBCC PAGE的输出信息:

 

 

DBCC execution completed. If DBCC printed error messages, contact your system administrator.
 
PAGE: (1:24188)
 
 
BUFFER:
 
 
BUF @0x000000018123EDC0
 
bpage = 0x000000012AAD6000          bhash = 0x0000000000000000          bpageno = (1:24188)
bdbid = 7                           breferences = 0                     bcputicks = 0
bsampleCount = 0                    bUse1 = 26077                       bstat = 0x9
blog = 0x21cc7a7a                   bnext = 0x0000000000000000          
 
PAGE HEADER:
 
 
Page @0x000000012AAD6000
 
m_pageId = (1:24188)                m_headerVersion = 1                 m_type = 1
m_typeFlagBits = 0x0                m_level = 0                         m_flagBits = 0x8200
m_objId (AllocUnitId.idObj) = 439   m_indexId (AllocUnitId.idInd) = 256 
Metadata: AllocUnitId = 72057594066698240                                
Metadata: PartitionId = 72057594059030528                                Metadata: IndexId = 0
Metadata: ObjectId = 631673298      m_prevPage = (0:0)                  m_nextPage = (0:0)
pminlen = 8                         m_slotCnt = 193                     m_freeCnt = 376
m_freeData = 7430                   m_reservedCnt = 0                   m_lsn = (47:211:2)
m_xactReserved = 0                  m_xdesId = (0:0)                    m_ghostRecCnt = 0
m_tornBits = 1650828474             DB Frag ID = 1                      
 
Allocation Status
.....................................................................

相关文章: