January 21, 2009 at 6:23 am
Hello guyz! Am doing some research on database repair, and i need to have a corrupt database, inorder for me to use the DBCC commands and verify their working. Any help on this please?
January 21, 2009 at 6:26 am
there are databases linked here that are in various stages on corruption.
January 21, 2009 at 6:27 am
Interesting Question, Search Google, to start with play with sys tables, this should do the trick :D, make sure that you do this in a test environment or may be better on your local machine
January 21, 2009 at 6:33 am
Disclaimer: Do not do this on a production server. Do not do this to any database that you care about. If you want to play, do so on a SQL instance installed on your workstation.
Right, now that's out of the way...
Take the database offline, open the mdf file in a hex editor. Go to an offset 40k or so into the file (to avoid the critical header pages) and then 0 out a block of data. Save the file, close it, go back to SQL and attempt to bring the database online
I say attempt, because last time I tried that, I fried the DB so badly that SQL couldn't bring it back online.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
January 21, 2009 at 4:54 pm
See http://www.sqlskills.com/BLOGS/PAUL/post/Conference-corruption-demo-scripts-and-example-corrupt-databases.aspx for a bunch of pre-corrupted databases.
Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
January 21, 2009 at 7:55 pm
Heh... just tell it to run for office. 😛
--Jeff Moden
Change is inevitable... Change for the better is not.
January 22, 2009 at 2:16 pm
If you wanna corrupt it time and again after you try repairing then backup the clean database before you start corrupting it..
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply