How to Create a Corrupt SQL Server Database

  • This hasn't worked successfully for you, work through the guide again on a new database

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" πŸ˜‰

  • This corruption issue has always intrigued me.

    I have always wondered whether anyone has done any investigation on an actually corrupt database to see where it has become corrupt and possibily also discover why.

    Instead we all concentrate on just trying to recover from this situation - which I guess is good enough.

    A little while back there was a discussion on corrupted backups and all the things that can and should be done to avoid it.

    At the time I used some C code to randomly corrupt bytes here and there in a BAK file (did the backup after having done a compression).

    It was amazing how much corruption you could apply and still be able to do a restore.

    I too recently discovered this xvi32 tool and will now try it out on some MDF and BAK files.

  • Funny, I had understood that if a nonclustered index is corrupt, you donΒ΄t need the option REPAIR_ALLOW_DATA_LOSS, that is shown in the image

  • Great article. It really highlights the concept of knowing how to break something so you can better learn how it can be fixed.

  • roberto.regidor (8/8/2014)


    Funny, I had understood that if a nonclustered index is corrupt, you donΒ΄t need the option REPAIR_ALLOW_DATA_LOSS

    That is correct

    roberto.regidor (8/8/2014)


    that is shown in the image

    which image are you referring to?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" πŸ˜‰

  • I haven't seen the PAGE command used for a really useful DBA purpose in a very long time. I've used it for educational purposes, for myself and also to give Dev folks an appreciation of what is going on under the covers. I like it. If you do any FMEA (Look it up, "Failure Mode Effects Analysis"), this tip can be really helpful. Nice.

  • Hi Perry

    The last image of the post says

    repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB

  • Nice article Perry. Simple and effective techniques. Thank you.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • roberto.regidor (8/8/2014)


    Hi Perry

    The last image of the post says

    repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB

    Yes it clearly is incorrect in this case

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" πŸ˜‰

  • Thank you Perry for this nice piece.

    😎

  • You're welcome

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" πŸ˜‰

Viewing 11 posts - 16 through 25 (of 25 total)

You must be logged in to reply to this topic. Login to reply