# Full System Recovery of SQL Server: Rebuilding the Master Database (Quick Rebuild)

You can rebuild the master database by using SQL Server or SQL Server Express.

## Before You Begin

You must rebuild the Operating System

## Procedure

### If the Master Database Exists

1. Insert the SQL Server installation media into the disc drive.

   Note

   If you are using SQL Server Express, download the Express kit and extract the contents to a local directory.

2. At a command prompt, go to the disc drive or the extracted directory and based on the SQL Server version, run the appropriate command for rebuilding the master database.

   For SQL 2005:

       start /wait setup.exe /qn INSTANCENAME=$[instanceName]  REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=$[NewStrongPassword]  REINSTALLMODE=vomus

   where:

   /qn = suppresses all setup dialog boxes and error messages.

   /qb = allows display of basic setup dialog boxes and error messages.

   For SQL 2008 and later:

       Setup /QUIET /ACTION=REBUILDDATABASE /INSTANCENAME=InstanceName /SQLSYSADMINACCOUNTS=accounts [ /SAPWD=StrongPassword ] [ /SQLCOLLATION=CollationName ]

   where:

   /QUIET or /Q = means the setup runs without any user interface.

3. At a command prompt, run Services.msc

4. Right-click the SQL Server instance and select Start.

### If the Master Database Does Not Exist

In cases when the master database is not available, use the following steps to rebuild the master database:

1. Go to the directory where the SQL Server is installed.

   For example, C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL

2. Open the Template Data folder and verify that there are copies of the system databases that were created automatically during the original install.

3. Copy the missing files to the Data directory.

   By default, the data directory is: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

   Note

   Ensure that the default filters for SQL are not added, as these filters can cause the necessary files to get excluded. For more information on the default SQL filters, see Microsoft SQL Server,Content, Filters, and Regular Expressions - Best Practices.

4. At a command prompt, run Services.msc

5. In the Services window, right-click the SQL Server instance, and select Start.

## What to Do Next

After you rebuild the master database, use the steps in Restoring the SQL Server Instance to restore the data.

×

Loading...