Administering SQL Server

Rebuilding the master Database

The master database can be rebuilt using the Rebuild Master utility if:

When master has been rebuilt, a current backup of master can be restored or the user databases, backup devices, SQL Server logins, and so on can be re-created using SQL Server Enterprise Manager or the original scripts used to create those entries.

Important  The Rebuild Master utility rebuilds master completely. Because the msdb and model system databases are rebuilt as well, it will normally be necessary to restore backups of those databases.

The general steps required to rebuild master completely if no backup is available are:

When master has been re-created and any changes have been reapplied, back up master immediately.

To rebuild the master database

Command Prompt

Command Prompt

To start SQL Server in single-user mode

Command Prompt

Command Prompt

To restore a database backup

Transact-SQL

Transact-SQL

Enterprise Manager

Enterprise Manager

SQL-DMO

To attach a database

Transact-SQL

SQL-DMO

See Also

Attaching and Detaching Databases

System Tables