详细步骤:
a. Change the database context to Master and allow updates to system tables:
Use Master
Go
sp_configure 'allow updates', 1
reconfigure with override
Go
b. Set the database in Emergency (bypass recovery) mode:
select * from sysdatabases where name = ''
-- note the value of the status column for later use
begin tran
update sysdatabases set status = 32768 where name = ''
-- Verify one row is updated before committing
commit tran
c. Stop and restart SQL server.
d. The syntax for DBCC REBUILD_LOG is as follows:
DBCC REBUILD_LOG('','')
Update master..sysdatabases set status = 0 where name = ‘’
go
sp_configure 'allow', 0
go
reconfigure with override
e. Set the database in single-user mode and run DBCC CHECKDB to validate physical
consistency:
-- Put database in single user mode and run CHECKDB.
sp_dboption '', 'single user', 'true'
DBCC CHECKDB('')
Go
-- Address any errors reported by CHECKDB.
-- Take the database out of single user mode.
sp_dboption '', 'single user', 'false'
f. Turn off the updates to system tables by using:
sp_configure 'allow updates', 0
reconfigure with override
Go
阅读(2341) | 评论(0) | 转发(0) |