none
Repair a corrupt SQL database in SQL 2005 RRS feed

  • Question

  • My server crashed. most stuff lost.  I recovered the .mdf .ldf files through DaRT. I can not use the files. It advises that the header is corrupt.  Please advise what the best way to resolve this is.
    Sunday, September 6, 2015 10:51 AM

Answers

All replies

  • Use your most recent backup taken for the database. File recovery such that you have tried has little chance for success (as you have noteiced) so restoring a SQL Server backup is most often the only solution.

    Tibor Karaszi, SQL Server MVP | web | blog

    Sunday, September 6, 2015 5:46 PM
  • If you cannot attach the files, then I agree to TIBOR, use your most recent backup to restore the Database. If the DB was using a FULL recovery model with frequent T-Log backups, You should be good enough

    Hope this helps ! ------------------------------------------------------Please Mark This As Answer if it solved your issue. Please Vote This As Helpful if it helps to solve your issue


    Sunday, September 6, 2015 6:39 PM
  • Fully agreed with TiborK but I don't think you have backup of database as you have already tried data recovery tool to recover your mdf/ldf files.

    SQL database can be repaired by DBCC CHECKDB's repair options but there is risk of data loss.

    • Set database in single user mode
    • Run DBCC CHECKDB with repair_allow_data_loss
    • Set database in multi user mode

    Hope this will helpful for you!!

    Monday, September 7, 2015 6:39 AM
  • This is old but a common situation. I completely agree with Tiber's answer. In most of the cases, recovered files become corrupted so, in this situation updated backup is the best way to secure your database. 

    Read this: https://www.sqlservercentral.com/forums/topic/mdf-file-header-corruption

    http://blog.sqlexpert.pl/2015/06/04/repair-sql-file-header-corruption/

    Friday, December 6, 2019 6:42 AM