Error Message "An error occurred on a query to database master" is displayed in the job log when restoring master database to a Microsoft SQL server where the master database location has changed.

Article:TECH46320  |  Created: 2006-01-17  |  Updated: 2012-01-06  |  Article URL http://www.symantec.com/docs/TECH46320
Article Type
Technical Solution

Product(s)

Problem



Error Message "An error occurred on a query to database master" is displayed in the job log when restoring master database to a Microsoft SQL server where the master database location has changed.


Error



"An error occurred on a query to database master" on restoring Master Database.


Cause



This error message would occur in the job log while restoring Master Database for Disaster Recovery of a Microsoft SQL Server, if the path in which the Master Database is located is not same as its location at the time of backup. For instance, if master database files were initially located on a location like C:\SQL\Data and after disaster recovery, SQL has been installed on a different location and the data now points to D:\SQL\DATA, then this error would occur at the time of restore. The reason for this error message is that Backup Exec looks for the original location while restoring the master database.


Solution



In order to get around this, the master database needs to be temporarily moved to an original location where it was located at the time of backup. This can be achieved by going through the following procedure:

1. Open Enterprise manager, right click on the SQL instance and go to Properties.
 
Figure 1

 

2. Click on Startup Parameters 
 
Following screen is displayed as Startup Parameters 
 
Figure 2
 
 

3. The current location of master database as shown in the path followed by -d is D:\sqldata, whereas the original location was at C:\SQL\Data.
-d is the fully qualified path for the master database data file, master.mdf.
-e is the fully qualified path for the error log file.
-l is the fully qualified path for the master database log file, mastlog.ldf.
 
Change these values as follows:  
  • Remove the current entries for the Master.mdf and Mastlog.ldf files.
  • Add new entries specifying the new location of Master.mdf and mastlog.ldf files as C:\SQL\Data as shown .

Figure 3

   
 

4. Stop SQL service.

5. Create a temporary folder, C:\SQL\Data where the original SQL database files were located. Copy the master.mdf and mastlog.ldf files from D:\SQLData to C:\SQL\Data.
6. Start SQL service.
7. Start the Restore of master database with "Automated master restore" checked. It should end as successful.
8. After the Restore is completed and SQL service is started back, the changes made from step 1 through 3 need to be reverted so that master database points back to the original location.

Supplemental Materials

SourceError Code
Value0xe0008492
Description

Database Query Failure. See the job log for details



Legacy ID



281881


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


Terms of use for this information are found in Legal Notices