Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2013
    Posts
    19

    Unanswered: Allocation Unit ID calculation is incorrect?

    Hi,

    I am reading the article http://www.sqlskills.com/blogs/paul/...ds-calculated/ on how to calculate the allocation unit ID based on m_indexId and m_objID. Then I try that on one of my database, by executing the command below:

    DBCC TRACEON(3604);
    DBCC PAGE (UFDATA_008_2013, 1, 73057, 3);
    GO

    And the output result is:

    PAGE HEADER:


    Page @0x10008000

    m_pageId = (1:73057) m_headerVersion = 1 m_type = 1
    m_typeFlagBits = 0x0 m_level = 0 m_flagBits = 0x8000
    m_objId (AllocUnitId.idObj) = 1913890731 m_indexId (AllocUnitId.idInd) = 0
    Metadata: AllocUnitId = 406903719657472 Metadata: PartitionId = 406903719657472
    Metadata: IndexId = 1 Metadata: ObjectId = 1913890731 m_prevPage = (1:92774)
    m_nextPage = (0:0) pminlen = 11 m_slotCnt = 61
    m_freeCnt = 3241 m_freeData = 4829 m_reservedCnt = 0
    m_lsn = (4028:6215:30) m_xactReserved = 0 m_xdesId = (0:0)
    m_ghostRecCnt = 0 m_tornBits = 0

    Then I use the formula in the above article to calculate the allocation Unit ID as (0 << 48) + (1913890731 << 16) = 125428742946816, which does not equal to the output Metadata: AllocUnitId(406903719657472). Why?

    I can confirm the page is allocated, since I use the following command to list all the pages allocated to table ‘AADomDataColSet’:

    DBCC TRACEON(3604);
    Dbcc ind(UFDATA_008_2013, ‘AADomDataColSet’, -1);

    And the result is below:

    Click image for larger version. 

Name:	AADomDataColSet.jpg 
Views:	1 
Size:	135.0 KB 
ID:	16727

    You can find the page (1, 73057) is allocated to this object.


    Thanks
    Last edited by chcw; 01-23-16 at 04:26.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •