Solved

restore a database

Posted on 2006-10-25
3
304 Views
Last Modified: 2012-05-05
I am trying to restore a database using its full backup BAK file taken earlier from a server. We were on the process of transferring all the databases from a 2000 system on an old server to a 2005 system on a new server during the time this BAK file is taken. According to the error message below I think this BAK file is for 2005 version on the new server but I am not positive.

Now when I try to store it to a database on my own PC (2005), I got:
System.Data.SqlClient.SqlError: Directory lookup for the file "D:\SQL\mydatabase.mdf" failed with the operating system error 21(The device is not ready.).(Microsoft.SqlServer.Smo)                 --note: D:\SQL\ is the pathname for the database files on the server.

When I try to store it to the server (2005) with a different database name, I got:
System.Data.SqlClient.SqlError: The file 'D:\SQL\mydatabase.mdf' cannot be overwritten. It is being used by database 'mydatabase'.(Microsoft.SqlServer.Smo)

My questions are:
1. Does this mean I can't restore the database to a different machine? But I was able to do the same with SQL 2000 to any machines without a problem.
2. The error message on the server seems to indicate it's trying to overwrite the existing database although I have specified a different database name. What can I do to bypass the problem?

Thanks.
0
Comment
Question by:sdc248
3 Comments
 
LVL 20

Accepted Solution

by:
Sirees earned 125 total points
ID: 17806673
Are you restoring the backup file or attaching the .mdf file?


<<--note: D:\SQL\ is the pathname for the database files on the server.>>

If you are restoring on your PC, that path should point to your PC and not the server.




0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question