讀取 MDF 文件失敗,原因為 15105
我們的一個數據庫的日誌傳送備份作業失敗並顯示錯誤消息:
讀取“D:\Data\Filename.mdf”失敗:1(無法檢索此錯誤的文本。原因:15105)
嘗試不按計劃執行作業(以查看是否收集任何其他數據)會導致失敗並顯示相同的消息。
此消息的原因是什麼,我將如何解決?
Select @@VERSION
:Microsoft SQL Server 2008 R2 (SP3) - 10.50.6220.0 (X64) 2015 年 3 月 19 日 12:32:14 版權所有 (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)
數據庫兼容級別:SQL Server 2008 (100)
恢復模式:批量記錄
DBCC CHECKDB 的結果:
DBCC CHECKDB ('DatabaseName') WITH PHYSICAL_ONLY
報告:DBCC results for 'DatabaseName'. Msg 8966, Level 16, State 2, Line 1 Unable to read and latch page (1:2112497) with latch type SH. 1(failed to retrieve text for this error. Reason: 15105) failed. Msg 8966, Level 16, State 2, Line 1 Unable to read and latch page (1:2112498) with latch type SH. 1(failed to retrieve text for this error. Reason: 15105) failed. Msg 8966, Level 16, State 2, Line 1 Unable to read and latch page (1:2112499) with latch type SH. 1(failed to retrieve text for this error. Reason: 15105) failed. Msg 8966, Level 16, State 2, Line 1 Unable to read and latch page (1:2112500) with latch type SH. 1(failed to retrieve text for this error. Reason: 15105) failed. CHECKDB found 0 allocation errors and 4 consistency errors not associated with any single object. Msg 2533, Level 16, State 1, Line 1 Table error: page (1:2112497) allocated to object ID 557349150, index ID 1, partition ID 72057601138884608, alloc unit ID 72057601177681920 (type In-row data) was not seen. The page may be invalid or may have an incorrect alloc unit ID in its header. Msg 2533, Level 16, State 1, Line 1 Table error: page (1:2112498) allocated to object ID 557349150, index ID 1, partition ID 72057601138884608, alloc unit ID 72057601177681920 (type In-row data) was not seen. The page may be invalid or may have an incorrect alloc unit ID in its header. Msg 2533, Level 16, State 1, Line 1 Table error: page (1:2112499) allocated to object ID 557349150, index ID 1, partition ID 72057601138884608, alloc unit ID 72057601177681920 (type In-row data) was not seen. The page may be invalid or may have an incorrect alloc unit ID in its header. Msg 2533, Level 16, State 1, Line 1 Table error: page (1:2112500) allocated to object ID 557349150, index ID 1, partition ID 72057601138884608, alloc unit ID 72057601177681920 (type In-row data) was not seen. The page may be invalid or may have an incorrect alloc unit ID in its header. CHECKDB found 0 allocation errors and 4 consistency errors in table 'schemaname.tablename' (object ID 557349150). CHECKDB found 0 allocation errors and 8 consistency errors in database 'DatabaseName'. repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (DatabaseName). DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKDB 在表“schemaname.tablename”(對象 ID 557349150)中發現 0 個分配錯誤和 4 個一致性錯誤。repair_allow_data_loss 是 DBCC CHECKDB (DatabaseName) 發現的錯誤的最低修復級別。
您的數據庫中存在損壞,因此備份作業失敗,我認為帳戶權限與您的問題無關。我還可以看到損壞有點嚴重,並且 checkdb 中止了一些內部檢查。
表錯誤:頁面 (1:2112497) 分配給對象 ID 557349150,索引 ID 1,分區 ID 72057601138884608,分配單元 ID 72057601177681920(行內數據類型)
損壞指出表具有聚集索引,因此在表上刪除和重新創建索引無濟於事
解決方案:
我看到的解決方案是從乾淨的備份中恢復數據庫。如果您對備份第一次執行有疑問,
restore verifyonly
看看它是否返回backup set is valid
,如果沒有,您將不得不嘗試其他備份集。您也可以嘗試使用
continue after error
子句備份數據庫,看看您是否幸運。如果您是他們使用相同的子句在其他伺服器上恢復備份並執行dbcc checkdb (db_name) repair_allow_data_loss
以檢查您可以失去多少數據。記住 repair_allow_data_loss 應該是最後的手段。僅在您無法恢復數據時使用。您還可以嘗試一些第三方數據恢復解決方案。我沒有嘗試過,所以我不能推荐一個。