sql2000数据库在企业管理器中显示置疑(suspect),在查询分析器不显示。在企业管理器中附加:提示错误823

用工具检测显示mdf文件有20多万页出错:mdf文件损坏。
注:数据库没有分离,步骤1右省略
1,新建同名数据库(文件名,文件组和原来的都一样),然后停止数据库服务,用原来的文件替换新建的数据库,启动数据库,则数据库显示为置疑。
2,把数据库改为紧急模式:
sp_configure 'allow',1
reconfigure with override
update sysdatabases set status=32768 where name='数据库名'
3,重建ldf,把ldf改名,
dbcc rebuild_log('数据库名','E:\database\aa_log.ldf')
4,恢复数据库模式:
update sysdatabases set status=0 where name='数据库名'
执行
restore database 数据库名 with recovery
sp_configure 'allow',0
reconfigure with override
5,用dbcc checkdb ('数据库名'),看看没有错误
6,发现有十一个表已经不能查询
7,恢复可以打的表数据。
原文地址:https://www.cnblogs.com/noahsky/p/1355402.html