Copying backup causes periodic failure

  • I am running a job to backup my databases everyday. The first step uses a vbscript to delete old backups using VB Files Scripting object (objFSO.DELETEFILE filename) Most days this works but periodically the job fails with the message "Executed as user: WRHA001DB01\Dbms. Error Code: 0 Error Source= Microsoft VBScript runtime error Error Description: Permission denied Error on Line 62. The step failed." Line 62 is my DELETEFILE statement. Even if I don't do a thing this job will typically work fine the next time it runs. I am confused as to why it fails then works again I was unable to find anything in the SQL Server log or in the EVENT viewer. Does anyone have any idea as to what might be happening other than a mischievous server admin changing file permissions and then changing them back again periodically? The id this job runs under is a locally defined id that is a member of the local Administartors group and a member of the sysadmin server role. It is the id that SQL Server runs under.

    Francis

  • Are the files taken by a running backup job?

    Are you then copying the files to a tape drive?

  • Most likely the file is in use by some process, either the backup process or some tape process.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/

    http://www.dkranch.net

  • The files are copied by an ARCSERV process but I didn't think this process runs at the same time as my database backup job. I will check into the times to verify. Thanks. At least I have something to check into now.

    Francis

  • It can be surprising how many times a tape backup needs a second tape, but this tape never gets mounted. The backp then hangs until someone notices it, often the following day when it is time to run the backups again. In the meantime, the backup job holds locks on the files that need to be committed to tape.

    If this happens, then obviously the tape backup that hung is not complete and potentially not useable for a restore. Even though management may feel thay have good DR because tapes are sent offsite, they may not realise that only tape 1 of n is offsite and that the D strategy is missing the R bit...

    All information provided is a personal opinion that may not match reality.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply