Tuesday 21 February 2012

Recovering Suspect Database

 

 

Everyone knows that, how much pain it is when a LIVE database is marked as suspect and especially there is no latest backup of the database.

What Happened when a data base is marked as Suspect:

If your LIVE database is in suspect mode, then no transaction will take place until and unless you repair your database. That causes a show stopper for your up and running application. Here, you will find a way to get out of this.

So, What the Solutions:

In this article, I am going to illustrate some T-SQL statements that can help you in case of suspect database marked.

EXEC sp_resetstatus 'YourDBName'

GO

ALTER DATABASE YourDBName SET EMERGENCY

DBCC checkdb('YourDBName')

ALTER DATABASE DBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE

DBCC CheckDB ('YourDBName', REPAIR_ALLOW_DATA_LOSS)

ALTER DATABASE YourDBName SET MULTI_USER

 

GO

/*

 Rebuild the index is necessay

*/

 

ALTER INDEX ALL ON [ TableName] REBUILD

Hope the information of this article is quite informative and thanking you to provide your valuable time on it.

 

Posted by: MR. JOYDEEP DAS

 

 

 

 

No comments:

Post a Comment