Home » Blog » Topic » How to Open Corrupt MDF file?

How to Open Corrupt MDF file?

Mariya Beckham ~ Modified: November 30th, 2017 ~ ~ 1 Minute Reading

Home Forums How to Open Corrupt MDF file?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6055 Score: 0
    Mariya Beckham
    Moderator
    2 pts

    Hi,

    I am unable to open Microsoft SQL Server MDF files due to some reasons. I think my files are corrupted. But, it is very important to access the data from that file. Please suggest me any solution to open corrupt MDF file easily.

    #6067 Score: 0
    Henry Davidson
    Moderator
    31 pts

    Hi Mariya,

    To open SQL Server MDF database file, it is important to repair the file. It is possible that you are unable to open your file due to some corruption. To access your database tables, you can try many manual procedures to open corrupt MDF file. For example, DBCC CHECKDB inbuilt utility, Rebuild Wizard, etc.

    #6077 Score: 0
    Mariya Beckham
    Moderator
    2 pts

    I don’t know how to use these inbuilt utilities. Can you please explain the working of these utilities?

    #6082 Score: 0
    Henry Davidson
    Moderator
    31 pts

    I’ll tell you how to work with DBCC CHECKDB inbuilt utility. Follow below steps:

    1. Run DBCC CHECKDB command on the database i.e. corrupted.
    DBCC CHECKDB (Name of corrupt database)

    2. Check the index id. If id is greater than 1, then drop and recreate it. If It is 0 or 1, then run DBCC CHECKDB command with some repair options like repair_fast, repair_rebuild, repair_allow_data_loss.
    Follow below command:
    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)

    3. Run DBCC CHECKDB again to check zero corruption and then a new message will receive as shown:
    “DBCC CHECKDB found 0 allocation errors and 0 consistency errors in ‘name of your corrupt database”

    #6085 Score: 0
    Mariya Beckham
    Moderator
    2 pts

    I tried this solution but unable to open corrupt MDF file. Can you share another method too?

    #6088 Score: 0
    Henry Davidson
    Moderator
    31 pts

    Ok. First of all, go to this location for Rebuild Wizard to repair the database:
    \Program Files\Microsoft SQL Server\80\Tools\BINN directory

    Follow these steps:
    1. Double-click on Rebuildm.exe. Choose the database file and also verify other information in Collation Settings and then, click on Rebuild option.
    2. After the confirmation message, click on Yes button.
    3. Now, you can easily restore the master database.
    4. Start SQL Server with SINGLE USER mode . In command prompt, type this command:
    sqlservr.exe –c -m from the \Program Files\Microsoft SQL Server\MSSQL\BINN\.
    5. Store the master database from backup by using Query Analyzer or SQL Enterprise Manager.
    6. After restoring, you need to exit SINGLE USER mode and then, restart SQL Server in NORMAL OPERATION mode.

    #6091 Score: 0
    Mariya Beckham
    Moderator
    2 pts

    I am not getting the desired results. I have a big MDF database file with very important data. I am scared of losing it. Please suggest any safe and secure method.

    #6096 Score: 0
    Henry Davidson
    Moderator
    31 pts

    To view data in MDF file, you can go for an automated solution. SysTools MDF Viewer Tool can easily repair and shows the preview of all the data items from the corrupted MDF file. Try this solution to access your database.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.