Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

restore errros

Status
Not open for further replies.

germanseneca

IS-IT--Management
Oct 25, 2004
2
GB
i am trying to restore a db from a sql server backup-file (from device - add device - file name etc).

i am getting an following error message:
ODBC SQL state 42000
Device activation error: the physical file name d:\MSSQL\... my be incorrect
File 'blabla.dat' cannotbe restored to: d:\... Use WITH MOVE to identify a valid location for this file
...

what is going on there?
Thanks
 
It's telling you that the file in the wrong location. It expects it to be in one place, but it's finding it in another.

-SQLBill
 
do you think it was backuped under the c-drive and needs a c-drive location for the restore now?
what do you suggest as a solution?
 
It's not a matter of where it was backed up to...it's a matter of where it's being restored to.

For example: MyUserDb is at D:\Databases\MyUserDb.mdf
I back it up to my F drive.
Now I go to restore it, I need to restore it to D:\Databases.
If I try to restore it anywhere else (another drive, D:\, D:\Program Files\....., etc) it will fail and give the error you got.
This issue is caused by MASTER db keeping track of where the database files are supposed to be and you are trying to restore it to a location that MASTER says isn't where it belongs.

If you are trying to restore to a different location or you just don't remember where it really belongs, use the the MOVE command.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top