472,145 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

restore .dat

1
I am trying to restore a SQL Server database from a .dat file. An earlier question on how to do this elicited the following answer.

"

You need to know how the '.dat' file was created in order to import it. Use
RESTORE FILELISTONLY to determine if this is a database backup:

RESTORE FILELISTONLY
FROM DISK='C:\MyDatabase.dat'

You can then execute a RESTORE with the desired MOVE options.

RESTORE MyDatabase
FROM DISK='C:\MyDatabase.dat'
WITH
MOVE 'MyDatabase' TO 'C:\DBDataFiles\MyDatabase.mdf',
MOVE 'MyDatabase_Log' TO 'C:\DBDataFiles\MyDatabase_Log.ldf'

If you get an error during the RESTORE FILELISTONLY that states the file
isn't a valid backup, you'll need to investigate further. You might try
opening it using a text editor to see of that provides a clue of the file
format.

"

When I do the RESTORE FILELISTONLY command I get a table with two rows

LogicalName :: PhysicalName :: FileGroupName

Data_V2_1_Data :: C:DATABASES\Data_V2_1_Data.MDF :: PRIMARY
Data_V2_1_Log :: C:DATABASES\Data_V2_1_Log.LDF :: NULL

The .MDF and .LDF files were not provided to me. Are those something I
need?
What does this result mean? What are possible next steps to extract .MDF, ,LDF files?

The RESTORE with MOVE doesn't work, but I am hoping that if I can get help figuring out teh RESTORE FILELISTONLY commands results the other part will fall into place.

Thank you in advance!
-Nik
Aug 1 '08 #1
1 6689
Dököll
2,364 Expert 2GB
Hello!

Are the column names provided to you legitimate (LogicalName :: PhysicalName :: FileGroupName), you probably have found your answer there...

If you were restoring a database, the extension is the .MDF portion. Although I suspect you alreay know that.

Also, do you have a copy of this database (.MDF file). If you have the data elsewhere, you may find it easier to just make up a different .MDF (database) and update/transfer the data to it.

Not too conventional, but if you need simpler solutions and have a copy, try it:-)
Aug 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by For example John Smith | last post: by
3 posts views Thread by butatista | last post: by
4 posts views Thread by Hardy | last post: by
9 posts views Thread by GL | last post: by
11 posts views Thread by Chris | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.