May 14, 2006 at 2:56 pm
I'm trying to restore from a mdf & ldf I was sent. Both file have good size (about 100 meg each). I am creating a database and then trying to restore it using these two files. I point to them from the options tab, using the force db option. I am pointing to an empty backup file and using the overwrite option since I never backed the db up.
Each time the restore emties the the mdf & ldf files to 1024 KB. Does anyone see my mistake?
Email is cronid@aol.com or cronid@yahoo.com.
Thanks in advance.
May 14, 2006 at 3:10 pm
Dennis
.mdf and .ldf files are not backup files, they are native SQL Server database and log files respectively. All you need to do is copy the files to your standard location for database files (by default, this will be C:\Program Files\Microsoft SQL Server\MSSQL\Data). Then open up Enterprise Manager, right-click on 'Databases' and select All Tasks / Attach Database, then navigate to the .mdf file you copied above.
You do not need to create an empty database first.
May 15, 2006 at 7:19 am
As Phil pointed out .mdf/.ldf files are not your normal backups and cannot be 'restored'. You can use Phil's method to attach the files or use the sp_attach_db command (refer to the BOL for proper syntax).
One thing.....how were the copies of the .mdf and .ldf files created? If the original files were copied while the database was online, then those files are unusable. The database must be offline to be able to copy the .mdf/.ldf files. properly.
-SQLBill
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply