Showing posts with label Steps to recover MS SQL-server Database from suspect mode:. Show all posts
Showing posts with label Steps to recover MS SQL-server Database from suspect mode:. Show all posts

Thursday, December 24, 2009

MS SQL-Server, Recover Database from suspect Mode

Steps to recover MS SQL-server Database from "suspect "mode:
EXEC sp_resetstatus 'DatabaseName';
ALTER DATABASE DatabaseName SET EMERGENCY
DBCC checkdb('DatabaseName')
DBCC CHECKCATALOG('DatabaseName')
ALTER DATABASE DatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('DatabaseName', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE DatabaseName SET MULTI_USER
ALTER DATABASE DatabaseName SET ONLINE;