Teoman Sahin
asked on
Logical name is not part of database--ERror...
I would like to daily task which backups the database Roll_1C then restore from last backup Roll_1C.bak to database Roll_2C on the same server in sql server 2008 so I have a script for this task so first step to backup this Roll_1C database is working properly but the second step to restore other database Roll_2C is not working ..what should we do?
Msg 3234, Level 16, State 2, Line 1
Logical file ' Roll_1C_Test' is not part of database 'Roll_2C'. Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
here is the script
USE master
GO
RESTORE FILELISTONLY
FROM DISK = 'E:\Backup\Roll_1C.bak'
Logical name; PhysicalName;
Roll_1C_Test e:\ProgramFiles\...\Data\R oll_1C_Tes t.mdf
Roll_1C_Test_log e:\ProgramFiles\...\Data\R oll_1C_Tes t_1.ldf
RESTORE DATABASE [Roll_2C] FROM DISK = 'E:\Backup\Roll_1C.bak'
WITH REPLACE,NORECOVERY,
MOVE ' Roll_1C_Test' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSER VER\MSSQL\ Data\Roll_ 2C.mdf ',
MOVE ' Roll_1C_Test_log' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSER VER\MSSQL\ Data\Roll2 C_log.LDF '
GO
database Roll2C;
logical names Physical names
Roll_1C_Test Roll_2C.mdf
Roll_1C_Test_log Roll2C_log.LDF
Msg 3234, Level 16, State 2, Line 1
Logical file ' Roll_1C_Test' is not part of database 'Roll_2C'. Use RESTORE FILELISTONLY to list the logical file names.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
here is the script
USE master
GO
RESTORE FILELISTONLY
FROM DISK = 'E:\Backup\Roll_1C.bak'
Logical name; PhysicalName;
Roll_1C_Test e:\ProgramFiles\...\Data\R
Roll_1C_Test_log e:\ProgramFiles\...\Data\R
RESTORE DATABASE [Roll_2C] FROM DISK = 'E:\Backup\Roll_1C.bak'
WITH REPLACE,NORECOVERY,
MOVE ' Roll_1C_Test' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSER
MOVE ' Roll_1C_Test_log' TO 'E:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSER
GO
database Roll2C;
logical names Physical names
Roll_1C_Test Roll_2C.mdf
Roll_1C_Test_log Roll2C_log.LDF
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then do the same for restoring. Once you have your basic scripts, then you can modify them. In the restore windows, click on the Script to a new query window.
Hope that helps.