首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >恢复到Server 2017后失败

恢复到Server 2017后失败
EN

Database Administration用户
提问于 2018-06-12 11:10:05
回答 1查看 592关注 0票数 1

Server 2014上有数据库,在Server 2017上还原备份后,在运行CHECKDB时会得到完整性检查错误。当我用Server 2014在另一台计算机上还原它时,它可以在没有CHECKDB报告错误的情况下工作。我需要将数据库迁移到较新的服务器,这样我仍然可以根据自己的需要进行更新。

CHECKDB错误:

代码语言:javascript
运行
复制
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1737) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1738) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1739) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1740) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1741) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1742) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
Msg 8948, Level 16, State 6, Line 5
Database error: Page (1:1743) is marked with the wrong type in PFS page (1:1). PFS status 0x40 expected 0x60.
CHECKDB found 7 allocation errors and 0 consistency errors not associated with any single object.
CHECKDB found 7 allocation errors and 0 consistency errors in database 'DBNAME'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (DBNAME).
EN

回答 1

Database Administration用户

回答已采纳

发布于 2018-06-12 12:41:21

通过运行以下命令,您可以找到这些页面属于哪个对象(S):

代码语言:javascript
运行
复制
SELECT s.name, o.name, a.index_id
FROM sys.schemas AS s
INNER JOIN sys.objects AS o
ON s.[schema_id] = o.[schema_id]
CROSS APPLY sys.dm_db_database_page_allocations
  (DB_ID(N'DBNAME'),o.[object_id],NULL,NULL,N'LIMITED') AS a
WHERE allocated_page_page_id BETWEEN 1737 AND 1743;

您可以尝试重新构建该索引(如果index_id为0或null,则重新构建表),以查看该索引是否解决了分配问题。如果它仍然存在,您可以尝试删除索引并重新创建它,或者再次尝试,如果它是一个表或堆,选择新表中的所有内容,在那里创建新索引,删除旧表,并重新命名新表。

如果这没有帮助,您可以检查这些页面的内容,并确定是否可以接受在升级过程中丢失数据(或者,如果不是,则不升级)。

代码语言:javascript
运行
复制
DBCC TRACEON(3604,-1);
DBCC PAGE(N'DBNAME', 1, 1737, 2);
DBCC PAGE(N'DBNAME', 1, 1738, 2);
DBCC PAGE(N'DBNAME', 1, 1739, 2);
...

如果这是一个可以接受的损失,那么您可以按照建议使用允许数据丢失来运行修复(如果您需要以某种方式从这些页面中提取数据,那么在修复之前保留备份副本可能是明智的)。

票数 2
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/209388

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档