Like any other file, MDF file (MS SQL database file) can also be corrupted at any point in time. Few symptoms that help you to identify that the database file is corrupted are when you are unable to view all the records saved in database components, the database file does not open, or the database mounts in a suspected state. In most cases of MDF file corruption, the database administrator encounters an error message, which s/he tries to solve by executing DBCC CHECKDB command or by restoring file from an upgraded backup. DBCC CHECKDB command helps to repair MDF file in case of any logical corruption, and if the command fails then the administrator restores the data from an updated backup. However, the main problem arises only when there is no database backup availability. For such cases, the database administrator is only left with one option – a third party MDF recovery software.
To practically explain the above discussion, here is an error message that appears after corruption of MDF file:
“error 5101: Device activation error. The physical file name ‘C:%path to db%db_log.LDF ‘ may be incorrect. Then I get db Attach failed.”
The above error message appears when the administrator tries to open the MDF file and access the database objects. To resolve the above error message and repair the database file, when the database administrator executes DBCC CHECKDB (‘dbname’, REPAIR_REBUILD), s/he encounters another error message, shown below:
“Server: Msg 945, Level 14, State 2, Line 1
Database ‘dbname’ cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server error log for details.”
The above error message appears because DBCC CHECKDB is unable to resolve the corruption. In such circumstances, if the above file’s backup is unavailable or corrupted, then the administrator is not left with any alternative, but to use a commercial MDF recovery application.
An MDF recovery software ensures complete recovery of all inaccessible database components from a corrupted MDF file. Such MDF recovery tools provide a complete preview of all the recoverable MS SQL database components before restoration. Most of these database repair applications come with a demo version that provides a complete understanding about the software.
MS SQL 2000, MS SQL 2005, and MS SQL 2008