I am unable to access the MDF file. Can anybody suggest the method to repair MDF files?
Repair MDF Filesrepair MDF files
Posted 22 January 2019 - 04:51 AM
MDF file is the most important file of SQL database. To repair corrupted MDF files by these ways:
- Execute the DBCC CHECKDB command
DBCC CHECKDB (Name_of _corrupt _database)
Case 1: If index ID > 1, drop it and create it again.
Case 2: If index ID is either 0 or 1, then run DBCC CHECKDB again with the repair options
DBCC CHECK (name_of_corrupt_database, repair_fast)
DBCC CHECK (name_of_corrupt_database, repair_rebuild)
DBCC CHECK (name_of_corrupt_database, repair_allow_data_loss)
- Restoring MDF file from a recent backup
If these methods get fail to revive a damaged MDF file, then try professional tools which are more helpful to repair SQL database file. After gone through to SQL database communities like Stack Overflow, SQL Central and many more. There are many tools provided like Stellar Repair for MS SQL software, ProMX, Saloniris. If you want to try more methods then search on Microsoft Technet Forum and try other methods also.
Posted Today, 01:06 AM
The first way to restore the database by using updated backup copy.
RESTORE DATABASE Adventureworks FROM DISK = 'D:\Adventureworks_full.bak'
If you are going to continue with restoring differential or transaction log backups after that, you need to add NORECOVERY option. This will leave the backup process in restoring state and allow you to restore extra differential or transaction log backups.
RESTORE DATABASE Adventureworks FROM DISK = 'D:\Adventureworks_full.bak' WITH NORECOVERY
If backup is not updated or corrupt then, you can repair using DBCC CHECKDB repair option but, you may loss data.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users