Skip to content

Corruption

SQL Server Database Corruption Repair

Database corruption repair with SQL Server is one of those things that you generally don’t see every day, but as a DBA, you are expected to be able to fix it quickly without any data loss. From the risk analysis matrix, it is one of those low frequency high impact scenarios that results in an extremely risky situation. This is one of those situations which could lead to great success, or massive failure depending on your training and skills.

These low frequency, high impact, high risk scenarios are the times that you need to rely on your training, or the training of someone more experienced in these areas.

Read More »SQL Server Database Corruption Repair

Solution to Week 10 Part 1 Database Corruption Challenge

If you are looking for more info on the corrupt database with Week 10 of the Database Corruption Challenge, you can take a look at the week 10 Challenge Details.

With this being the final competition of the Database Corruption Challenge, I had to make it more difficult than the others, so I added 3 different types of corruption. This challenge was about the equivalent of any 3 of the other challenges.

I have split the solution to the Week 10 Challenge into 3 different posts, with each post explaining how to fix one of the three specific corrupt areas.

Corruption in the Orders Table

WARNING: DBCC WritePage is a dangerous command, that should never be used on any production database. It may invalidate your ability to get support from Microsoft on issues that arise with that database going forward. It is not my intention to encourage anyone to use DBCC WritePage ever. This is just what I used to create a corrupt database, and since creating corrupt databases is not part of the role of most DBAs, you should not use DBCC WritePage. Consider yourself warned.

Read More »Solution to Week 10 Part 1 Database Corruption Challenge

Patrick Flynn Interview – Database Corruption Challenge

After 10 weeks (or almost weekly) of corrupt databases, missing data and a challenging competition the Database Corruption Challenge finally comes to an end. As part of the last week of the challenge I created a short blog interview for the participants. This interview is Patrick Flynn.

Patrick placed in third with a 3 way tie for third overall in the the Database Corruption Challenge scoring 21 points.

Here are the overall statistics for Patrick in the Database Corruption Challenge

Read More »Patrick Flynn Interview – Database Corruption Challenge

Neil Abrahams Interview – Database Corruption Challenge

After 10 weeks (or almost weekly) of corrupt databases, missing data and a challenging competition the Database Corruption Challenge finally comes to an end. As part of the last week of the challenge I created a short blog interview for the participants. This interview is Neil Abrahams.NeilAbrahams

Neil placed in third place with a 3 way tie for third overall in the the Database Corruption Challenge scoring 21 points. He was one of only 3 participants to complete all 10 challenges in the contest, the other two were André Kamman and Rob Farley.

Here are the overall statistics for Neil in the Database Corruption Challenge

Read More »Neil Abrahams Interview – Database Corruption Challenge

André Kamman Interview – Database Corruption Challenge

After 10 weeks (or almost weekly) of corrupt databases, missing data and a challenging competition the Database Corruption Challenge, finally comes to an end. As part of the last week of the challenge I created a short blog interview for the participants. This interview is André Kamman.

André placed second overall in the the Database Corruption Challenge scoring 22 points which pushed hiAndreKammanm above a 3 way tie for third place. He was one of only 3 participants to complete all 10 challenges in the contest, the other two were Rob Farley and Neil Abrahams.

Here are the overall statistics for André in the Database Corruption Challenge

Read More »André Kamman Interview – Database Corruption Challenge

Raul Gonzalez Interview – Database Corruption Challenge

After 10 weeks (or almost weekly) of corrupt databases, missing data and a challenging competition the Database Corruption Challenge, finally comes to an end. As part of the last week of the challenge I created a short blog interview for the participants. This interview is with Raul Gonzalez.

Raul placed third (in a tie) overall in the Database Corruption Challenge behind Rob Farley, and André Kamman. Raul Gonzalez Interview

Here are the statistics for Raul in the Database Corruption Challenge

Raul Gonzalez Interview

Read More »Raul Gonzalez Interview – Database Corruption Challenge

Rob Farley Interview – Database Corruption Challenge

After 10 weeks (or almost weekly) of corrupt databases, missing data and a challenging competition the Database Corruption Challenge, finally comes to an end. As part of the last week of the challenge I created a short blog interview for the participants.Rob Farley Interview

Rob Farley is the overall winner, the champion of the Database Corruption Challenge scoring more points than anyone else.  Congratulations Rob!

Rob was one of only 3 participants to complete all 10 challenges in the contest, the other two were André Kamman and Neil Abrahams.

Here are Robs statistics for the Database Corruption Challenge

Read More »Rob Farley Interview – Database Corruption Challenge

Announcing the Database Corruption Challenge Winners

Today I am proud to announce that the Database Corruption Challenge has come to an end. I would like to say that I have met some really great people during this contest and I look forward to seeing you at PASS Summit in October, or other conference someday.

The Corruption Challenge Winners

Grand Champion - Rob FarleyAfter 10 competitions Rob Farley is the overall Champion of the Challenge with 25 points. Rob won week 2, Week 8 and Week 10. I will get the winning solution posted to my blog in the next day or two for those who are wondering how this weeks challenge was won.

 

 

 

 

Here is the list of the top scoring participants, the top 10 will receive a limited edition prize t-shirt as their badge of honor for being the top scoring participants:

 

Read More »Announcing the Database Corruption Challenge Winners

SQL Server Tables – BTree or Linked List?

Is a clustered table in SQL Server a BTree or Linked List?

When you first learn about the structure behind clustered indexes in SQL Server, you find out that the clustered index is structured as a type of B+Tree where queries that make use of the tree structure to find the rows that you are looking for. However it is not the common belief that that table with the clustered index also happens to be a doubly linked list, and that the B+Tree can be completely skipped when running a query that uses the clustered index via a clustered index scan.

Take the following table and query as an example:

CREATE TABLE [dbo].[Orders](
	[id] [int] IDENTITY(-2147483647,1) NOT NULL,
	[orderDate] [DATETIME] NOT NULL,
	[customerId] [int] NULL,
	[shippingType] varchar(100),
	[orderDetails] varchar(max),
	[totalPrice] DECIMAL(12, 2)
	CONSTRAINT [PK_Revenue] PRIMARY KEY CLUSTERED ([id] ASC, [orderDate])
);

Then insert a bunch of rows, and run a query.

Read More »SQL Server Tables – BTree or Linked List?