Posted by Seguros Catatumbo on 11/16/07 12:09
> RESTORE DATABASE db FROM DISK ='filenamehere'
> WITH MOVE 'logicalname1' TO 'path.mdf',
> MOVE 'logicalname2' TO 'path_log.ldf',
> REPLACE
>
Hey Erland, thanks for replying. I couldn't get it to work. Here's the
command:
RESTORE DATABASE db FROM DISK ='c:\publica\web_db_200711150500.bak'
WITH MOVE 'WEB_Data' TO 'c:\pruebadb\web_dos.mdf',
MOVE 'WEB_Log' TO 'c:\pruebadb\web_dos_log.ldf',
REPLACE
Here's the error message:
The file 'c:\pruebadb\web_dos.mdf' cannot be overwritten. It is being
used by database 'web'.
File 'WEB_Data' cannot be restored to 'c:\pruebadb\web_dos.mdf'. Use
WITH MOVE to identify a valid location for the file.
The file 'c:\pruebadb\web_dos_log.ldf' cannot be overwritten. It is
being used by database 'web'.
File 'WEB_Log' cannot be restored to 'c:\pruebadb\web_dos_log.ldf'.
Use WITH MOVE to identify a valid location for the file.
RESTORE DATABASE is terminating abnormally.
Here's the output of sp_helpdb on the source db and destination db:
source:
WEB_Data
1 D:\DataWEB\Data
\web_Data.MDF
PRIMARY 4348096 KB Unlimited 5120 KB data only
WEB_Log
2 D:\DataWEB\Data
\web_Log.LDF
NULL 32448 KB Unlimited 10% log only
destination:
WEB_Data
1 C:\pruebadb
\web_dos.mdf
PRIMARY 2092928 KB Unlimited 5120 KB data only
WEB_Log
2 C:\pruebadb
\web_dos_log.ldf
NULL 1024 KB Unlimited 10% log only
The c:\publica\web_db_200711150500.bak was obtained from a backup made
by sql server itself on the source server itself
[Back to original message]
|