User Tools

Site Tools



Ahsay Backup Software

Backup Set Types

Supported Storage

Features in OBM / ACB

Features in CBS

Brand and Customize



Performance Testing

FAQs and Known Issues

Can't Find What You Need?


[V7] ISSUE: Operating system error 5 (Access is denied) (MS SQL database backup)

Article ID: 5294
Reviewed: 2018-01-26

Product Version:
AhsayOBM: Post-
OS: Windows

ATTENTION 1st January, 2022: v7 officially End-of-Life [details]

Problem Description

When performing a MS SQL database backup (ODBC backup mode), the following warning message is received in the backup report:

No. Type Timestamp Log
* ... ... ...
* info ... [Start] Backing up "SQL_hostname\MSDB\db_name" ... to "temp_path"
* warn YYYY/MM/DD hh:mm:ss [Microsoft][ODBC SQL Server Driver][SQL Server] Cannot open backup device
Operating system error 5 (Access is denied.).
* ... ... ...


The message suggests that there was a permission issue when attempting to access the temporary directory for storing backup files.


To resolve the issue, ensure that the folder configured for the Temporary directory for storing backup files setting can be accessed by the SQL Server (MSDB) service:

On the other hand, if the temporary directory is set to a network share, for SQL Server to access a remote disk, the SQL Server service account must have access to the network share. The availability of network drives and permissions depends on the context in which SQL Server service is running:

  • To back up to a network drive when SQL Server is running in a domain user account, the shared drive must be mapped as a network drive in the session where SQL Server is running. If you start Sqlservr.exe from the command line, SQL Server sees any network drives you have mapped in your login session.

  • When you run Sqlservr.exe as a service, SQL Server runs in a separate session that has no relation to your login session. The session in which a service runs can have its own mapped drives, although it usually does not.

  • You can connect with the network service account by using the computer account instead of a domain user. To enable backups from specific computers to a shared drive, grant access to the computer accounts. As long as the Sqlservr.exe process that is writing the backup has access, it is irrelevant whether the user sending the BACKUP command has access.

  • Reference:
Alternatively, you can also re-creating a new MS SQL Server backup set in VSS backup mode (supported since AhsayOBM version, which will not output the database file to the temporary directory:

There are some limitations to the VSS backup mode, refer to the Limitation and Backup Mode sections of the AhsayOBM Microsoft SQL Server Backup and Restore Guide for details.


sql, odbc, temp, vss, access, denied, mssql

public/5294_operating_system_error_5.txt · Last modified: 2021/12/16 06:11 by anna.olalia

Page Tools