October 30, 2008 at 11:32 pm
Hi,
I am trying to restore a backup to a new DB usign the following snippet.
RESTORE DATABASE
FROM DISK = 'BackupFilePath\backupFileName.bak'
WITH MOVE 'DB_Template' TO ,
MOVE 'DB_Template_log' TO
The error msg i get is..
ERROR:
Logical file 'DB_Template' is not part of database 'DatabaseName'. Use RESTORE FILELISTONLY to list the logical file names.
RESTORE DATABASE is terminating abnormally.
Kindly help
October 31, 2008 at 7:29 am
From BOL:
Copying a database using BACKUP and RESTORE
The following example uses both the BACKUP and RESTORE statements to make a copy of the AdventureWorks database. The MOVE statement causes the data and log file to be restored to the specified locations. The RESTORE FILELISTONLY statement is used to determine the number and names of the files in the database being restored. The new copy of the database is named TestDB. For more information, see RESTORE FILELISTONLY (Transact-SQL).
BACKUP DATABASE AdventureWorks
TO AdventureWorksBackups ;
RESTORE FILELISTONLY
FROM AdventureWorksBackups ;
RESTORE DATABASE TestDB
FROM AdventureWorksBackups
WITH MOVE 'AdventureWorks_Data' TO 'C:\MySQLServer\testdb.mdf',
MOVE 'AdventureWorks_Log' TO 'C:\MySQLServer\testdb.ldf';
GO
So it sounds like the logical name of your database is not DB_Template or whatever you may have actually had in there.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
October 31, 2008 at 7:39 am
Yup. That's the issue. Thanks for the reply
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply