corrupted mdf file

  • Ukon

    SSC Eights!

    Points: 860

    hello: i was given a corrupted mdf file, the server the database (sql 2000) crashed and the only file recovered was this .mdf file. I have tried as many of the options that i can find, and still cannot get this database recovered. downloaded several of the programs that claim to be able to recover mdf files and none work.. This latest gives me the following error:SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0xaaaaaaaa; actual signature: 0xd8b4c0f2). It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'C:\DBIO\testy.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

    I created a new database (sql 2008 r2) since I do not have sql 2000 anywhere. renamed the mdf file and then renamed the corrupted one to the new name and restarted. This then brings up the db in recovery_pending mode and I cannot get it out of that mode. Tried setting it to emergency mode, no luck. Is there anyway for me to recover this db?

    No there were no backups of this database at all, and yes, i completely agree that a backup strategy is needed, but i'm just the lucky recipient of the issue πŸ™‚

    thank you for any help!

  • Gail Shaw

    SSC Guru

    Points: 1004424

    Irreparable, nothing that can be done. The file header is damaged, SQL cannot open that file. Since it's the primary file of the database, SQL can't open the DB at all

    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
  • stephencook2913

    SSC Journeyman

    Points: 88

    SQL Database backup should be created and used in these corruption situations but as you mentioned you have not created any backup then you can try for some recovery tool that can help you. As a Genuine SQL user, i would like to suggest you a troubleshooting tool that will solve your corruption issue surely because it helped me to come out of some corruption situations. You can get more information from http://www.sqldatabaserecovery.n.nu/[/url]

  • avirasimon

    SSC Journeyman

    Points: 81

    As we all are familiar with the point that DBCC commands are not able to remove all the problems observed in stored mdf file. User can perform [font="Comic Sans MS"]corrupt mdf fix[/font][/url] function with the third party tool which can work efficiently in all corruption cases.

  • rodyroon 12270

    SSC Journeyman

    Points: 75

    The MDF files of SQL database may get corrupt due to some problem in the database. If such a situation arises, the user can use the software which recovers the lost MDF file. But before choosing the software, make sure that it is efficient enough to recover the unique keys, primary keys, indexes, stored procedures, views etc from your corrupt MDF file. one of the software which i used before want to suggest you it is Kernel for SQL Database Repair you can download this software from here http://www.restoresqldatabase.org/[/url]

  • mountainfalling

    SSC Journeyman

    Points: 87

    Ukon (3/15/2011)


    hello: i was given a corrupted mdf file, the server the database (sql 2000) crashed and the only file recovered was this .mdf file. I have tried as many of the options that i can find, and still cannot get this database recovered. downloaded several of the programs that claim to be able to recover mdf files and none work.. This latest gives me the following error:SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0xaaaaaaaa; actual signature: 0xd8b4c0f2). It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'C:\DBIO\testy.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

    I created a new database (sql 2008 r2) since I do not have sql 2000 anywhere. renamed the mdf file and then renamed the corrupted one to the new name and restarted. This then brings up the db in recovery_pending mode and I cannot get it out of that mode. Tried setting it to emergency mode, no luck. Is there anyway for me to recover this db?

    No there were no backups of this database at all, and yes, i completely agree that a backup strategy is needed, but i'm just the lucky recipient of the issue πŸ™‚

    thank you for any help!

    If your SQL database has gone damaged, then the way to recover database goes through a backup. If you have a recent backup of the database elements, then recovery is possible. If you lack these, then you shall have to opt for a professional sql database recovery software.

    You can read more about this on: http://sqldatabase-recovery.com

  • lilylisa083

    SSC Journeyman

    Points: 99

    zacharys (8/12/2012)


    Yes, there are some data recovery software available for SQL data recovery. You can recover your mdf file easily.

    Agree, a good data recovery software can be used for SQL data recovery. You can try to recover corrupted mdf file with data recovery software.

    Need file recovery? Or hard drive data recovery software?
    Recover deleted files Quickly and Easily http://www.asoftech.com/adr/[/url]

  • Your Name Here

    SSCrazy

    Points: 2230

    Sorry for the "Captain Obvious" fly-by but...

    If you have the database at a point where it's barking about running DBCC CHECKDB, have you given that a shot? Let DBCC put the pieces together if it can. If it can't, well, you may be out of luck.

    Regarding the "recovery software" I'd avoid getting my hopes up. I'm no expert but I believe most of this type of software is "file recovery" not "database recovery" so simply having a [copy] of a corrupted file won't be enough - you'll need to give the software access to the physical box (or drive) that crashed (read: the original drive will need to be available). Good luck and godspeed.

    <my two cents>

    If the database was on a server that is [several versions] out of mainstream support (did I get that math right? 2000, 2005, 2008, 2008 R2, 2012) I'd consider this recovery exercise to be directly related to the decision not to upgrade [12-year-old] software. I'd report the database to be irreparable and irrecoverable since you have no backup. This jab is .:[NOT]:. directed at you, but at the decision-makers that allow this situation to happen. There. I'm done ranting now. My apologies to all the gentle readers of SQLServerCentral.com. This stuff just fires me up. I wish you the best of luck.

    </my two cents>

  • Ukon

    SSC Eights!

    Points: 860

    Thank you all for the help and the "Captain Obvious" fly-by :-D. I did finally get some of it back and advised that backups and upgrades are the best options.

    I really appreciate this site as it has been of immense help and value to me as I "grow".

    again thank you all !!

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 714067

    betty_bakke (3/29/2014)


    Hello,

    Through a manual solution you can restore data from your corrupted .mdf database. It can be done by executing DBCC CHECKDB and DBCC DBREPAIR statements in MS SQL Server as a new query. For step by step process to execute these statements, you can refer to this blog post: Recover corrupted MDF File[/url]. πŸ™‚

    NOTE that DBCC DBREPAIR is not recommended. I would be very careful about using any of these tools.

  • Gail Shaw

    SSC Guru

    Points: 1004424

    Steve Jones - SSC Editor (3/30/2014)


    NOTE that DBCC DBREPAIR is not recommended. I would be very careful about using any of these tools.

    More drive-by spam. This stuff gets posted on any thread remotely resembling corruption, no matter whether or not the posted 'advice' has any relevance. πŸ™

    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
  • johnwalker10

    SSCrazy Eights

    Points: 9074

    If you have a backup of the database, then it is the best time to use it. Before restoring database from backup, you need to verify it. As SQL server backup is also get corrupt.But if you don’t have a healthy backup, then you can try third party SQL Recovery Tool to repair corrupt .mdf file

  • Gail Shaw

    SSC Guru

    Points: 1004424

    5-year old thread

    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 13 posts - 1 through 13 (of 13 total)

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