SQL Server Storage Engine

Easy way to create a corrupt database for testing

In previous posts I've explained how to use a hex editor to corrupt a database for testing and exploration. MVP Tony Rogerson has gone one step further by using bulk load to import a database into SQL Server and then create various corruptions using regular T-SQL. Checkout his *fantastic* blog post here and look through some of my earlier posts for details of on-disk data structures that you can corrupt.

Its very important that you try running CHECKDB on a known corrupt database so you can test whatever logic you have to notify you of database corruptions.

Have fun!

Published Thursday, March 22, 2007 12:29 PM by Paul Randal - MSFT

Comments

 

Glorf IT - Bedenkliches aus dem IT-Alltag » Datenbanken zerst??ren said:

April 3, 2007 2:50 PM
 

米田 Blog ( SQL Server MEMO ) said:

SQL Server をbinary editor として使用する(MLメモ)

April 26, 2007 4:54 PM
Anonymous comments are disabled

About Paul Randal - MSFT

Paul started in the industry in 1994 working for DEC on the VMS file system and check/repair tools. In 1999 he moved to Microsoft to work on SQL Server, specifically on DBCC. For SQL Server 2000, he concentrated on index fragmentation (writing DBCC INDEXDEFRAG and DBCC SHOWCONTIG) plus various algorithms in DBCC CHECKDB. During SQL Server 2005 development Paul was the lead developer/manager of one the core dev teams in the Storage Engine, responsible for data access and storage (DBCC, allocation, indexes & heaps, pages/records, text/LOB storage, snapshot isolation, etc). He also spent several years rewriting DBCC CHECKDB and repair. For SQL Server 2008, Paul managed the Program Management team for the core Storage Engine to become more focused on customer/partner engagement and feature set definition. In 2007, after 8.5 years on the SQL Server team, Paul left Microsoft to join his wife, Kimberly Tripp, running SQLskills.com and pursuing his passion for presenting and consulting. Paul regularly presents at conferences and user groups around the world on high-availability, disaster recovery and Storage Engine internals. His popular blog is at http://www.sqlskills.com/blogs/paul/.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker