INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Logical file is not part of database error

Logical file is not part of database error

(OP)
I am setting up my first restore stored procedure for my test server. I am getting the following error: Logical file is not part of database. RESTORE DATABASE is terminating abnormally

CODE

BEGIN
	RESTORE DATABASE [rptdata_ahs] FROM  DISK = N'D:\Backup\ahsfull.bak' 
	WITH  FILE = 1,  MOVE N'\\AMSPBI\F$\Data\rptdata_ahs' TO N'D:\Data\rptdata_ahs.mdf',  
	MOVE N'\\AMSPBI\F$\Data\rptdata_ahs_log' TO N'D:\Data\rptdata_ahs.ldf',  NOUNLOAD,  STATS = 10
END 

The current backup files are located on a server called \\AMSPBI\F$\Data
This code is being run on a server called AMSPBI2
I want the mdf and ldf files in the \\AMSPBI\F$\Data directory to be copied into the AMSPBI2 D drive Data dirctory

Any help is appreciated

Tom

RE: Logical file is not part of database error

(OP)
When I do a the restore command

RESTORE FILELISTONLY
FROM DISK = 'D:\Backup\ahsfull.bak'
GO

The results I get are:
Logical Name Physical Name
rptdata_ahs F:\Data\rptdata_ahs.mdf
rptdata_ahs_log F:\Data\rptdata_ahs_log.ldf

RE: Logical file is not part of database error

syntax for restore is move "logical_name" to "pysical_name"

so from your restore filelistonly its clear that the restore command should be

CODE

RESTORE DATABASE [rptdata_ahs] FROM  DISK = N'D:\Backup\ahsfull.bak' 
	WITH  FILE = 1,  
        MOVE N'rptdata_ahs' TO N'D:\Data\rptdata_ahs.mdf',  
	MOVE N'rptdata_ahs_log' TO N'D:\Data\rptdata_ahs.ldf',  NOUNLOAD,  STATS = 10 

Regards

Frederico Fonseca
SysSoft Integrated Ltd
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close