This has to be the most popular error in taking database backups. There are many reasons for this error and there are different ways to resolve it. I recently faced this error and for a while I was taking backup and found a very interesting solution to the problem. The error was as mentioned below:
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device ‘d:\Log\aw.bak’. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Personally, I know this error happens when
- There is no directory with Log
- There is not enough space on drive d:\
- There is not enough permissions on d:\Log drive
In my case all of the above were not the reason for above error. The error was there because of the file was read only. There was already another backup file which existed in the folder with the name aw.bak and it was marked as read only. Due to the same reason, my backup was failing. Once I removed the checkbox for reading only, the backup was successful.
Here are few other blog posts related to this error, which I have written earlier.
- SQL SERVER – FIX – ERROR : Msg 3201, Level 16 Cannot open backup device . Operating system error 5(Access is denied.)
- SQL SERVER -Fix Error – Cannot open backup device. Operating system error 5(Access is denied.)
- SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )
- SQL SERVER – FIX : Error 3154: The backup set holds a backup of a database other than the existing database – SSMS
Reference: Pinal Dave (https://darkslategrey-bat-805937.hostingersite.com)