Reputation: 4250
I was wondering if it is possible to create database snapshots on an Azure SQL virtual machine. The following query:
CREATE DATABASE <DB_Name>_Snapshot on (
Name = <DB_Name>,
filename = '\<DB_Name>.ss'
) as snapshot of <DB_Name>;
Gives this error:
A database snapshot cannot be created because it failed to start.
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file '<DB_Name>.ss'
Normally this is a permissions issue which can be resolved by giving the SQL service account the relevant access but I can't work out if it can be done on an SQL virtual machine.
Upvotes: 0
Views: 483
Reputation: 16431
As I searched and found that Azure SQL VM support create database snapshots. It depends on you SQL Server version. Ref here: Editions and supported features of SQL Server 2016
Others get the same error which all caused by you are getting a permissions error. The account which is running the SQL Server doesn't have the needed rights on the folder which will contain the database files.
Solution: Check file to make sure it is inheriting permissions from parent and is not owned by single user.
You ref these blogs:
These links can give the guides to solve the problem.
Upvotes: 1