Skip to content

Corruption

Database Corruption Challenge Week 3 Results

Challeng3_RecoveryPending

It is my pleasure to announce the winners in the Week 3 Database Corruption Challenge. But first how about a rundown of challenge.

The challenge was issued at 10:00pm (pacific time) on Friday night. Yes, this was a difficult time for those on the East coast of the US, and if you are from EST, next week I promise the time will be better for you. Trying to switch up the times to give everyone across the planet a fair advantage. Those who had signed up for my Newsletter received early notification of when the corruption challenge would occur, but not details on what the challenge would be.

Once the challenge was issued, I received a couple of partial submissions, one contained the correct steps, but no results. The second one contained the right results, but was missing the steps to do it. The first correct submission that contained the steps, and proof that it was done correctly came in 37 minutes after the contest had started.  It was almost an hour later before the next winning solution was sent in.

Read More »Database Corruption Challenge Week 3 Results

Database Corruption Challenge Week 3 Approaching

After two great weeks of the database corruption challenge, week 3 is approaching. I have a few things to announce as we go into week 3.

The database corruption challenge will run over 10 weeks at which point another challenge will begin, and everyone will start out with a fresh score, sort of like bowling. This post I am going to cover scoring and prizes, just to keep it interesting.

Scoring the Challenge

I realized that I had never finalized the scoring of the competition. Here are the scoring criteria that I have come up with.

Read More »Database Corruption Challenge Week 3 Approaching

Database Corruption Challenge #2 – Alternate Solution

With week two of the Database Corruption Challenge being just as interesting as week one, and after seeing yesterdays blog posting showing the solution by Rob Farley, you might be thinking you are ready to take on corruption. If you are interested in giving the corruption challenge a try, please sign up for my newsletter so that you will be notified of the next corruption challenge.

Lets take a look at one of the more interesting solutions submitted by Bogdan Sahlean, who was the first to solve using DBCC Page to find the exact corrupt bytes, and DBCC WritePage to fix those corrupt bytes.

Now if you are reading this, and don’t know about DBCC WritePage, I caution you…  DBCC WritePage is not something you should just play with, and it is certainly not something that you should ever run on a production database. Consider yourself warned.  One of the dangers of using Write page that it’s use will make the DB unsupported if Microsoft support is required.

Read More »Database Corruption Challenge #2 – Alternate Solution

Database Corruption Challenge #2 Winners

It is my pleasure to announce this weeks winners in the Database Corruption Challenge – Week 2.

There were many great solutions submitted, and I hope that everyone learned something from this weeks challenge.

My favorite part of the whole challenge was this post on Twitter…

 

Foresight

 

The whole goal of the Database Corruption Challenge is to help everyone be better prepared for when they do encounter corruption.

Read More »Database Corruption Challenge #2 Winners

Difference Between TRUNCATE TABLE and DELETE FROM Table

Most DBAs know the usual difference between TRUNCATE and DELETE FROM, however one not so obvious difference between the two is how things are handled if the table is corrupt.

For instance, if you look at the corrupt database from the Database Corruption Challenge Week 1, you see the following

DeleteVsTruncate1

If you want to clear out the corrupt Revenue table, one way to attempt to do it is with a DELETE statement like this.

Read More »Difference Between TRUNCATE TABLE and DELETE FROM Table

Corruption Challenge 1 – An alternative solution

After posting the winning solution for Corruption Challenge 1 from Brent Ozar, I realized that he and I both solved the corruption by using the REPAIR_ALLOW_DATA_LOSS option on CheckDb. A very nasty move, however it did repair the corruption.


DBCC CHECKDB ('',REPAIR_ALLOW_DATA_LOSS);

 

After reading some feedback, one of the winners stated:

As soon as he ran REPAIR_ALLOW_DATA_LOSS, I knew we weren’t on the same page. I just never do that unless I’ve exhausted all the other options.

Which is a good point, in this solution I was fairly certain as to what REPAIR_ALLOW_DATA_LOSS was going to do, however in a real world scenario, who knows what might be effected beyond the initial table that we know about.

There are several other options to clean up the corrupt table besides the REPAIR_ALLOW_DATA_LOSS option. These options still involve copying the data off to another table and finding the missing data from row 31, however how the corruption gets cleaned up varies widely with the following options:

Read More »Corruption Challenge 1 – An alternative solution