Backup and Recovery

Let’s Corrupt a SQL Server Database Together, Part 1: Clustered Indexes

CHECKDB and Corruption
27 Comments
Hold my beer. Transact-SQL CREATE DATABASE [50Ways]; GO ALTER DATABASE [50Ways] SET PAGE_VERIFY NONE; /* Normally a bad idea */ GO USE [50Ways]; GO CREATE TABLE [dbo].[ToLeaveYourLover]([Way] VARCHAR(50)); GO INSERT INTO [dbo].[ToLeaveYourLover]([Way]) VALUES ('Slip out the back, Jack'), ('Make a new plan, Stan'), ('Hop on the bus, Gus'), ('Drop off the key, Lee') GO SELECT…
Read More

SQL Server Timeouts During Backups and CHECKDB

So you’re hosting your SQL Server in the cloud – say Amazon EC2, Azure VM, or Google Compute Engine – and you’ve noticed that when you’re running a backup or a DBCC CHECKDB, you suffer from extreme performance problems. Queries run slow, and even worse, applications report timeout errors even just trying to connect to…
Read More

Updated High Availability and Disaster Recovery Planning Worksheet

One of the most popular things in our First Responder Kit is our HA/DR planning worksheet. Here’s page one: Page 1 – how our servers are doing now, versus what the business wants In the past, we had three columns on this worksheet – HA, DR, and Oops Deletes. In this new version, we changed “Oops”…
Read More

What to Do When DBCC CHECKDB Reports Corruption

The instant you encounter corruption in a production SQL Server database, stop. Read this entire article first to understand the big picture, and then come back here to take action. First, understand that you shouldn’t start by trying to repair the corruption. You may be facing a storage subsystem problem where your storage is corrupting…
Read More

My Favorite System Column: LOG_REUSE_WAIT_DESC

Hidden away in master.sys.databases is one of the coolest diagnostic tools you might ever need: Transact-SQL SELECT name, log_reuse_wait_desc FROM sys.databases; 1 SELECT name, log_reuse_wait_desc FROM sys.databases; This spiffy little snippet will tell you why each database’s log file isn’t clearing out. Possible reasons include: Log backup needs to be run (or if you could…
Read More