日期:2014-05-18 浏览次数:20724 次
user master
go
--Step1:允许多系统目录进行直接修改
exec sp_configure 'allow updates',1
reconfigure with override
--Step2:将新建同名库置为紧急状态
update master.dbo.sysdatabases set status=32768 where name='数据库名'
--Setp3:重建日志文件
dbcc rebuild_log('数据库名', '日志文件') --注:“日志文件”包括全路径
--Step4:恢复数据库状态
update master.dbo.sysdatabases set status=16 where name='数据库名'
--Step5:不允许多系统目录进行直接修改
exec sp_configure 'allow updates',0
reconfigure with override