Table of Contents

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

Article ID: 5294
Reviewed: 2018-01-26

Product Version:
AhsayOBM: Post-7.3.0.0
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
'temp_path\backupset_id\...\db_name\db_name.bak.YYYY-MM-DD-hh-mm-ss.ADD'.
Operating system error 5 (Access is denied.).
* ... ... ...

Cause

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

Resolution

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:

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



Note:
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.

Keywords

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