How to recover a suspect database on MS SQL 2005

by 4:38 PM 90 comments
We had a largeish DB server corrupt a disk and in the process cause one of the databases to become suspect.

This can be resolved by running the following:

EXEC sp_resetstatus 'DBName'
GO
ALTER DATABASE DBName SET EMERGENCY
DBCC checkdb('DBname')
ALTER DATABASE DBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('DBName', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE DBName SET MULTI_USER

GO

From: http://blogs.microsoft.co.il/blogs/dbaces/archive/2008/12/28/how-to-repair-sql-server-2005-suspect-database.aspx

However we had a database with a hyphen in the name eg: data-base-name

To get around this use " " around the data-base-name eg:


EXEC sp_resetstatus 'data-base-name'
GO
ALTER DATABASE "data-base-name" SET EMERGENCY
DBCC checkdb('data-base-name')
ALTER DATABASE "data-base-name" SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('data-base-name', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE "data-base-name" SET MULTI_USER

GO

90 comments:

  1. Check the following link http://www.mytechmantra.com/LearnSQLServer/Repair_Suspect_Database_P1.html

    ReplyDelete
  2. Thanks Paul for the information about MySQL. Pretty useful and easily understandable

    Dot Net Training in Chennai | ASP.NET Training in Chennai

    ReplyDelete
  3. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    DevOps Training in Chennai

    ReplyDelete
  4. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Click here:
    angularjs training in chennai
    Click here:
    angularjs2 training in chennai
    Click here:
    angularjs4 Training in Chennai

    ReplyDelete
  5. Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
    Click here:
    Microsoft azure training in btm
    Click here:
    Microsoft azure training in rajajinagar

    ReplyDelete
  6. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Blueprism training in Chennai

    Blueprism training in Bangalore

    Blueprism training in Pune

    Blueprism online training

    Blueprism training in tambaram

    ReplyDelete
  7. The knowledge of technology you have been sharing thorough this post is very much helpful to develop new idea. here by i also want to share this.
    Devops training in sholinganallur

    ReplyDelete
  8. Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

    best rpa training in chennai |
    rpa training in chennai |
    rpa training in bangalore
    rpa training in pune | rpa online training

    ReplyDelete
  9. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
    Data Science Training in Chennai | Data Science course in anna nagar
    Data Science course in chennai | Data science course in Bangalore
    Data Science course in marathahalli | Data Science course in btm

    ReplyDelete
  10. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.


    Best AWS Training in Marathahalli | AWS Training in Marathahalli

    Amazon Web Services Training in Anna Nagar, Chennai |Best AWS Training in Anna Nagar, Chennai

    AWS Training in Velachery | Best AWS Course in Velachery,Chennai

    Best AWS Training in Chennai | AWS Training Institutes |Chennai,Velachery

    ReplyDelete
  11. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...

    Article submission sites
    Technology

    ReplyDelete
  12. Such an informative blog that i have red yet.I hope the data you gave is helpful for the students.i have read it very interesting information's.
    Java Training in Bangalore
    Java Training in Nolambur
    Java Courses in Saidapet
    Java Training in Padur

    ReplyDelete
  13. Good Job, nice work and efforts. Your content is very interesting and I like that. I want a lot of info from your post...
    Ethical Hacking Course in Chennai
    Hacking Course in Chennai
    Certified Ethical Hacking Course in Chennai
    Ethical Hacking Training in Chennai

    ReplyDelete
  14. Thank you for your amazing article! Absolutely it's very great concept and very attractive to readers. I like to additional information from your blog...
    Spoken English Classes in Chennai
    Best Spoken English Classes in Chennai
    Spoken English Class in Chennai
    Spoken English in Chennai
    Best Spoken English Class in Chennai

    ReplyDelete
  15. You sit and think how to earn? Come to us and get your first win best online slots Play and always win.

    ReplyDelete
  16. You are doing a great job. I would like to appreciate your work for good accuracy
    Regards,
    Best Devops Training in Chennai | Best Devops Training Institute in Chennai

    ReplyDelete
  17. У нас есть светодиодная лента цена которой выше или ниже рыночной в зависимости от того что вы ищете, дешевую или дорогую.

    ReplyDelete
  18. I found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing..
    Devops Training in Chennai | Devops Training Institute in Chennai

    ReplyDelete
  19. Excellent blog, I wish to share your post with my folks circle. It’s really helped me a lot, so keep sharing post like this
    angularjs online training

    apache spark online training

    informatica mdm online training

    devops online training

    aws online training

    ReplyDelete
  20. This is a good post. This post give truly quality information. I’m definitely going to look into it. Really very useful tips are provided here. thank you so much. Keep up the good works.
    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training

    ReplyDelete
  21. Interesting information and attractive.This blog is really rocking... Yes, the post is very interesting and I really like it.I never seen articles like this. I meant it's so knowledgeable, informative, and good looking site. I appreciate your hard work. Good job.
    Kindly visit us @
    Sathya Online Shopping
    Online AC Price | Air Conditioner Online | AC Offers Online | AC Online Shopping
    Inverter AC | Best Inverter AC | Inverter Split AC
    Buy Split AC Online | Best Split AC | Split AC Online
    LED TV Sale | Buy LED TV Online | Smart LED TV | LED TV Price
    Laptop Price | Laptops for Sale | Buy Laptop | Buy Laptop Online
    Full HD TV Price | LED HD TV Price
    Buy Ultra HD TV | Buy Ultra HD TV Online
    Buy Mobile Online | Buy Smartphone Online in India

    ReplyDelete
  22. to protect the data base and data recovery it is better to have sql online training

    ReplyDelete
  23. Python Training in Chennaii

    Excellent blog with lots of information. I have to thank for this. Do share more.

    ReplyDelete
  24. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it.
    tree stump removal lantana

    ReplyDelete
  25. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..
    dumpster rental lexington

    ReplyDelete
  26. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post.septic tank pumping lexington

    ReplyDelete
  27. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..
    tree trimming companies asheville

    ReplyDelete
  28. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..
    dumpster rental cost montgomery

    ReplyDelete
  29. I think this is one of the most significant information for me. And i’m glad reading your article. septic tank cleaning montgomery

    ReplyDelete
  30. Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject?
    residential tree services springfield

    ReplyDelete
  31. This post is good enough to make somebody understand this amazing thing, and I’m sure everyone will appreciate this interesting things.drain cleaning service jonesboro

    ReplyDelete
  32. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post.

    ReplyDelete
  33. Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject?
    emergency tree services little rock

    ReplyDelete
  34. I have read your article, it is very informative and helpful for me.I admire the valuable information you offer in your articles. Thanks for posting it..junk hauling services beaumont

    ReplyDelete
  35. A superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place. grease trap pumping service beaumont

    ReplyDelete
  36. Hi, This is a nice article you shared great information i have read it thanks for giving such a wonderful blog for the reader. stump grinding corpus christi

    ReplyDelete
  37. You have a good point here!I totally agree with what you have said!! Thanks for sharing your views. hope more people will read this article!!! dumpster rental services lubbock

    ReplyDelete
  38. I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people. Thanks for sharing the information keep updating, looking forward to more posts.
    High Quality Adult Images

    ReplyDelete
  39. keep up the good work. this is an Assam post. this to helpful, i have reading here all post. i am impressed. thank you. this is our digital marketing training center. This is an online certificate course
    digital marketing training in bangalore | https://www.excelr.com/digital-marketing-training-in-bangalore

    ReplyDelete
  40. If you are interested in business directory or want data provider. We also provide sales automation crm and marketing automation software. If you are interested, then please contact us for detailed information.

    ReplyDelete
  41. Tally Course | Tally Institute

    Excellent blog with lots of information. I have to thank for this. Do share more.

    ReplyDelete
  42. Tally Course | Tally Institute

    I am glad that I have visited this blog. Really helpful, eagerly waiting for more updates.

    ReplyDelete