Permissions needed to run EXECUTE master..sqlbackup
jimholcomb
Posts: 4
I'm trying to give a user permission to run the following SQL:
EXECUTE master..sqlbackup N'-SQL "BACKUP DATABASE i]databasename[/i TO DISK = ''G:\SQLBackup\<AUTO>.sqb'' "'
and they get the following error message:
SQL error 15157: Setuser failed because of one of the following reasons: the database principal 'loginname' does not exist, its corresponding server principal does not have server access, this type of database principal cannot be impersonated, or you do not have permission.
The login is a user in the database to be backed up but is only a member of the Public server role. They can backup the database using the native backups.
How can I give this user permission to backup the database?
Thanks,
Jim
EXECUTE master..sqlbackup N'-SQL "BACKUP DATABASE i]databasename[/i TO DISK = ''G:\SQLBackup\<AUTO>.sqb'' "'
and they get the following error message:
SQL error 15157: Setuser failed because of one of the following reasons: the database principal 'loginname' does not exist, its corresponding server principal does not have server access, this type of database principal cannot be impersonated, or you do not have permission.
The login is a user in the database to be backed up but is only a member of the Public server role. They can backup the database using the native backups.
How can I give this user permission to backup the database?
Thanks,
Jim
Comments
That's a good question. The answer is that, since using the VDI interface to stream backup data requires more permissions than a standard SQL Server backup, it's absolutely necessary that the user doing the backup has sysadmin rights. This is a Microsoft requirement that we can do nothing to work around. According to the Microsoft Virtual Device Interface documentation:
Run the Red Gate SQL Backup agent as Local System. Job done.
Enjoy