Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logical file is not part of database error

Status
Not open for further replies.

vba317

Programmer
Mar 5, 2009
708
US
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
 
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

 
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

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top