Monday, 26 August 2013

How to recover corrupt MDF & LDF files

The importance of owning a sturdy Database Management System is evident for personal or professional usage. Other than managing official work, it helps in keeping track of administrative records as well. However, there could be umpteen reasons that corrupt database and lead to data loss irrupting work! Most of the times, under MDF file corruption, DB admin encounters the following error when tried to execute DBCC CHECKDB command. The error also occurs when admin tries to restore file from an upgraded backup!
DBCC CHECKDB command generally helps to repair corrupt MDF files. It recovers MDF files damaged due to logical corruption and in cases when it fails; the admin restores data from updated backup as and when required. Trouble arises when there is not any database backup to be restored from. 
Have a look at the error below: 
Error 5101: Device activation error
In this case, the physical file name 'C:\%path to db%\db_log.LDF ' may be incorrect. When corrected you might face the error, “db Attach failed”. 

LDF is the Log files associated with MDF DB files. It is one of the most common errors that Admin face when they try to open MDF file in order to access the Database objects. In order to repair this error, admin executes DBCC CHECKDB ('dbname', REPAIR_REBUILD). However, admin usually gets another error message, shown below:
Server: Msg 945, Level 14, State 2, Line 1
Database 'dbname' cannot be opened due to inaccessible files, insufficient memory, or disk space. See the SQL Server error log for details.

These few common errors keep coming and disrupting work. In worst-case scenarios, user ends up losing loads of information just like that. Under similar circumstances, admin must trust third party MDF and LDF Recovery tool. It not only eases out the damage issues but also performs complete and accurate repair of corrupt MDF as well as LDF files. Easily available, Kernel for SQL Recovery Software is the appropriate way for recovering SQL damage files. Proficient in repairing MDF files, the software completely recovers tables, views, indexes, stored procedures, unique/primary keys etc from the damaged SQL database. Moreover, the software is available in free trial edition that users can download to try it before purchase. Providing full support to MS SQL Server 2000/ 2005/ 2008/ 2008 r2 and 2012, this software is worth a try. Click here


  1. Whenever users face MDF or LDF file corruption, they get worried about it but you should not worry because you can fix your MDF or LDF file corruption without any data loss with any third party SQL recovery software. It's very helpful post to recover inaccessible database files.

    Thanks a lot

  2. Your discussion about MDF & LDF files corruption issue is more use full to every database user because after using your discussion and software he can quick recover database file.
    Thanks for this informative discussion....

  3. Hello Johnson,

    This post is very informative. Here, I want to add my thoughts on MDF file corruption by using this comment.
    I am a SQL DBA and, I understand the importance of database backup. In 90% of cases, hardware failure becomes a reason for database corruption and, DBA can handle it by using a good DR plan.

    Recently, one of my best friend, who is also a DBA faced corruption in MDF file. I suggested him to restore the database from backup. As the backup file was also corrupt so, he was unable to do it. He shared an article with me by which he successfully repaired his corrupt MDF file. You can read the article from here:

  4. I am agree with Techie, you can also refer to to check SQL Repair tool which can easily fix MDF & LDF files.