Solved

SQL Server Restore Database from a backup file

Posted on 2006-11-25
7
6,573 Views
Last Modified: 2010-05-18
I am receiving the following error message when trying to perform a file restore from a backup file named LIPData_Backup.bak ....

File 'G:\Golf' (Pathway) is claimed by 'LIPData_Log'(2) and 'LIPData_dat'(1).  The WITH MOVE Clause can be used to relocate one or more files.
Restore Database is terminating Abnormally.

What am I doing incorrectly, or what can I do differently to restore the database from a .BAK file?


Thank you ~ Stephen
0
Comment
Question by:sbosco21
  • 2
7 Comments
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 168 total points
Comment Utility
Hi sbosco21,

It looks like you are trying to restore the backup - and the database which the backup was created from still exists.  This means that the files are trying to restore over the top of the existing database.  Using the "WITH MOVE" will allow you to specify exactly where you want the files (.mdf and .ldf) to be for the restored database.  Note that the files will try and restore to the same location that they were in when the backup was taken (by default).

From BOL:

RESTORE DATABASE TestDB
   FROM DISK = 'c:\Northwind.bak'
   WITH MOVE 'Northwind' TO 'c:\test\testdb.mdf',
   MOVE 'Northwind_log' TO 'c:\test\testdb.ldf'

will restore the Northwind database to c:\test\

Cheers,
Hillwaaa
0
 
LVL 28

Assisted Solution

by:imran_fast
imran_fast earned 166 total points
Comment Utility

Right Click Database Folder --> Click Restore Database---> Specify Database Name and click on Device radio button
--> select the database file --> check the check box -->
Now select option from the Tab and specify the ldf and mdf file path--> click ok--> click ok
0
 
LVL 69

Assisted Solution

by:ScottPletcher
ScottPletcher earned 166 total points
Comment Utility
If the db is being restored to the same server it came from, and **you know for sure** that you want to overwrite the previous version of the db that still exists on disk [that is, you want to put the db back over where it was before], either:

1) In Enterprise Mgr, check the "Force Restore over existing database" box
2) In RESTORE command, add the "WITH REPLACE" clause

RESTORE DATABASE DatabaseName
    FROM DISK = ...
    WITH REPLACE
0
 
LVL 16

Expert Comment

by:Hillwaaa
Comment Utility
Perhaps a split?  All are valid solutions for this problem.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now