Microsoft SQL Server 2008 Enterprise Full Version for PC (1 Server/s, 1 Processor/s) (810-07364) Logo
M
Montgomery Posted on Jan 19, 2016
Answered by a Fixya Expert

Trustworthy Expert Solutions

At Fixya.com, our trusted experts are meticulously vetted and possess extensive experience in their respective fields. Backed by a community of knowledgeable professionals, our platform ensures that the solutions provided are thoroughly researched and validated.

View Our Top Experts

How do I recover data from .mdf file

Dear All, Hi. I have a server with the following installed: Windows server 2008 R2 SP1 SQL Server 2008 R2 My production database was mydb The production database files were stored as below : 1 mydb.ndf file was stored at C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mydb.ndf 2 mydb.mdf and mydb.ldf files were stored at D:\myfolder Due to some reasons the Hard disk crashed and I lost my C:\ drive leaving me with only the .mdf and .ldf database files. I have re-installed the Windows server 2008 R2 SP1 and SQL Sever 2008 R2. Now when I try to re-attach mydb, by following method : Right click Databases-Attach-Add, select the .mdf file and click OK I get the following error : Unable to open the physical file C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\mydb.ndf. Operating system error 2: 2The system cannot find the file specified. Microsoft SQL Server, Error : 5120 My Query : How can I recover/restore the database from just .mdf and .ldf files ? I've tried the following : 1 Creating a mydb.ndf file and saving at the same location but SQL server is not able to map it to mydb.mdf. 2 Creating a new mydb and over-writing mydb.mdf and mydb.ldf to the newly created location. Please advice a solution as this recovery is very crucial for me.

4 Answers

horacek

Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

  • Contributor 1 Answer
  • Posted on Jan 28, 2016
horacek
Contributor
Level 1:

An expert who has achieved level 1.

New Friend:

An expert that has 1 follower.

Joined: Jan 25, 2016
Answers
1
Questions
0
Helped
475
Points
5

Detach you database. Overwrite the mdf and ldf files you've restored from your backup with your files from the D: drive. Reattach the database.
There is no guarantee that this will work or if it works, that your database is in a state where you can continue to work with.
If that doesn't work then there is an option to try to restore database using SQL Server Recovery Toolbox. It is a powerful tool for data recovery. They have a demo version. So you can check it works in your situation or not.
http://www.oemailrecovery.com/sql_repair.html

marilynhudson

Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Habit-Forming:

Visited the website for 3 consecutive days.

New Friend:

An expert that has 1 follower.

  • Microsoft Expert 61 Answers
  • Posted on Dec 15, 2016
marilynhudson
Microsoft Expert
Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Habit-Forming:

Visited the website for 3 consecutive days.

New Friend:

An expert that has 1 follower.

Joined: Nov 05, 2016
Answers
61
Questions
0
Helped
15332
Points
375

Stellar Phoenix SQL Server Recovery which recovers the overall existing SQL database objects like Table, Triggers, Stored Procedure, Views, Rules and XML data types also.

Ad

John Phlip

Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

New Friend:

An expert that has 1 follower.

Hot-Shot:

An expert who has answered 20 questions.

  • Microsoft Expert 31 Answers
  • Posted on Jul 12, 2016
John Phlip
Microsoft Expert
Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

New Friend:

An expert that has 1 follower.

Hot-Shot:

An expert who has answered 20 questions.

Joined: Dec 04, 2014
Answers
31
Questions
0
Helped
950
Points
213

To recover corrupt or damaged MDF files, used more reliable software Kernel for SQL Database Recovery Tool. This software recovers all tables, stored procedure, functions, views, rules, triggers and associated Primary Key, Unique keys, data types & all other components. To know more detail click here - http://www.sqlrepair.org/

John Walker

Level 2:

An expert who has achieved level 2 by getting 100 points

All-Star:

An expert that got 10 achievements.

MVP:

An expert that got 5 achievements.

Social Spider:

An expert who has shared 50 answers on their Facebook wall.

  • Microsoft Expert 47 Answers
  • Posted on Mar 12, 2016
John Walker
Microsoft Expert
Level 2:

An expert who has achieved level 2 by getting 100 points

All-Star:

An expert that got 10 achievements.

MVP:

An expert that got 5 achievements.

Social Spider:

An expert who has shared 50 answers on their Facebook wall.

Joined: Aug 07, 2015
Answers
47
Questions
0
Helped
26125
Points
349

- Check the logs to find out which database it is failing on exactly
- Open SQL Management Studio. Look for the database name that was referenced in the logs.
- Check to see if it is there, if it is, check to see if it holds any data or tables. If the database is empty, have the customer delete it
- Restart SQL Services

If the above given method fails to fix your error, then you can take the help of MDF Recovery Software to fix your error. For more information about the software and download the demo version, visit: http://www.sqlmdfviewer.org/recovery/

1 Related Answer

abhvp

Abhay Pujari

  • 148 Answers
  • Posted on Mar 25, 2009

SOURCE: I've got a .bak file from a sql server 2005

Try these Links http://support.microsoft.com/kb/827452 and http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/7b259f06-e1e2-47f5-8303-77775ee80400/

Ad

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

7helpful
5answers

How to Repair Corrupted MS SQL Database (MDF) File?

To choose a reliable and 100% safe and secure, a Microsoft SQL server database recovery program guarantee the zero loss of quality. You can see this page: http://www.en.repairsqlserver.net
See demo: http://www.youtube.com/watch?v=Q0aW1vT5nxA
2helpful
15answers

How can I repair a corrupted MDF files and SQL server?

Similar question has been answered here: http://www.fixya.com/support/t24364927-sql_repair_recovery_process_very

Before asking any question in the forum, first you need to search your problem.
1helpful
6answers

How to recover SQL server mdf files?

Hi.
You can use Sysinfo SQL Recovery a well-known SQL database repair software that helps users of SQL Server for repairing the corrupted MDF file worldwide. It helps users to repairs the corrupt SQL Server files and fulfills all types of SQL database recovery needs.


sql-server-db-recovery-undefined-undefined-0.png
4helpful
6answers

How to recover deleted Microsoft SQL server MDF files?

Recover and repair MDF files with simple and efficetive tool to repair and recover MDF files from corrupt and damaged SQL server, which tool support all king of SQL server version and Windows OS. Visit here: http://www.en.mdfrepair.net
Read blog post: http://exchangerecovery.hubpages.com/hub/How-to-perform-SQL-Database-Recovery Corrupt MDF File Repair Utility
Not finding what you are looking for?

485 views

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

k24674

Level 3 Expert

8093 Answers

Brad Brown

Level 3 Expert

19187 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...