REPAIRING A corrupt sql database

Posted on 2009-02-12
Last Modified: 2012-05-06
Hi Folks,

I was just looking at the documentation for dbcc checkdb and I took notice of the REPAIR OPTIONS. It recommends that to repair errors you should restore from backup. To my way of thinking that would defeat the purpose of running the command anyway. If the db was corrupt wouldn't restoring from a good backup fix all your problems anyway? Is there any good doco on this?

Kind Regards

Question by:david_32
    LVL 57

    Expert Comment

    by:Raja Jegan R

    Author Comment

    Sorry .... question was a bit vague.

    Microsoft recommends restoring from backup rather than dbcc checkdb

    why is that?
    LVL 57

    Accepted Solution

    Yes.. Even I suggest you to go for Backup if your Backup file is not corrupt. As your Backup file is corrupt, I have suggested that option because using dbcc checkdb, you can fix those errors (either by losing some records or by skipping the error records).

    Restoring through DBCC has the following demerits (explained in more detail in the link which you provided)

    DBCC CHECKDB does not examine disabled indexes
    executing DBCC CHECKDB clears the plan cache for the instance of SQL Server.

    Author Closing Comment

    thanks - I didn't know that it clears the plan cache as well - that helped me with another issue I am having - you should get double points :)

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now