Sometimes when you backup your SQL Server using SQLBackupAndFTP, SSMS or T-SQL Commands you can face the following issue Cannot Open Backup Device Operating System Error 5(Access is Denied). This has to be the most famous issue in taking SQL Server database backups. There are several reasons for this error and there are various ways to solve it. Some time ago we met this issue and for a time we were creating a backup and discovered a very helpful resolution to the issue. The issue was as described beneath:
Msg 3201, Level 16, State 1, Line 4 Cannot open backup device 'D:\Adventureworks.bak'. Operating system error 5(Access is denied.). Msg 3013, Level 16, State 1, Line 4 BACKUP DATABASE is terminating abnormally.
- That error might appear when you try to backup the SQL Server database to a network drive.
- Therefore, this problem message usually occurs as a result of mistaken permissions to the network drive.
- Also, this issue can occur when there’s no directory with Log or there is not enough space on your drive.
How to Fix Cannot Open Backup Device Operating System Error 5(Access is Denied)
If you get that error using SQLBackupAndFTP try to specify a temporary folder for the backup job like C:\Temp and check if it fixes the issue.
If it still throws the same error, or you get this issue using SQL Server Management Studio please check NTFS permissions for the folder you have specified and make sure if all users of your system have all permissions to it.
To avoid the issues related to NTFS permissions we recommend you don’t use a folder in your profile folder like C:\Users\….
Another but the more rare reason for which this issue may arise is that a backup file with the same name already exists in the folder and it’s Read-Only. To fix it just right-click on it then choose “Properties”, uncheck Read-Only, and press “Apply” to save all-new settings.
If “Read-Only” is unchecked but you still have this issue go to the “Security” and give all necessary permission to the user.
After all necessary configurations are done you will be able to perform SQL Server database backup successfully.