Sql-Server-2016

DBCC 顯示損壞(測試數據庫),但可疑頁面未顯示任何內容

  • March 4, 2022

所以,我得到了一個損壞的數據庫。這是 DBCC:

Msg 8944, Level 16, State 13, Line 4
Table error: Object ID 2105058535, index ID 1, partition ID 72057594038845440, alloc unit ID 72057594039762944 (type In-row data), page (1:158), row 3. Test (ColumnOffsets <= (nextRec - pRec)) failed. Values are 3139 and 288.

Msg 8944, Level 16, State 13, Line 4
Table error: Object ID 2105058535, index ID 1, partition ID 72057594038845440, alloc unit ID 72057594039762944 (type In-row data), page (1:158), row 3. Test (ColumnOffsets <= (nextRec - pRec)) failed. Values are 3139 and 288.

Msg 8928, Level 16, State 1, Line 4
Object ID 2105058535, index ID 1, partition ID 72057594038845440, alloc unit ID 72057594039762944 (type In-row data): Page (1:158) could not be processed.  See other errors for details.

Msg 8976, Level 16, State 1, Line 4
Table error: Object ID 2105058535, index ID 1, partition ID 72057594038845440, alloc unit ID 72057594039762944 (type In-row data). Page (1:158) was not seen in the scan although its parent (1:159) and previous (1:156) refer to it. Check any previous errors.

偉大的。現在,如果我查詢 Suspect_Pages,我看不到任何問題信號:

在此處輸入圖像描述

我在這裡讀到 DBCC 擷取它並將其放入表中,但我不確定為什麼我在那裡看不到它。

https://www.stellarinfo.com/blog/monitor-sql-database-suspect-pages/

歸根結底-您的數據庫已損壞。儘管有 Suspect_Pages 表,但您有損壞。並且許多類型的損壞不會在那裡記錄條目 - 即便如此,它們也只會在某些情況下記錄在那裡。

無論那裡是否有條目 -必須處理腐敗。當您有可用的備份時,這必須快速發生。

如果您經常執行 checkdb,並使用充足的日誌備份歷史記錄以完全恢復模式維護您的數據庫,並且知道您的數據庫何時良好 - 恢復是最好的選擇。但是不要在決策過程中使用懷疑頁面中缺少的一行。

可疑頁面文件提到僅擷取了 823 和 824 錯誤:

每頁包含一行,因次要 823 錯誤或 824 錯誤而失敗。頁面在此表中列出是因為它們被懷疑是壞的,但它們實際上可能很好。修復可疑頁面時,其狀態會在 event_type 列中更新。

我建議您從文件開始作為權威的 SQL Server 參考。

引用自:https://dba.stackexchange.com/questions/308293