How to restore a Microsoft SQL Server Master Database with Backup Exec for Windows Servers (Automate Master Database Restore)

Article: 100016296
Last Published: 2018-03-26
Ratings: 0 0
Product(s): Backup Exec

Problem

How to restore a Microsoft SQL Server Master Database with Backup Exec for Windows Servers (Automate Master Database Restore)

Solution

If the master database is damaged, symptoms may include:

1. An inability to start SQL
2. Segmentation faults or input/output errors
3. A report generated by the SQL Database Consistency Checker utility (DBCC)

If you can still start SQL, you can restore the latest copy of the master database backup using the Automate master database restore option in the Backup Exec Restore Job Properties for SQL dialog box and then restore any other databases, if required.

If the master database is critically damaged and SQL cannot be started, rather than running the Rebuild Master utility or reinstalling SQL to be able to restart SQL, you can replace the corrupt or missing databases with the copies of the master and model databases that Backup Exec automatically creates and updates whenever backups of those databases are run.

How to replace the corrupt or missing master database and log files with the copies of the master database and log  files:

1. Go to the MSSQL folder on the Server where SQL is installed (Figure 1)
  Image


2. Go to the data folder under MSSQL (Figure 2)
  Image


3. With every full backup of a MSSQL Server or instance the following files get created (Figure 3)
  Image

a. master$4idr
b. mastlog$4idr


4. Rename the corrupted master database and log files to ".old" as shown (Figure 4)
  Image


5. Change  master$4idr  to master.mdf as shown (Figure 5)
  Image
 
A dialog box will be displayed, please select Yes.
6. Change mastlog$4idr to mastlog.ldf  (Figure 6)
  Image
 
A dialog box will be displayed, please select Yes.


7. Before starting the MSSQL Server  service remove the "READ-ONLY" attribute from the master database and log files (Figures 7 & 8)
  Image
  Image



Note: If you do not remove the "READ-ONLY" attribute from the database and log file of the MSSQL Server, the SQL services will not start.


8. Start the services by clicking on the green arrow (Figure 9)
  Image


9. The services have started successfully (Figure 10)
  Image


Once the MSSQL Server service is up and running, open Backup Exec and restore the master database file using the "AUTOMATED DATABASE RESTORE" method as explained below.


After SQL is running again, you can restore the latest copy of the master database using the Backup Exec Automate master database restore option, and then restore any other databases, if required. If copies of the master and model databases were not made, then you must use the Microsoft rebuildm.exe utility to rebuild the master database and start SQL.

Because all changes made to the master database after the last backup was created are lost when the backup is restored, the changes must be reapplied. If any user databases were created after the master database was backed up, those databases cannot be accessed until the databases are restored from backups or reattached to SQL.
 
To restore the master database:
 
1. On the navigation bar, click Restore
2. On the Properties pane, under Source, click Selections
3. On the restore selections list, select the backup set containing the last master database backup
4. On the Properties pane, under Settings, click SQL
5. On the Restore Job Properties for SQL dialog box, select Automate master database restore (Figure 1)

Figure 1
    Image

 
All existing users are logged off, and SQL Server is put into single-user mode. When this option is selected, only the master database can be restored; if this option is selected for any other database, those jobs will fail. If Backup Exec does not have access to the following registry keys, then a restore to the default directory may not work, and the Automate master database restore option on the Restore Job Properties for SQL will not work.
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer
Ensure that the account that Backup Exec uses has administrator permissions to the computer that is running SQL.
6.  Select a consistency check to be run after the restore.
7.  Start the restore job.

After the restore, SQL is restarted in multi-user mode.

NOTE :When Backup Exec is installed into an existing instance, the automated master database restore feature is not available. To recover the Master database, you must replace it with the Master database copy that Backup Exec automatically creates and updates when the Master database is backed up
 

 

Was this content helpful?