What are the challenges you face when working across database platforms? Take the survey

Restore is failing

st8floorsupst8floorsup Posts: 27
edited November 7, 2007 10:18AM in SQL Backup Previous Versions
master..sqlbackup N'-SQL "RESTORE DATABASE [XRestore10302007]
FROM DISK = ''\\ABC\g$\SQLBackup\SQLe01\SQL2005\X-20071030_030444_full.sqb''
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:

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''"'


  • Options
    peteypetey Posts: 2,358 New member
    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.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Options
    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?
Sign In or Register to comment.