November 17, 2008 at 5:30 pm
Hi Folks,
I have a newbie question here:
What happens if I have a backup file (.bak), but somehow I lost the database that it belongs to?
For example… db server catches on fire, and all data is lost, including the .mdf database file.
Without the orginal .mdf file is the .bak any useful?
If I cannot restore using the .bak without the original DB File…then what is the method to restore a database, assuming I’ve lost the .mdf, but kept .bak at different locations...
Regards,
- Joel
November 17, 2008 at 11:45 pm
You don't need the database files to restore a database from the backup files. This why you can restore the database to a brand new server, it will create the .mdf and .ldf files (and the .ndf files if those are needed as well).
November 18, 2008 at 12:11 am
Yeah, as a matter fact the reason I posted the question was because I tried to restore a db. from a backup file..and I got an error message saying something like: "Wrong database name etc.." so I thought I might need the .mdf..
I relaized now, that i had to give it a name during the backup operation if the dabase is not present..
and this worked..
Thanks,
Joel
November 18, 2008 at 9:15 am
make sure you select "Replace" option then it works fine.
November 18, 2008 at 10:11 am
You only need the REPLACE option on the RESTORE if the .mdf/.ldf files already exist on the server you are restoring the database.
November 24, 2008 at 10:03 am
You can also use the RESTORE FILELISTONLY command to see what databases exist in the .bak backup file.
Example:
RESTORE FILELISTONLY
FROM DISK = 'enter file path with filename'
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply