Warning 161 and Error Code 32

khickman32khickman32 Posts: 7 Bronze 1
edited August 24, 2016 1:40AM in SQL Backup Previous Versions
We are currently backing up 9 of our User databases to the local server and then copying the backup files to a network location. We delete the local backup files that are older than 1 day and we delete the network backup files older than 7 days. The backup files are successfully being copied to the network location and SQL Backup 7 is successfully deleting the older local backup files, but we are randomly receiving the error "Warning 161: ERASEFILES error: Failed to delete file: "\serverfoldersqlservernameackupfilename". Error code: 32 (The process cannot access the file because it is being used by another process)" when deleting the network backup files. This error occurs on random days and on random databases. There is no consistency. We have other SQL Servers using SQL Backup 7 using the same method without errors. I downloaded and ran process explorer to see what process or application was accessing the backup files and there were no locks on the file. I then manually ran the SQL Backup 7 backup job and received the same warning and error above. Any help you can provide in resolving this error would be greatly appreciated. Thanks.

Comments

  • peteypetey Posts: 2,358 New member
    Is your network share a Windows box too? If so, you should run Process Explorer there to see if any applications on that box are accessing the files.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Yes the network share is a windows box as well and that is where I ran the Process Explorer and no applications or processes are accessing the files.
  • peteypetey Posts: 2,358 New member
    Could you please send me the contents of any single log file that shows the error? SQL Backup generates a log file for each process that it runs. The default folder where the logs are stored is C:ProgramDataRed GateSQL BackupLog<instance name>, unless you're using Windows 2003 or older OSs, for which the default folder is then 'C:Documents and SettingsAll UsersApplication DataRed GateSQL BackupLog<instance name>'. You can send the log file to peter.yeoh@red-gate.com.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • I have sent you an email with the requested log file. Thanks!
  • peteypetey Posts: 2,358 New member
    Thanks for sending the log over.

    Do you have a scheduled job that backs up the transaction log for the same set of databases, which also copies files to the same network share and also uses the ERASEFILES option? If you do, could you please post the backup command that's used to back up the transaction logs? Thanks.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Yes, we backup the transaction log at 1 AM, but these files are not copied to a network share. The local backup log files are deleted after 1 day.
  • peteypetey Posts: 2,358 New member
    In that network share (\W*****3SQLBackupsW****E'), are there any other backup files stored in there that is not copied from this server?
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • No, there are no other files or folders in that directory from other servers. There are other folders from other SQL Servers under the SQLBackups folder that use the same method with SQL Backup 7 and we are not having any issues with those.
  • peteypetey Posts: 2,358 New member
    Is this server only recently been copying the backup files to the network share, relative to the other servers that are not having issues?
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • No, this server was created several months back and all SQL servers were setup to copy their backup files to this server around the same time. The nightly backups for each server are ran at different times, so they won't conflict with resources as well.
  • peteypetey Posts: 2,358 New member
    I have created a support ticket for this issue for easier communication.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
Sign In or Register to comment.