![]() |
Database »
SQL Reporting Services »
General
Advanced
How to Restore SQL Server 2005 Suspect DatabaseBy Suvendu BanikHow to Restore SQL Server 2005 Suspect Database |
SQL, Windows, Visual Studio, SQL 2005, DBA, Dev
|
||||||||||
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
If your project's 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.
Your Database is in Suspect Mode. I Guess, you haven't experienced this problem till now. But, if it comes to you and if the database is in LIVE, then its time to read this article to get out of this tension.
If you find your Database in Suspect mode then please keep your nerve strong. Just proceed step by step what I am written bellow. I think you will get out of this trouble. SQL Server 2005 introduced a new DB Status called Emergency. This mode can change the DB from Suspect mode to Emergency mode, so that you can retrieve the data in read only mode. The steps are... After executing the script given below you will get back your Database in operational mode. Actually I have tried with two of my existing live system and found no data loss.
Note: Obviously there is two more option available. run REPAIR_ALLOW_DATA_LOSS to ensure the database is returned to a structurally and transitionally consistent state. Here are a few things to bear in mind about emergency mode repair: it's a one-way operation. Anything it does cannot be rolled back or undone. If this worries you (if someone ever got into that state then surely don't have the healthy concern about data that should have in the first place) then make a copy of the damaged database before you run emergency mode repair.
as its a one-way operation, you cannot wrap it in an explicit user-transaction.
it's the only repair option available in emergency mode - if you try to use REPAIR_REBUILD then it won't work.
Points of Interest You will be happy that your database is still in workable condition as well as the application:)
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
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 13 Sep 2007 Editor: |
Copyright 2007 by Suvendu Banik Everything else Copyright © CodeProject, 1999-2009 Web19 | Advertise on the Code Project |