SQL Backup Fails.

  • My Maintenance job fails with "BackupDiskFile::CreateMedia: Backup device 'System\master_backup_2012_06_08_113121_5537116.bak' failed to create. Operating system error 5(Access is denied.).upDiskFile::CreateMedia: Backup device 'Server\System\master_backup_2012_06_08_113121_5537116.bak' failed to create. Operating system error 5(Access is denied.).

    I logged onto the server with the SQL Agent Service ID and was able to create and copy folders and files to the backup location so it cannot be a service ID issue.

    However, if I run a TSQL to that location, it fails because of access denied.

    I have the SA account being the owener of the jobs.

    Where or what permissions are incorrect? Again, please do not answer it is the serivice ID since I was able to copy, create and delete files in that location using the service ID.

  • On the job step that does the backup, is it set to "Run As' some other account?


    And then again, I might be wrong ...
    David Webb

  • No, it is set to run as "SQL Server Agent Service Account"

  • Are you running both SQL Server and SQL Server Agent with the same domain account? If not, grant access to the account running SQL Server.

    Backups run in the context of the account running SQL Server - not the account running SQL Server Agent.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • SQL & SQL Agent are both running the same service account.

  • Try setting the service accounts for SQL Agent and SQL Server Service to local system, restart SQL then change them back to your domain users, make this change using SQL Server Configuration manager not services.msc, I think the account you do this change as needs to be a local admin also.

  • Assuming the service account has access all the way down the folder hierarchy to the target folder, start at the topmost folder and try to have the job write the file to that root folder I think you mentioned \Server. Then, if successful add a folder under it and try again. Rinse and repeat, so to speak.

    I hate to assume anything but are you [sure] your job uses the exact same path that you tried manually?

  • If the SQLServer Service account is set during the initial install, or using the SQL Server Configuration Manager, shouldn't it have write access to all the drives, or at least the drives SQL is configured to use for data files, logs & backups? Maybe the OP is trying to write the backup to a different drive that SQL Service account doesn't have access to, or maybe a local drive from a clustered SQL instance?

  • Just thinking out loud...

    Have you restarted SQL Server since granting permissions on the UNC path you are attempting to back up to? Could it be that the current session has not picked up the new permissions yet?

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • This worked!!

  • This worked!!

  • anon1m0us1 (6/12/2012)


    This worked!!

    What worked?

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Guessing its restarting the SQL Server Services

  • I stopped service, changed the ID to local, restarted service. Stopped the service and changed back to the service ID.

  • anon1m0us1 (6/12/2012)


    I stopped service, changed the ID to local, restarted service. Stopped the service and changed back to the service ID.

    How are you changing the login for the service? I hope you are not doing it anywhere other than SQL Server Configuration Manager. If you are, that is your problem.

    Jared
    CE - Microsoft

Viewing 15 posts - 1 through 15 (of 18 total)

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