Restore master database is a must know task for any DBA. Master database is one of the key SQL Server database and should be a part of backup/maintenance plan. In case of issues, this is how it can be restored from a backup.

Step 1

Start the SQL Server instance in single user mode from the command window as shown below

C:\>NET STOP SQLSERVERSERVICE

C:\>NET START SQLSERVERSERVICE  /m

For more details refer to this link 

Step 2

Once you have your instance running in single user mode. Open a command prompt and connect to the SQL Instance via SQLCMD and then run the restore command as shown below.

sql server restore master database

The restore command is specified with REPLACE command so as to overwrite the existing master database. The SQL Server service is stopped once master database is restored. Start the service and you are good to go. I would suggest to practice it in test environment so that you are ready when it is required in production environment.

Happy learning!!!

 

Regards

Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook