Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

CORRUPT A DATABASE Expand / Collapse
Author
Message
Posted Wednesday, January 21, 2009 6:23 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 2, 2009 8:55 AM
Points: 33, Visits: 139
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?
Post #640629
Posted Wednesday, January 21, 2009 6:26 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, May 30, 2014 6:27 PM
Points: 2,808, Visits: 7,175
there are databases linked here that are in various stages on corruption.

http://sqlskills.com/BLOGS/PAUL/category/Corruption.aspx
Post #640634
Posted Wednesday, January 21, 2009 6:27 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, July 3, 2014 10:20 AM
Points: 770, Visits: 1,596
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
Post #640637
Posted Wednesday, January 21, 2009 6:33 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 3:09 PM
Points: 42,434, Visits: 35,487
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 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #640647
Posted Wednesday, January 21, 2009 4:54 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, July 3, 2014 4:00 PM
Points: 2,038, Visits: 1,663
See http://www.sqlskills.com/BLOGS/PAUL/post/Conference-corruption-demo-scripts-and-example-corrupt-databases.aspx for a bunch of pre-corrupted databases.

Also see http://www.sqlskills.com/BLOGS/PAUL/post/Example-20002005-corrupt-databases-and-some-more-info-on-backup-restore-page-checksums-and-IO-errors.aspx


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
Post #641258
Posted Wednesday, January 21, 2009 7:55 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 2:50 PM
Points: 36,711, Visits: 31,159
Heh... just tell it to run for office. :P

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #641333
Posted Thursday, January 22, 2009 2:16 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Friday, March 14, 2014 3:15 PM
Points: 804, Visits: 935
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."
Post #642074
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse