Backup db file due to Operating system error 32(The process cannot access the file because it is being used by another process.) RRS feed

  • Question

  • hi folks:

      I have a backup job that does simple db backup: backup database xyz to disk ='F:\DailyBackup\xyz.bak' with init . I've wrapped it into a 

    schedule job and have it run on a daily basis in the evening. However, starting earlier last month , this job failed sporadically, 

    sometimes, it succeeded one day but the next day failed. Error msg is below:

    Cannot open backup device 'F:\DailyBackup\xyz.bak'. Operating system error 32(The process cannot access the file because it is being used by another process.). 

    I've googled and someone suggested it would be msft defender antivirus . confirmed with security dept and they only run defender once per week.

    Is there anyway to make sure all process on this xyz.bak have been cut prior to the backup db command? 



    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Wednesday, June 5, 2019 7:19 PM

All replies

  • Hi Hui,

    Please try to follow below steps to identify the process that is accessing the backup file when the backup job failed.

    1.Download Process Explorer from the Microsoft website and run it on the computer that you have the backup job.
    2.Then press Ctrl+F or use Menu option “Find” > “Find Handle or DLL”
    3.In the Handle or DLL substring box, type the full backup path and file name, then click Search. 
    4.Process Explorer displays the applications that are currently accessing the file. Stop the application from accessing the file, or run the backup at a time when the application is not accessing the file. 

    Best regards,
    Cathy Ji

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to  MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Thursday, June 6, 2019 2:50 AM