File is locked

jrandalljrandall Posts: 35
edited October 19, 2009 10:17AM in SQL Backup Previous Versions
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
-------------------------------------------------------------------------------------
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

  • Cut and paste error, here is the command...

    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
  • Hi there,

    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
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • No anti-virus software, but we do have Backup Exec running
  • Thanks for your reply.

    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
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
  • Stopping Backup Exec does not resolve the problem
  • Ok. Would it be possible for you to right click on the failed restore job in the GUI of SQL Backup and send me the error log for this?

    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
    Peter Peart
    Red Gate Software Ltd
    +44 (0)870 160 0037 ext. 8569
    1 866 RED GATE ext. 8569
Sign In or Register to comment.