1.停掉服务,建立先将mdf保存到别处,然后重新服务
2.建立新的数据库。
3.用刚刚保存到别处的mdf文件来替换新建数据库的mdf文件
4.会看到数据处于置疑状态
5.进入紧急模式:
use master
go
sp_configure 'allow updates',1
go
reconfigure with override
go
update sysdatabases set status=-32768 where dbid=DB_ID('置疑数据库名称')
6.用dbcc rebuild_log('置疑数据库名称','d:\置疑数据库名称.ldf')恢复日志
7.运行dbcc checkdb('置疑数据库名称')
8.sp_dboption '置疑数据库名称','dbo use only','false' 恢复正常状态
9.
sp_configure 'allow updates',0
go
reconfigure with override
go
2.建立新的数据库。
3.用刚刚保存到别处的mdf文件来替换新建数据库的mdf文件
4.会看到数据处于置疑状态
5.进入紧急模式:
use master
go
sp_configure 'allow updates',1
go
reconfigure with override
go
update sysdatabases set status=-32768 where dbid=DB_ID('置疑数据库名称')
6.用dbcc rebuild_log('置疑数据库名称','d:\置疑数据库名称.ldf')恢复日志
7.运行dbcc checkdb('置疑数据库名称')
8.sp_dboption '置疑数据库名称','dbo use only','false' 恢复正常状态
9.
sp_configure 'allow updates',0
go
reconfigure with override
go
浙公网安备 33010602011771号