Help, my database is corrupt. Now what?

  • Comments posted to this topic are about the item Help, my database is corrupt. Now what?[/url]

    Just an additional note, this article was tech-edited by Paul Randal.

    Thanks for your time and input Paul.

    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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Great article Gail. I'll be sure to forward this on to a DBA who I know has had a few corrupt database issues.

  • Good article Gail. Stuck it in my brief case. I just hope I never have to reference it to fix any of my DB's. 😀

  • Great article Gail..... It's now permanently bookmarked 🙂

    _______________________________________________________________________
    For better assistance in answering your questions, click here[/url]

  • Good article Gail. Very descriptive. It would be in my briefcase.

    SQL DBA.

  • Jack Corbett (2/16/2009)


    I just hope I never have to reference it to fix any of my DB's. 😀

    I hope so too. This is an article that I would like no one to ever have to use. 🙂

    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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Great Article. I have added to my Breifcase. Like everyone said, I hope I never have to use it.. 😀

    -Roy

  • fantastic article! easy to read, great examples, and right to the point. Now I am off to read Paul's article on what DBCC CHECKDB actually deletes when a REPAIR_ALLOW_DATALOSS is ran.

  • Nice article. I will definitely print this one out for lunchtime reading.

    By the way, someone contacted me with a corrupt database a couple of years ago (they had NO backups) and I made the mistake of detaching it (yow!). This product saved my butt:

    Recovery for SQL Server

    http://officerecovery.com/mssql/index.htm

    It can script out everything salvageable from a corrupt .mdf file and tells you what it did not get and why. When you need it, it is well worth the $499 price.

    he Demo version is pretty cool in that it returns all the data with the primary keys but after the first few records puts DEMO in all the non-PK columns. With the demo you can at least see how much you are going to get back before you buy it.

    Cheers.

    G. Milner

  • Thanks for a very informative article Gail. It has helped me understand more fully the ways to tackle corruption, the very first one being backups, log and database!

    Cheers

    Nicole Bowman

    Nothing is forever.

  • Awesome article, Gail. Wish I had it when MSDB went sour on one of my Dev servers especially since my predecessors saw no need to backup a Dev Server. How much of this applies to the system's databases (not including TempDB, of course)? And, pardon my ignorance on the subject... I'm more of an Application DBA than a System's DBA.

    --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.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • At the risk of being redundant, excellent article, Gail. It should be compulsory "calm down and think" reading for any DBA facing an apparent catastrophe. Bookmarked and link mailed to collegues.

    Stephen

  • SDM (2/16/2009)


    At the risk of being redundant, excellent article, Gail. It should be compulsory "calm down and think" reading for any DBA facing an apparent catastrophe. ..

    Stephen

    Same from me - there should be a prize for you, and not just for this article. This is so helpful to all accidental DBA's ... it's not funny!

  • Great article. Thanks for taking the time to create it. An excellent resource for sure.

    Mike

    How to Post Performance Problems[/url]

    How to Post Best Practices[/url]

  • Jeff Moden (2/16/2009)


    How much of this applies to the system's databases (not including TempDB, of course)?

    MSDB can be repaired, I believe (haven't tried it). Master I would recommend restore or rebuild, though I have seen someone repair it successfully. Model, since it should have nothing in it, you should be able to copy from another server.

    Depends what the corruption is. If it's just in the nonclusters, then repair's probably safe even in the system databases. If it's in the clustered index then my recommendation would be restore or rebuild (especially with master)

    Master and msdb can be completely recreated, by the rebuild master function of the installer (master) or by script (msdb). It won't get any data back, but it will get the DB usable and free of corruption.

    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

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

Viewing 15 posts - 1 through 15 (of 86 total)

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