用工具检测显示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,恢复可以打的表数据。

相关文章:

  • 2022-12-23
  • 2022-03-04
  • 2021-11-11
  • 2022-12-23
  • 2021-12-09
  • 2021-11-24
  • 2021-06-29
猜你喜欢
  • 2021-11-25
  • 2021-06-06
  • 2021-07-30
  • 2021-07-11
  • 2021-09-02
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案