Wednesday, February 9, 2011

DBCC Page, Ind, DBINFO,DatabasePropertyex

Eg:

dbcc ind('dbname','tablename',<indexid>)
Output will be something like this:

PageFID PagePID IAMFID IAMPID ObjectID IndexID PartitionNumber PartitionID iam_chain_type PageType IndexLevel NextPageFID NextPagePID PrevPageFID PrevPagePID
1 2865665 NULL NULL 276964113 2 1 72057612875333600 In-row data 10 NULL 1 2872682 0 0
1 2676373 1 2865665 276964113 2 1 72057612875333600 In-row data 2 1 1 17518182 1 17518181

DBCC Page(<dbid or name>,fileid,pageno,printoptions)

Printoptions can be any of the below
  • 0 - print just the page header
  • 1 - page header plus per-row hex dumps and a dump of the page slot array (unless its a page that doesn't have one, like allocation bitmaps)
  • 2 - page header plus whole page hex dump
  • 3 - page header plus detailed per-row interpretation

eg:
dbcc page(5,1,2865665,3)
Output:

PAGE: (1:2865665)


BUFFER:


BUF @0x0000000122FCBE00

bpage = 0x00000001222F8000           bhash = 0x0000000000000000           bpageno = (1:2865665)
bdbid = 5                            breferences = 0                      bUse1 = 39810
bstat = 0x2c00009                    blog = 0x159a2159                    bnext = 0x0000000000000000

PAGE HEADER:


Page @0x00000001222F8000

m_pageId = (1:2865665)               m_headerVersion = 1                  m_type = 10
m_typeFlagBits = 0x0                 m_level = 0                          m_flagBits = 0x0
m_objId (AllocUnitId.idObj) = 285393 m_indexId (AllocUnitId.idInd) = 256 
Metadata: AllocUnitId = 72057612741443584                                
Metadata: PartitionId = 72057612875333632                                 Metadata: IndexId = 2
Metadata: ObjectId = 276964113       m_prevPage = (0:0)                   m_nextPage = (1:2872682)
pminlen = 90                         m_slotCnt = 2                        m_freeCnt = 6
m_freeData = 8182                    m_reservedCnt = 0                    m_lsn = (3178619:17664:62)
m_xactReserved = 0                   m_xdesId = (0:0)                     m_ghostRecCnt = 0
m_tornBits = 1                      

Allocation Status

GAM (1:2556160) = ALLOCATED          SGAM (1:2556161) = NOT ALLOCATED    
PFS (1:2863152) = 0x70 IAM_PG MIXED_EXT ALLOCATED   0_PCT_FULL            DIFF (1:2556166) = CHANGED
ML (1:2556167) = NOT MIN_LOGGED     

IAM: Header @0x0000000010EFC064 Slot 0, Offset 96

sequenceNumber = 0                   status = 0x0                         objectId = 0
indexId = 0                          page_count = 0                       start_pg = (1:2556160)


IAM: Single Page Allocations @0x0000000010EFC08E

Slot 0 = (1:2676373)                 Slot 1 = (1:2676423)                 Slot 2 = (1:2728190)
Slot 3 = (1:3036608)                 Slot 4 = (1:2875265)                 Slot 5 = (1:2875537)
Slot 6 = (1:2912256)                 Slot 7 = (1:2941226)                


IAM: Extent Alloc Status Slot 1 @0x0000000010EFC0C2

(1:2556160)  - (1:3067384)  = NOT ALLOCATED  


select databasepropertyex('dbname','version')
--611 

DBINFO('dbname') with tableresults 
gives u the output something like this:

DBINFO STRUCTURE:
ParentObject Object Field VALUE
DBINFO STRUCTURE: DBINFO @0x0000000012C9EAA0 dbi_dbid 5
DBINFO STRUCTURE: DBINFO @0x0000000012C9EAA0 dbi_status 4194328
DBINFO STRUCTURE: DBINFO @0x0000000012C9EAA0 dbi_nextid 1621281231
DBINFO STRUCTURE: DBINFO @0x0000000012C9EAA0 dbi_dbname JDE_PRODUCTION
DBINFO STRUCTURE: DBINFO @0x0000000012C9EAA0 dbi_maxDbTimestamp 62568600
DBINFO STRUCTURE: DBINFO @0x0000000012C9EAA0 dbi_version 611










No comments:

Post a Comment