我的数据库处于简单恢复模式。一页损坏,我只有使用简单备份创建的备份。
当我运行这个:
DBCC PAGE ('myDB', 1, 952663, 3)
我得到:
DBCC PAGE error: Invalid page type - dump style 3 not possible.
SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:952663; actual 2668:-1594740640). It occurred during a read of page (1:952663) in database ID 5 at offset
Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID -1, partition ID 0, alloc unit ID 332114207834112 (type Unknown), page ID (1:952663) contains an incorrect page ID in its page header. The PageId in the page header = (2668:-1594740640).
CHECKDB found 0 allocation errors and 1 consistency errors not associated with any single object.
Msg 8928, Level 16, State 1, Line 1
Object ID 1131971209, index ID 1, partition ID 72057595034861568, alloc unit ID 72057595204796416 (type In-row data): Page (1:952663) could not be processed. See other errors for details.
Msg 8976, Level 16, State 1, Line 1
Table error: Object ID 1131971209, index ID 1, partition ID 72057595034861568, alloc unit ID 72057595204796416 (type In-row data). Page (1:952663) was not seen in the scan although its parent (1:1616550) and previous (1:2296409) refer to it. Check any previous errors.
Msg 8978, Level 16, State 1, Line 1
Table error: Object ID 1131971209, index ID 1, partition ID 72057595034861568, alloc unit ID 72057595204796416 (type In-row data). Page (1:1743775) is missing a reference from previous page (1:952663). Possible chain linkage problem.
Msg 2511, Level 16, State 1, Line 1
Table error: Object ID 1131971209, index ID 25, partition ID 72057595034796032, alloc unit ID 72057595204730880 (type In-row data). Keys out of order on page (1:3474431), slots 237 and 238.
CHECKDB found 0 allocation errors and 4 consistency errors in table 'TransactionEntry' (object ID 1131971209).
CHECKDB found 0 allocation errors and 5 consistency errors in database 'DsPointOfSale'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (DsPointOfSale).
我还能修复这个数据库吗?
所以是聚集索引受到影响。如果是我,我可能会尝试 DBCC PAGE ('myDB', 1, 952663, 2); 在恢复的备份和损坏的数据库上,首先在 Winmerge 中查看和比较,看看我是否可以从中推断出任何东西(例如,如果两者非常相似但只是页眉中有一些损坏,那么您可以在恢复的样式上使用带有样式 3 的 DBCC DB 可以很好地了解在 REPAIR_ALLOW_DATA_LOSS 之后要恢复的特定行。否则,您只需要在两个表之间进行数据比较,然后尝试看看是否可以找出需要以这种方式恢复的行。- Martin Smith