April 24, 2007 at 1:29 pm
Strange question...we need to test some scripts that test for database corruptions.
So...does anyone know a way to purposly corrupt one or more datapages in a database?
The Redneck DBA
April 24, 2007 at 2:05 pm
Hi there,
you get get some corrupt databases from here: http://blogs.msdn.com/sqlserverstorageengine/default.aspx there are a couple of posts http://blogs.msdn.com/sqlserverstorageengine/archive/2007/04/20/and-an-example-corrupt-2000-database-to-play-with.aspx.
Tony Rogerson also has a blog post on how to create a corrupted database using BCP etc: http://sqlblogcasts.com/blogs/tonyrogerson/archive/2007/03/10/how-to-create-a-corrupt-database-using-bulk-insert-update-and-bcp-sql-server-as-a-hex-editor.aspx
One final way is to get out a hex editor and play around with your datafiles and try to corrupt portions of the files (I have done it several times while working on SQL Backup to test page level restores and get databases into a suspect state).
Hope this helps,
- James
--
James Moore
Red Gate Software Ltd
April 24, 2007 at 2:52 pm
Thanks. That file works swell!
The Redneck DBA
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply