Showing posts with label company. Show all posts
Showing posts with label company. Show all posts

Friday, March 9, 2012

Restoring from unknown .mdf file

My company received a drive with SQL 2000? .mdf and .ldf files. I don't know if they were detached or just copied. I've been unable to reattach the files and get the error bellow when I try sp_attach_db.

Server: Msg 5105, Level 16, State 2, Line 1
Device activation error. The physical file name 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\ocwp.mdf' may be incorrect.

Is there anyway to get this data back short of asking for a new backup?

Thanks,

Tim

The restore is attemping to put the files back in the same location they were located on the original server.

Use the [ WITH MOVE ] option for RESTORE. (From Books Online.)

RESTORE DATABASE { database_name }

FROM <backup_device>

WITH MOVE 'logical_file_name_in_backup' TO 'operating_system_file_name' ]

|||

I was able to get this working by creating a new database with the same name, stopping the SQL instance, replacing the newly created .mdf and .ldf files with the ones with data and restarting the instance. Then I found out they were for 2005 and had to redue to process.

Thanks though.

Tim

Tuesday, February 21, 2012

Restoring database on my localhost

Hi there,

I am using VWD and have my production website hosted elsewhere. The hosting company provides a backup service that allows me to download a something.bak file as the backup of my website. My query is: how to export or copy the data in the something.bak file into the database on my own computer? Can anyone helps please?

Thanks in advance.

Why you want to use .bak file. Just connect you sql server to remote database using enterprise manager and import the database from remote server to your server.

Please let me know if you have any doubt.

|||

Thanks for your response.

I am not familiar with SQL server. I am using .bak because the backup service provided by my hosting company uses this method. BTW, what I have is just a VWD. Where can I get the enterprise manager?

Regards.

|||

you can download SQL Management studio expresshere. You need external database access from your hosting company, I suggest contacting your hosting company for more information.

Regards Frederik