Tuesday, April 12, 2011

How to Recover Database When MDF file get corrupted ????

The data loss from the database is a very panic situation that occurs without any warning message. It can corrupt or damage our data stored on our hard drives or on any storage media. The database may be corrupted due to hardware failure, application failure, improper system shutdown, media read errors, software failure, power failure, virus attack and many other reasons. In such case you need to use an advanced database recovery software to recover and repair corrupted database. In case of MDF file corruption, you may face any of the given below error messages:-

Windows could not start the SQL Server”
“MDF is not a primary database file”
“Server can’t find the requested database table”
“Database Can’t Be Accessed”
“The file *.mdf is missing and needs to restore”
“The execution of a full-text query failed”.

Solution: To repair and restore corrupted .mdf file by any of the above error message follow given below steps:

Fix Hardware Issue: To fix the error message check your hardware setup if found any problem with the hardware then repair or replace it by new one and fix the problem.

Run DBCC CheckDB Command: If the problem is not related to hardware then run dbcc checkdb command without any clause and then run again dbcc checkdb command with the proper repair clause.

Restore from Backup: After running the dbcc checkdb command and you still getting an error message then restore database from the latest and updated backup. If you have no any backup then you should try an advanced mdf recovery utility to repair and restore corrupted .mdf file.