Hi,
I am trying to RESTORE a copy of a database to the same instance with a different name. I've done this before, but this database has a .ndf file. A RESTORE FILELISTONLY produces the following logical and physical
Full_TLog_Test_Data Y:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Data.mdf
Full_TLog_Test_Data_XXXX Y:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Data_XXXX.ndf
Full_TLog_Test_Log X:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Log.ldf
The RESTORE syntax:
RESTORE DATABASE [Full_TLog_Test-RESTORE] FROM
DISK = N'Z:\directory\Full_TLog_Test_Full.bak'
WITH FILE = 1, MOVE N'Full_TLog_Test_Data' TO N'Y:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Data-RESTORE.mdf',
MOVE N'Full_TLog_Test_XXXX' TO N'Y:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_XXXX-RESTORE.ndf',
MOVE N'Full_TLog_Test_Log' TO N'X:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Log-RESTORE.ldf',
NOUNLOAD, STATS = 10, NORECOVERY
Gives me the following error:
Msg 1834, Level 16, State 1, Line 1
The file 'Y:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Data_XXXX.ndf' cannot be overwritten. It is being used by database 'Full_TLog_Test'.
Msg 3156, Level 16, State 4, Line 1
File 'Full_TLog_Test_Data_XXXX' cannot be restored to 'Y:\InstanceName\TEST\FullBackupTest\Full_TLog_Test_Data_XXXX.ndf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Thanks for the time