SQL Database backup fails with error "An error occurred on a query to database."

Article:TECH87628  |  Created: 2009-01-02  |  Updated: 2012-11-04  |  Article URL http://www.symantec.com/docs/TECH87628
Article Type
Technical Solution


Issue



SQL Database backup fails with error "An error occurred on a query to database."

 


Error



Backup -<Server name>
V-79-65323-916 - An error occurred on a query to database .
V-79-65323-916 - The server principal "<Domain name>\<user name>" is not able to access the database "<database name>" under the current security context.

 


Cause



The above error occurs in the job log while backing up SQL databases if the user account used for backing up the SQL databases does not have proper privileges.

 


Solution



The backup exec account should have the following rights for backing and restoring SQL databases:
1.  System Administrator role on the SQL instance. 
2.  db_datareader and db_datawriter on the master database of the SQL instance.
 
To give these rights follow the steps given below:
1) On the SQL server open the Microsoft SQL server Management Studio and connect to the SQL instance.
2) Right Click on "Security" and select New =>  Login (Figure 1).
Figure 1 :
 
 
3) On the "Login-New" window enter the Login name (backup exec account ) (Figure 2)
Figure 2 :
  
 
4) On "Select a page" option  select "Server Roles" ,Select the "sysadmin" role (Figure 3)
Figure 3 :
 
 
5) On the same "Select a page" option  select "User Mapping" (Figure 4)
6) Under "Users mapped to this login" select "master" database (Figure 4)
7) Under "Database role membership for: master" select "db_datareader" and "db_datawriter" (Figure 4)
Figure 4 :
 
 

Supplemental Materials

SourceUMI
ValueV-79-65323-916
Description

An error occurred on a query to database.

 




Legacy ID



326088


Article URL http://www.symantec.com/docs/TECH87628


Terms of use for this information are found in Legal Notices