Author |
Topic |
neubie
Starting Member
21 Posts |
Posted - 2008-11-26 : 22:38:09
|
hi there,I'm new in this forum, and also new in sqlok, think go to the point I create new database (name is NEW), and I want to restore from another backup (name is OLD). Somehow there is an error, and the message is:Microsoft SQL-DMO (ODBC SQLState: 42000)---------------------------Device activation error. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\NEW.mdf' may be incorrect.File 'OLD_Data' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL\data\NEW.mdf'. Use WITH MOVE to identify a valid location for the file.Device activation error. The physical file name 'C:\Program Files\Microsoft SQL Server\MSSQL\data\NEW_log.ldf' may be incorrect.File 'OLD_Log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL\data\NEW_log.ldf'. Use WITH MOVE to identify a valid location for the file.RESTORE DATABASE is terminating abnormally.---------------------------please help me. thanks |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-11-26 : 23:03:31
|
Restore database with Move option. See booksonline for details. |
|
|
neubie
Starting Member
21 Posts |
Posted - 2008-11-27 : 00:35:44
|
for sodeepdid you mean help in sql server for booksonline?sorry for this question, I really new in sql serveranyway, can "move option" restore database use current log file (not from restore file, but database which want to be restored)?thanks |
|
|
neubie
Starting Member
21 Posts |
Posted - 2008-11-27 : 03:10:56
|
hi, I'd tried move option, and this is the result:Server: Msg 3206, Level 16, State 1, Line 1No entry in sysdevices for backup device 'OLD'. Update sysdevices and rerun statement.Server: Msg 3013, Level 16, State 1, Line 1RESTORE FILELIST is terminating abnormally.Server: Msg 3206, Level 16, State 1, Line 2No entry in sysdevices for backup device 'OLD'. Update sysdevices and rerun statement.Server: Msg 3013, Level 16, State 1, Line 2RESTORE DATABASE is terminating abnormally.any advice? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-11-27 : 03:56:13
|
What was the syntax that you used?--Gail ShawSQL Server MVP |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-11-27 : 08:35:17
|
quote: Originally posted by neubie for sodeepdid you mean help in sql server for booksonline?sorry for this question, I really new in sql serveranyway, can "move option" restore database use current log file (not from restore file, but database which want to be restored)?thanks
No,it gets from restore file unless you are attaching only Mdf file.Show us your code for restore if you need help. |
|
|
neubie
Starting Member
21 Posts |
Posted - 2008-11-27 : 23:12:40
|
ok here the syntax:use mastergorestore filelistonly from OLDrestore database new from old with recovery,move 'old_data' to 'c:\program files\mssql\data\new_data.mdf',mofe 'old_log' to 'c:\program files\mssql\datat\new_log.ldf'go--> I'm not sure whether my code right or false, I just copied from help. please your advice. thanks |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-11-28 : 03:01:07
|
What is OLD? What are you trying to do? restore from a backup on disk?--Gail ShawSQL Server MVP |
|
|
neubie
Starting Member
21 Posts |
Posted - 2008-12-03 : 19:50:02
|
hi, sorry, got network problem.anyway, OLD is name of database that want to be grabbed its data. |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-12-04 : 03:40:17
|
You can't restore a database from an existing database, you can only restore a database from a database backup.Take a backup of the database Old, then restore that backup as the new database and use the move to specify new locations for the files.--Gail ShawSQL Server MVP |
|
|
|