How to recover a suspect database on MS SQL 2005

by 4:38 PM 88 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

88 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. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. to protect the data base and data recovery it is better to have sql online training

    ReplyDelete
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. I think this is one of the most significant information for me. And i’m glad reading your article. septic tank cleaning montgomery

    ReplyDelete
  20. 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
  21. 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
  22. This is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post.

    ReplyDelete
  23. 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
  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..junk hauling services beaumont

    ReplyDelete
  25. 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
  26. 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
  27. 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
  28. Thanks for this valuable information..


    https://www.acte.in/angular-js-training-in-chennai
    https://www.acte.in/angular-js-training-in-annanagar
    https://www.acte.in/angular-js-training-in-omr
    https://www.acte.in/angular-js-training-in-porur
    https://www.acte.in/angular-js-training-in-tambaram
    https://www.acte.in/angular-js-training-in-velachery

    ReplyDelete
  29. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information.

    AngularJS training in chennai | AngularJS training in anna nagar | AngularJS training in omr | AngularJS training in porur | AngularJS training in tambaram | AngularJS training in velachery



    ReplyDelete
  30. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    python training in chennai

    python online training in chennai

    python training in bangalore

    python training in hyderabad

    python online training

    python flask training

    python flask online training

    python training in coimbatore



    ReplyDelete
  31. Tally Course | Tally Institutei

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

    ReplyDelete
  32. best spoken english class in chennai
    Learn Spoken English from Native English Teachers. Our Unique Approach is 6X Faster than any other Teaching Method. Improve in Weeks!

    ReplyDelete
  33. best interiors in chennai
    Looking for Best Interior Designers in Chennai? Read the Top 10 Interior Designers in Chennai Reviews & Choose the right Interior Decorator

    ReplyDelete
  34. rpa interview questions
    Important RPA Interview Questions and Answers for freshers and experienced to get your dream job in RPA! Basic & Advanced RPA Interview Questions for Freshers & Experienced.

    ReplyDelete
  35. ethical hacking technical interview questions
    Important Ethical Hacking Interview Questions and Answers for freshers and experienced to get your dream job & Advanced Ethical Hacking Interview Questions for Freshers & Experienced.

    ReplyDelete
  36. Though it is said that the admins are doing thorough checks before performing bulk updates for records. It is not an unusual happening that one may encounter duplicate files or incorrectly updated fields. This process can at the end make your data ineffective. Salesforce training in Hyderabad

    ReplyDelete
  37. Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.

    Angular js Training in Chennai

    Angular js Training in Velachery

    Angular js Training in Tambaram

    Angular js Training in Porur

    Angular js Training in Omr

    Angular js Training in Annanagar


    ReplyDelete
  38. it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
    IELTS Coaching in chennai

    German Classes in Chennai

    GRE Coaching Classes in Chennai

    TOEFL Coaching in Chennai

    Spoken english classes in chennai | Communication training

    ReplyDelete
  39. thank you for the information provided, we are waiting for the next info

    ReplyDelete
  40. Nice blog, yours solution are good. Thanks for sharing these solution with all of us. whatsapp mod

    ReplyDelete
  41. Thanks for the detailed article on this topic. I would like to see more such awesome articles from you.

    ReplyDelete
  42. It might maintain to come into the dispensation into it and prepare the music to run. It gives you full convenience for data from one records site. https://crackdj.com/rekordbox-dj-crack/

    ReplyDelete
  43. Malwarebytes Premium Crack Key is a best Anti-malware software.This software provides businesses with full attack chain protection against. Malwarebytes Anti Malware Free Download Full Version With Crack

    ReplyDelete
  44. I promise to be your love and love you forever, no matter the challenges I will always be with you. Good morning baby! Love Husband Good Morning

    ReplyDelete
  45. Excellent Content. I enjoy how you present. Continue to impart more information.

    ReplyDelete
  46. Thank you for sharing this insightful blog post. I found it to be informative. The points you've raised are both relevant and well-researched. Visit to AWS Classes in Pune

    ReplyDelete