Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQL server restore a bak file Command Error

Posted on 2011-04-28
3
Medium Priority
?
621 Views
Last Modified: 2012-05-11
Hello,
I'm trying to run this command in SQL server but im getting below error can you help me please

Create database testImport
Go
RESTORE DATABASE testImport
   FROM DISK = 'C:\WIH.BAK' WITH
REPLACE
Go




Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "D:\Shared\Act 2009\ACT_Master_DB.ADF" failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 1
File 'ACT_DATA' cannot be restored to 'D:\Shared\Act 2009\ACT_Master_DB.ADF'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Line 1
Directory lookup for the file "D:\Shared\Act 2009\ACT_Master_DB.ALF" failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 1
File 'ACT_LOG' cannot be restored to 'D:\Shared\Act 2009\ACT_Master_DB.ALF'. 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.
0
Comment
Question by:ankouny
  • 2
3 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35483685
The backup is trying to restore to this location : D:\Shared\Act 2009\ but it doesn't exist, create the folder structure then restore again
0
 

Author Comment

by:ankouny
ID: 35483724
How can I specify the path and change it  ?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 total points
ID: 35483781
RESTORE DATABASE testImport
   FROM DISK = 'C:\WIH.BAK' WITH
REPLACE,
MOVE 'ACT_DATA' TO 'c:\temp\ACT_Master_DB.ADF',
MOVE 'ACT_LOG' TO 'c:\temp\ACT_Master_DB.ALF'
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

569 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