Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

restore a .bak file

I am currently using database ow1222
I want to restore a backup and call it ow1222b

RESTORE FILELISTONLY FROM DISK = 'd:\ow1222\ow1222aug16.bak'
d:\ow1222\ow.mdf
d:\ow1222\ow_log.ldf




RESTORE DATABASE ow1222b
   FROM DISK= 'd:\ow1222\ow1222aug16.bak'
   WITH MOVE 'ow' TO 'd:\ow1222\ow.mdf',
   MOVE 'ow_Log' TO 'd:\ow1222\ow_log.ldf'



Msg 1834, Level 16, State 1, Line 1
The file 'd:\ow1222\ow.mdf' cannot be overwritten.  It is being used by database 'ow1222'.
Msg 3156, Level 16, State 4, Line 1
File 'ow' cannot be restored to 'd:\ow1222\ow.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 1834, Level 16, State 1, Line 1
The file 'd:\ow1222\ow_log.ldf' cannot be overwritten.  It is being used by database 'ow1222'.
Msg 3156, Level 16, State 4, Line 1
File 'ow_log' cannot be restored to 'd:\ow1222\ow_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Avatar of mnachu
mnachu
Flag of United States of America image

May be you should rename your existing database before restoring the new one with the same name.

Regards,
Nachi
Avatar of rgb192

ASKER

>>May be you should rename your existing database before restoring the new one with the same name.


i cant rename database because I am using it... are there other options
ASKER CERTIFIED SOLUTION
Avatar of DBAduck - Ben Miller
DBAduck - Ben Miller
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

thanks