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 02, 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: Yesterday @ 10:07 AM
Points: 2,802, Visits: 7,107
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: Tuesday, September 18, 2012 3:00 PM
Points: 770, Visits: 1,593
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-Dedicated

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

Group: General Forum Members
Last Login: Yesterday @ 4:11 PM
Points: 37,741, Visits: 30,020
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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 1,910, Visits: 1,602
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: Yesterday @ 4:51 PM
Points: 32,923, Visits: 26,811
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."

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #641333
Posted Thursday, January 22, 2009 2:16 PM
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: Wednesday, May 15, 2013 3:23 AM
Points: 794, Visits: 901
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