Repair of a suspect SQL DB
Found myself needing to repair a suspect SQL db. A really nice post here listed the following commands:
EXEC sp_resetstatus ‘yourDBname’;
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb(‘yourDBname’)
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (‘yourDBname’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER
I tried them and it recovered my DB! Excellent post, thank you Manoj!
Leave a Reply