One of the most tricky and sensitive tasks a DBA encounters is recovering the master database.This task is also one of those DBA tasks which you do not get to hopefully practice often.If the master database has problems, then every database on the server will have problems.This article will cover the scenario that is typical when master database has problems.

Corrupt or Bad Master

One of the most difficult situations to resolve is a corrupt or

bad master database. To restore a master database in this situation, you could:

  1. Rebuild the master database. In SQL Server 6.5, you will have to run setup in the SQL Server program file group. In 7.0 run Rebuildm.exe in the \Mssql7\Binn directory.
  2. Place SQL Server in single user mode. This can be done by starting SQL Serverwith the -m parameter.
  3. Restore your master database from the last known good backup.
  4. Verify that the master database was successful restored.
    1. Confirm that all the databases are up an running.
    2. Restore the MSDB database from the last known good backup.
  5. Stop and start SQL Server in normal mode.
  6. Open your database for production users.