File is locked
jrandall
Posts: 35
Attempting to restore a tlog backup file on the destination server in a log shipping scenario. Getting a File Locked error. I have tried performing the restore remotely (backup is located on the source server), and I have tried restoring after moving the backup file to the destination server. Get the same results each time.
Here is the command I am using:
SQL Backup v6.2.0.134
File is locked: E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb
Warning 220: No log files found to be restored.
SQL Backup exit code: 220
(5 row(s) affected)
name value
exitcode 220
sqlerrorcode 0
filename001 E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb
(3 row(s) affected)
Here is the result:
SQL Backup v6.2.0.134
Here is the command I am using:
SQL Backup v6.2.0.134
File is locked: E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb
Warning 220: No log files found to be restored.
SQL Backup exit code: 220
(5 row(s) affected)
name value
exitcode 220
sqlerrorcode 0
filename001 E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb
(3 row(s) affected)
Here is the result:
SQL Backup v6.2.0.134
------------------------------------------------------------------------------------- File is locked: E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb Warning 220: No log files found to be restored. SQL Backup exit code: 220 (5 row(s) affected) name value ---------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- exitcode 220 sqlerrorcode 0 filename001 E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb (3 row(s) affected)
Comments
DECLARE @errorcode INT
DECLARE @sqlerrorcode INT
EXECUTE master..sqlbackup N'-SQL "RESTORE LOG [TankData] FROM DISK = [E:\SQL_BKUP\TankData\LogShip\TMC-SQLHA_SUPPLYNET_TankData_LOG__20091016_005900.sqb] WITH NORECOVERY
, MOVETO = [E:\SQL_Bkup\TankData\Tlog]
, ERASEFILES = 3
, FILEOPTIONS = 1"'
, @errorcode OUT
, @sqlerrorcode OUT;
IF (@errorcode >= 500) OR (@sqlerrorcode <> 0)
BEGIN
RAISERROR ('SQL Backup failed with exit code: %d SQL error code: %d', 16, 1, @errorcode, @sqlerrorcode)
END
GO
Sorry you are receiving this error; do you have any anti virus software on the target server that is set to automatically scan any files once they are opened?
Pete
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569
Can you confirm if this behaviour demonstrates itself when Backup Exec is disabled, or if Backup Exec is currently using the file when you are attempting the restore?
Pete
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569
You can send it to support(at)redgate.com and mark it for the attention of me. If you can also quote reference F0027768 that would be great.
Pete
Red Gate Software Ltd
+44 (0)870 160 0037 ext. 8569
1 866 RED GATE ext. 8569