Tuesday 10 January 2012

Query for recovering a suspected database


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
Note:Query is Repair_allow_data_loss means some of your data may loose so extra care need to given while executing the query

No comments:

Post a Comment

Please Leave Your Comment here

You Might also like this

Related Posts Plugin for WordPress, Blogger...