Solved

SQL Server Restore Database from a backup file

Posted on 2006-11-25
7
6,579 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
ID: 18013177
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
ID: 18013674

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
ID: 18020528
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
ID: 18263861
Perhaps a split?  All are valid solutions for this problem.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

920 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