question

Steve Jones - Editor avatar image
Steve Jones - Editor asked

What does DBCC CHECKDB with REPAIR_ALLOW_DATA_LOSS do?

I had some errors in my dbcc checkdb output. Can I safely run this again with the repair_allow_data_loss option? What does this do?

administrationdbcccorruption
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Christopher Klein avatar image
Christopher Klein answered

stolen from SQLTeam.com but;

1) I strongly advise not running repair if at all possible. The REPAIR_ALLOW_DATA_LOSS option is deliberately named that because it usually requires deleting data to obtain structural consistency of the database. Its far better to try to understand what the errors mean and the consequences of running repair are. The latest BOL update has full information for all errors that CHECKDB returns, including what repair will do. You should also strive to work out why these errors occured.

2) Running repair should be the last thing tried to recover from errors. Its always better to recover using up-to-date backups and/or extracting as much data as possible before running repair/restoring.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jonathan Kehayias avatar image
Jonathan Kehayias answered

I'd recommend reading Paul Randal's blog post that covers REPAIR_ALLOW_DATA_LOSS and what it does:

Corruption: Last Resorts that people try first...

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Wimbush avatar image David Wimbush commented ·
Yep, 'last resort' says it all, really.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.