REPAIRING A corrupt sql database

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

Who is Participating?
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
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.
Raja Jegan RSQL Server DBA & ArchitectCommented:
david_32Author Commented:
Sorry .... question was a bit vague.

Microsoft recommends restoring from backup rather than dbcc checkdb

why is that?
david_32Author Commented:
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 :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.