Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQL Server Restore Database from a backup file

Posted on 2006-11-25
7
Medium Priority
?
6,590 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
7 Comments
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 672 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 664 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 70

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 664 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

715 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