Resolving System Error Mess ...


Troubleshooting (SQL Server 2000)
Error 8939

Error 8939

  Topic last updated -- January 2004

Severity Level 16
Message Text

Table error: Object ID O_ID, index ID I_ID, page P_ID. Test (TEST) failed. Values are VAL1 and VAL2.

Explanation

A page has failed auditing due to a corruption in its page header. The string in TEST gives the actual test that failed. VAL1 and VAL2 depend on the error state.

Per-state information:

State 1: The offset of the data portion of the page is not equal to the constant size of a page header (96 bytes).

  • TEST is 'PAGEHEADSIZE == (int)((BYTE*)m_data – (BYTE*) this)'.

  • VAL1 is the constant size of a page header ('PAGEHEADSIZE').

  • VAL2 is the offset of the data portion of the page (value of right-hand expression in TEST).

State 3: A system table non-text page is incorrectly aligned.

  • TEST is 'm_flagBits & PG_ALIGNED4'.

  • VAL1 is the value of the m_flagBits.

  • VAL2 is the object ID.

State 4: A non-system table page is incorrectly aligned.

  • TEST is '!(m_flagBits & PG_ALIGNED4)'

  • VAL1 is the value of the m_flagBits.

  • VAL2 is the object ID.

State 5: The header version is not HEADER_7_0.

  • TEST is 'm_headerVersion == HEADER_7_0'.

  • VAL1 is the header version on the page ('m_headerVersion').

  • VAL2 is the constant HEADER_7_0 (1).

State 6: The page type is not valid, or it is Page::UNKNOWN_PAGE and the audit level is not basic.

  • TEST is '(m_type >= DATA_PAGE && m_type <= UNDOFILE_HEADER_PAGE) || (m_type == UNKNOWN_PAGE && level == BASIC_HEADER)'.

  • VAL1 is the page type ('m_type'). See error 8938 for page types.

  • VAL2 is also the page type.

State 7: The persisted free space offset on the page is inside the page header or the slot offset array.

  • TEST is 'm_freeData >= PAGEHEADSIZE && m_freeData <= (UINT)PAGESIZE – m_slotCnt * sizeof(Slot)'.

  • VAL1 is the persisted free space offset ('m_freeData').

  • VAL2 is the start of the slot offset table (rhs of second expression above).

State 8: The free space count is greater than the maximum possible.

  • TEST is 'm_freeCnt <= PAGESIZE – PAGEHEADSIZE'.

  • VAL1 is the free space count ('m_freeCnt').

  • VAL2 is the maximum possible free space (page size minus page header size).

State 10: The slot count is >= the maximum.

  • TEST is 'm_slotCnt < MaxSlot'.

  • VAL1 is the slot count ('m_slotCnt').

  • VAL2 is the maximum ('MaxSlot').

State 12: One of the long words in the unused portion of the page header is not zero as required.

  • TEST is '*(((UNIT32*) &m_used1) + i == 0'.

  • VAL1 is the long word that is non-0 ('i').

  • VAL2 is its value (lhs of expression).

State 13: A DATA_PAGE page has a level other than zero.

  • TEST is 'm_level == 0'.

  • VAL1 is the level ('m_level').

  • VAL2 is 0.

State 14: A DATA_PAGE page has an index ID other than zero.

  • TEST is 'm_indexId == TABENTRY'.

  • VAL1 is the value of m_indexId.

  • VAL2 is 0.

State 15: An INDEX_PAGE page has an index ID of zero.

  • TEST is 'm_indexId >= CLUSTIND'.

  • VAL1 is the value of m_indexId.

  • VAL2 is 1.

State 16: A text page has an index ID other than 255.

  • TEST is 'm_indexId == TXTENTRY'.

  • VAL1 is the value of m_indexId.

  • VAL2 is 255.

State 17: The object ID on an ML_MAP_PAGE page is not the constant system object ID.

  • TEST is 'm_objId == SYSALLOCPG && m_indexId == 0 && m_pageId == pgId'.

  • VAL1 is the object ID ('m_objId').

  • VAL2 is the system object ID ('SYSALLOCPG')—currently 99.

State 18: An ML_MAP_PAGE page is not in a GAM extent.

  • TEST is 'ISGAMEXTID (GetId (), DFLT_EXT_SIZE)'.

  • VAL1 is the file ID of the correct extent position in the file.

  • VAL2 is the page ID of the correct extent position in the file.

State 19: There are not exactly two records on an ML_MAP_PAGE page.

  • TEST is 'm_slotCnt == 2'.

  • VAL1 is the slot count ('m_slotCnt').

  • VAL2 is two.

State 20: The offset of the first slot is not immediately after the page header for a ML_MAP_PAGE page.

  • TEST is 'm_slots[0].GetOffset () == PAGEHEADSIZE'.

  • VAL1 is the offset of the first slot ('m_slots[0].GetOffset ()').

  • VAL2 is the size of a page header ('PAGEHEADSIZE').

State 21: The second slot in an ML_MAP_PAGE page is not at the correct offset.

  • TEST is 'Align(m_slots[-1].GetOffset ()) == Align(m_slots[0].GetOffset () + sizeof(GAMHEADER) + sizeof(DataRecHdr))'.

  • VAL1 is the offset of the second slot (lhs of expression).

  • VAL2 is the offset that it should be (rhs of expression).

State 27: There are not exactly two records on an IAM page.

  • TEST is 'm_slotCnt == 2 && m_type == IAM_PAGE'.

  • VAL1 is the slot count ('m_slotCnt').

  • VAL2 is 2.

State 28: The offset of the first slot is not immediately after the page header for a IAM page.

  • TEST is 'm_slots[0].GetOffset () == PAGEHEADSIZE && m_type == IAM_PAGE'.

  • VAL1 is the offset of the first slot ('m_slots[0].GetOffset ()').

  • VAL2 is the size of a page header ('PAGEHEADSIZE').

State 29: The second slot in an IAM page is not at the correct offset.

  • TEST is 'Align(m_slots[-1].GetOffset ()) == Align(m_slots[0].GetOffset () + sizeof(IAMHEADER) + sizeof(DataRecHdr)) && m_type == IAM_PAGE'.

  • VAL1 is the offset of the second slot (lhs of expression).

  • VAL2 is the offset that it should be (rhs of expression).

State 30: The object ID on a PFS page is not the constant system object ID.

  • TEST is 'm_objId == SYSALLOCPG && m_indexId == 0 && m_type == PFS_PAGE'.

  • VAL1 is the object ID ('m_objId').

  • VAL2 is the system object ID ('SYSALLOCPG')—currently 99.

State 31: A PFS page is in the wrong place in a file.

  • TEST is 'GetAllocPgId ((AllocPageType)PFS_PAGE, GetId (), DFLT_EXT_SIZE) == GetId ()'.

  • VAL1 is the file number of the correct position of the page.

  • VAL2 is the page ID of the correct position of the page.

State 32: There is not exactly one record on a PFS page.

  • TEST is 'm_slotCnt == 1 && m_type == PFS_PAGE'.

  • VAL1 is the slot count ('m_slotCnt').

  • VAL2 is 1.

State 33: The offset of the first slot is not immediately after the page header for a PFS page.

  • TEST is 'm_slots[0].GetOffset () == PAGEHEADSIZE && m_type == PFS_PAGE'.

  • VAL1 is the offset of the first slot ('m_slots[0].GetOffset ()').

  • VAL2 is the size of a page header ('PAGEHEADSIZE').

State 34: The persisted page-type specific bits are non-zero for a DUMP_HEADER_PAGE.

  • TEST is 'm_typeFlagBits == 0'.

  • VAL1 is the value of the persisted bits ('m_typeFlagBits').

  • VAL2 is 0.

State 35: The persisted page type-specific bits are non-zero for a DUMP_TRAILER_PAGE.

  • TEST is 'm_typeFlagBits == 0'.

  • VAL1 is the value of the persisted bits ('m_typeFlagBits').

  • VAL2 is 0.

State 37: The persisted free space offset is less than the end of a record on the page.

  • TEST is 'm_freeData >= m_slots [-i].offset + rowlen'.

  • VAL1 is the persisted free space offset ('m_freeData').

  • VAL2 is the end of the current record being considered (rhs of expression).

State 39: The amount of data calculated by adding up all record sizes does not equal that calculated using the persisted free space count.

  • TEST is 'dataLen == dataLenCalc'.

  • VAL1 is the amount of free space calculated by adding the record sizes ('dataLen').

  • VAL2 is the amount of free space calculated using the persisted free space count ('dataLenCalc').

State 40: A FILEHEADER page is not the first page in the file, or it has the wrong number of slots (2 for the first log file, 1 for all others).

  • TEST is 'm_type == FILEHEADER_PAGE && m_pageId.PageInFile () == 0 && (m_slotCnt == 1 || (m_slotCnt == 2 && m_pageId.GetFileId () == PRIMARY_LOG_FCB))'.

  • VAL1 is the slot count ('m_slotCnt').

  • VAL2 is 1.

State 41: There are set bits in the page's persisted flags that are undefined.

  • TEST is '!ANY_ON (UndefinedPageTypeBits, m_flagBits)'.

  • VAL1 is the persisted set of flags ('m_flagBits').

  • VAL2 is the set of undefined bits ('UndefinedPageTypeBits').

State 42: A TEXT_TREE_PAGE has a slot count > 1.

  • TEST is 'm_slotCnt <= 1 && m_type == TEXT_TREE_PAGE'.

  • VAL1 is the slot count ('m_slotCnt').

  • VAL2 is one.

State 98: A page had a read IO error that was not a bad page ID in its header.

  • TEST is 'IS_OFF (BUF_IOERR, pBUF->bstat ) || pBUF->berrcode == BUFERR_BADPAGEID'.

  • VAL1 is the buffer status ('pBUF->bstat').

  • VAL2 is the error code ('pBUF->berrcode').

State 99: A work file page was found in a database other than TEMPDB.

  • TEST is 'pageType != WF_PAGE || pDBTABLE->dbt_dbid == TEMPDBID'.

  • VAL1 is the database ID ('pDBTABLE->dbt_dbid').

  • VAL2 is the database ID of TEMPDB ('TEMPDBID').

State 100 and 110: A header modification log record has new data for the page's prev page of PageID_ILLEGAL (0:1).

  • TEST is 'm_prevpage != PageId_ILLEGAL'.

  • VAL1 is 0.

  • VAL2 is 1.

State 101 and 111: A header modification log record has new data for the page's next page of PageID_ILLEGAL (0:1)

  • TEST is 'm_nextpage != PageId_ILLEGAL'

  • VAL1 is 0.

  • VAL2 is 1.

State 105: The persisted free space offset on the page after the last row is less than the position of the end of the last row.

  • TEST is 'max <= m_freeData'.

  • VAL1 is the position of the end of the last row ('max').

  • VAL2 is the persisted free space offset ('m_freeData').

State 106: The persisted free space count on the page is not equal to the actual count of free space.

  • TEST is 'm_freeCnt == freeCnt'.

  • VAL1 is the persisted free space count ('m_freeCnt').

  • VAL2 is the actual free space count ('freeCnt').

State 107: The persisted free space offset on the page is inside the slot offset table at the end of the page.

  • TEST is 'm_freeData <= PAGEHEADSIZE + (DataSize + 1 * sizeof(Slot) – sizeof(Slot) * m_slotCnt)'.

  • VAL1 is the persisted free space offset('m_freeData').

  • VAL2 is the start of the slot offset array (value of right-hand expression in TEST).

State 108: The HAS_FREESLOT bit is clear but the empty slot count is non-zero.

  • TEST is 'emptySlotCnt == 0'.

  • VAL1 is the empty slot count ('emptySlotCnt').

  • VAL2 is 0.
Action

HARDWARE FAILURE

Run hardware diagnostics and correct any problems. Also examine the Microsoft® Windows NT® system and application logs and the SQL Server™ error log to see if the error occurred as the result of hardware failure. Fix any hardware related problems.

If you have persistent data corruption problems, try to swap out different hardware components to isolate the problem. Check to ensure that your system does not have write caching enabled on the disk controller. If you suspect this to be the problem, contact your hardware vendor.

Finally, you might find it beneficial to switch to a completely new hardware system, including reformatting the disk drives and reinstalling the operating system.

RESTORE FROM BACKUP

If the problem is not hardware related and a known clean backup is available, restore the database from the backup. 

DBCC CHECKDB

If no clean backup is available, execute DBCC CHECKDB without a repair clause to determine the extent of the corruption. DBCC CHECKDB will recommend a repair clause to use. Then, execute DBCC CHECKDB with the appropriate repair clause to repair the corruption.

Caution  If you are unsure what effect DBCC CHECKDB with a repair clause has on your data, contact your primary support provider before executing this statement.

The repair depends on the type of page (see error 8938 for a list of page types):

Any type of page with a NULL page ID:

  • De-allocate the page and rebuild any index the page was part of.

Any non-allocation page:

  • De-allocate the page and rebuild any index the page was part of.

GAM, SGAM, or ML_MAP_PAGE page (if the undocumented repair option is used):

  • Re-format and rebuild the page.

DIFF_MAP_PAGE page:

  • Re-format the page and clear the bitmap.

  • Set the database as having no full backup, preventing differential backups until one is taken.

PFS_PAGE page and all other allocation pages:

  • No repair possible.

Caution  This repair may cause data loss.

If running DBCC CHECKDB with one of the repair clauses does not correct the problem, contact your primary support provider.

See Also

Error 8938

DBCC CHECKDB

Errors 8000 - 8999

Reporting Errors to Your Primary Support Provider

Page view tracker