Skip to content

Corruption

DBCC CheckDB and CheckTable doesn’t check In-Memory OLTP.

Special thanks to my friend Theresa Iserman for introducing me to Jos de Bruijn the Senior Program Manager for the In Memory OLTP (Hekaton) project to help get my questions answered at PASS Summit.

So, the Hekaton – In Memory OLTP tables are perhaps one of the most amazing performance improvements to SQL OLTP in a long time. The way that they are managing data with no latches, locks or spinlocks is awesome, and the performance gains are great.

However in a recent session at Pass Summit 2016 with Bob Ward, I followed up with a question on CheckDB and In Memory OLTP tables. Since the data for these are not store in the normal SQL Server data files or even in regular pages. Bob confirmed that CheckDB (and CheckTable) does not check the data associated with the In Memory OLTP tables. I even confirmed this from Books Online in a post called “Transact SQL Constructs Not Supported by In-Memory OLTP” which stated the following:

  • DBCC CHECKDB skips the memory-optimized tables in the database.
  • DBCC CHECKTABLE will fail for memory-optimized tables.

Read More »DBCC CheckDB and CheckTable doesn’t check In-Memory OLTP.

When Database Corruption Strikes – Summit 2016

Today I had the pleasure presenting my session “When Database Corruption Strikes” as PASS Summit 2016. I want to thank PASS and the program committee for this great opportunity to present on a topic that I enjoy so much… Database Corruption and how to fix it.

when database corruption strikes

 

Here is a shot from my point of view about 10 minutes before the session began.

20161028_152745_pano

Read More »When Database Corruption Strikes – Summit 2016

Database Corruption Overview for Beginners

Database Corruption Overview: Database corruption is one of those things that you can only plan for by practicing your response plaDatabase Corruption Overviewn. Out of all of the things that can happen to your SQL Server this is the one that you are most likely going to want to ask for help when you encounter it.

What is Corruption?

Database corruption refers to corrupt pages in the database that are incorrectly formatted. This could be as simple as a single bit, or as huge as the entire file. Sometimes this type of corruption prevents the database from starting, other times it may prevents queries from running. Sometimes it may go undetected for some time, and may present as missing or incorrect data.

Read More »Database Corruption Overview for Beginners

Database Corruption Webcast – May 3rd

Please join Carlos and I for our first Database Corruption webcast on May 3rd. I have teamed up with Carlos and we will be presenting some thoughts on database corruption with an extended Q&A session.

One important detail is we will be taking questions and answering them live on the webcast so this will be a great way to engage and ask a follow up if needed. I think you will love this format–way better than soaking up 50 minutes of boring and then calling it quits.

The webcast will cover these major topics.
1) Preparing for database corruption and taking the right steps to ensure you can recover
2) A few lessons learned about our experience with database corruption

This weeks session will cover:

corruptionpodcast1

Corruption Prevention is Different Than Disaster Recovery

The best DR plan still needs to account for corruption.

Read More »Database Corruption Webcast – May 3rd

Presenting at SQL Saturday Las Vegas

This Saturday, September 12th, 2015 I will be presenting at SQL Saturday Las Vegas. My presentation is on Database Corruption, here are the details.

When Database Corruption Strikes – Will you be ready?

Duration: 60 minutes

Track: Enterprise Database Administration & Deployment

You are working along month after month with no problems in your database. Suddenly someone reports that their query won’t run. They get an error stating “SQL Server detected a logical consistency-based I/O error“, or something even scarier. Do you know what to do now? We will walk through 3 or 4 actual corrupt databases exploring ways to go about finding and fixing the corruption. More importantly we will explore how to prevent further data loss at the time corruption occurs. Learn what things you should do to protect yourself when corruption strikes. Learn what to avoid that will make things worse. You will leave with a checklist of steps to take when you encounter corruption. By the end of this session you will be ready to take on corruption, one database at a time.

SQL Saturday Las Vegas

The presentation is scheduled for 11:00 am to Noon in room 2767 at the College of Southern Nevada campus in Vegas.

Read More »Presenting at SQL Saturday Las Vegas

Status of DBCC CheckDB

So you are checking your database with DBCC CheckDB and of course if you are like me you use the WITH NO_INFOMSGS parameter. But it turns out that CheckDB is taking longer to run that you expected, and you want to check and see what table is currently being checked.

Here is a quick SQL Script that I use to find the current table that is being checked by DBCC CheckDB

use [your database];
go

-- use this to find the session id of DBCC CheckDB
SELECT session_id, start_time, command, percent_complete, total_elapsed_time,
       estimated_completion_time, database_id, user_id, last_wait_type
  FROM sys.dm_exec_requests
 CROSS APPLY sys.dm_exec_sql_text(sql_handle)
 WHERE command like '%DBCC%';  

DECLARE @sessionID as integer = 53; -- enter the session ID of DBCC CheckDB Here

SELECT name, schema_id, type_desc
  FROM sys.objects
 WHERE object_id = (SELECT TOP 1 resource_associated_entity_id
                      FROM sys.dm_tran_locks
					 WHERE request_session_id = @sessionID
					   AND resource_type = 'OBJECT'
					   AND resource_associated_entity_id <> 50);

status of dbcc checkdb

Read More »Status of DBCC CheckDB