Access Denied while trying to Delete *.CKP files

  • Hi,

    I have been beating my head against the wall on this for a few days so I thought I would just put in an entry here and see of anyone has any insight.

    I am log shipping on 2 different sets of servers (all standard edition), one is SQL 2005 => SQL 2008, the other is SQL 2008 => SQL 2008. But I am getting the same error in both cases. Here it is:

    --------------------------------------

    Log Name: Application

    Source: MSSQLSERVER

    Date: 4/10/2012 9:50:01 AM

    Event ID: 3634

    Task Category: Backup

    Level: Error

    Keywords: Classic

    User: MyDomain\administrator

    Computer: MYSERVER.MyDomain.com

    Description:

    The operating system returned the error '5(Access is denied.)' while attempting 'DeleteFile' on 'G:\MSSQL\Backup\RestoreCheckpointDB10.CKP'.

    --------------------------------------

    I have tried everything I can think of to remedy this and still get the errors.

    Here's what I have tried so far:

    (1) the SQL Servers and SQL agent both run under MyDomain\Administrator on the Source and Target servers, so...

    ----------------------------------------------------------------------------

    Put MyDomain\Administrator in the Administrators group on the machine.

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQLServer\BackupDirectory

    Value is G:\MSSQL\Backup

    The Key permissions show MyDomain\Administrators has full control.

    ----------------------------------------------------------------------------

    (2) Checked security on all the folders and shares involved in log shipping. The service account MyDomain\Administrator has full rights to all folders and shares.

    Neither (1) nor (2) did the trick. Frankly, I have been doing log shipping for a long time (since SQL 2000) and have not encountered this before.

    Any insight or help would be appreciated.

    G. Milner

  • Greg Milner (4/10/2012)


    The operating system returned the error '5(Access is denied.)' while attempting 'DeleteFile' on 'G:\MSSQL\Backup\RestoreCheckpointDB10.CKP'.

    --------------------------------------

    (2) Checked security on all the folders and shares involved in log shipping. The service account MyDomain\Administrator has full rights to all folders and shares.

    Check the security properties of the file itself, what ACLs are bound there?

    Is the file being held open by a process?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I have seen this error when two SQL Server are primary log shipping targets and both use the same default backup share. Using Ola Hollengren's backup solution I have all my servers backing up to the same backup share and the backup solution creates subdirectories for each server. So the backups are going to their own directories but because they have the same default backup location they sometimes collide when creating the CKP file.

    For example from server A

    DATE/TIME:4/22/2016 2:30:26 PM

    DESCRIPTION:The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'DeleteFile' on '\\MyShareName\SQLBackupsProduction\RestoreCheckpointDB17.CKP'.

    And on server B

    DATE/TIME:4/22/2016 2:30:25 PM

    DESCRIPTION:The operating system returned the error '32(The process cannot access the file because it is being used by another process.)' while attempting 'DeleteFile' on '\\MyShareName\SQLBackupsProduction\RestoreCheckpointDB17.CKP'.

    If I remember right changing the default backup location to be unique to each server solved the problem

Viewing 3 posts - 1 through 2 (of 2 total)

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