Comments
2 comments
-
SQL Backup performs checks on the logged on user to determine if you have adequate rights to perform database restores. One of those checks require it to impersonate the user, hence the use of the SETUSER command.
Could you please try logging in as another user to perform the restore? The user does not need to have sysadmin rights, just rights to perform the restore and use the SQL Backup extended stored procedure. -
I tried the restore with another account with sysadmin rights but I got the same results. I am trying it with the SA account and it looks like it is working. What rights do I need to give these other accounts in order to do the restore?
Add comment
Please sign in to leave a comment.
FROM DISK = ''\\ABC\g$\SQLBackup\SQLe01\SQL2005\X-20071030_030444_full.sqb''
WITH RECOVERY,
MOVE ''XNewStructure'' TO ''\\ABC\h$\MSSQL2005\XRestore10302007.mdf'',
MOVE ''XNewStructure_log'' TO ''\\ABC\h$\MSSQL2005\XRestore10302007_Log.ldf''
"'
SQL Backup v5.0.0.2770
Restoring XRestore10302007 (database) on SQL2005 instance from:
\\ABC\g$\SQLBackup\SQLe01\SQL2005\X-20071030_030444_full.sqb
Error 890: RESTORE DATABASE permission denied for database: (XRestore10302007)
SQL error 15157: Setuser failed because of one of the following reasons: the database principal 'THEMAN' 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.
SQL Backup exit code: 890
SQL error code: 15157
'THEMAN' has sysadmin (all server roles) rights.
SQL Backup Agent is running as Local System.
I was able to run these commands just fine:
master..sqlbackup '-SQL "RESTORE FILELISTONLY FROM DISK = ''\\ABC\g$\SQLBackup\SQLe01\SQL2005\X-20071030_030444_full.sqb''"'
master..sqlbackup '-SQL "RESTORE SQBHEADERONLY FROM DISK = ''\\ABC\g$\SQLBackup\SQLe01\SQL2005\X-20071030_030444_full.sqb''"'
master..sqlbackup '-SQL "RESTORE VERIFYONLY FROM DISK = ''\\ABC\g$\SQLBackup\SQLe01\SQL2005\X-20071030_030444_full.sqb''"'