0

I have a corrupt database. The last known good backup was over 2 weeks ago. I've run a CHECKDB and have the page numbers where SQL Server located the corruption. I've looked at the data on the pages before and after the corrupt pages using DBCC PAGE and I am certain that the corrupt data is contained to a single day back in 2013. The last known good backup, only being 2 weeks old, will have that day from 2013 on clean pages.

My plan is this:

  1. Restore last known good backup to a new database.

  2. Run DBCC CHECKDB (corrupt_database, REPAIR_ALLOW_DATA_LOSS) on the corrupt database and let it correct the issue.

  3. Insert the deleted records back into the old database from the new database.

I'm afraid of running REPAIR_ALLOW_DATA_LOSS because everything I've read online says it should be used as a last resort. I'm not sure exactly what it will affect. If it deletes pages, will it only touch the pages that CHECKDB found as corrupt?

But...If REPAIR_ALLOW_DATA_LOSS removes those corrupt pages, but I know what data I will lose, can I not just restore the backup to a new database and insert the data that was deleted in the old database? I hope I'm making sense.

Please let me know your thoughts.

1 Answer 1

1

Yes, if you know what data to insert after corrupt data pages are deleted, you should be fine.

make sure you find out the root of corruption to prevent it from happening.

also, once everything is fixed, then do a full back and restore it on a different server to make sure everything is fine.

Your plan sounds good to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.