Solved

SQL Server Restore Database from a backup file

Posted on 2006-11-25
7
6,589 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 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:Scott Pletcher
Scott Pletcher 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

626 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