I have log shipping enabled on my database. I created a file, with let's say
logical name 'AB' of 50 MB at location
E:\Databases\AB.ndf. However, I later dropped this file and created another file with
logical name 'AB_File' of 10 MB at same location
E:\Databases\AB.ndf. Now the server where the backup was moved to is failing with error:
Error: 1) Could not apply log backup file 'some location of a .trn file' to secondary database 2)The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'E:\Databases\AB.ndf'. 3) File 'AB_File' cannot be restored to 'E:\Databases\AB.ndf'. Use WITH MOVE to identify a valid location for the file.
I have tried running the following script:
RESTORE LOG [db_name] FROM DISK = 'E:\Log_Shipping\\db_name_20160817070500.trn' WITH MOVE 'AB_FILE' TO 'E:\Databases\AB.ndf', standby = N'E:\Databases\\db_name_20160818.tuf'
I don't seem to be able to fix this. Please help!
The file location on the backup server is the same as that on primary server. Also, the file-group was dropped and the file names are correct.