Issue: 

Recently, one of my instances was corrupted and I was unable to restart SQL Server.

An unexpected shutdown of SQL Server 2008 database server has resulted in crashing of the SQL Server. I was unable to connect to SQL Server Instance and when I checked the SQL Server error logs,

“Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it”

Since I don’t have the system databases backups, the only option left for me was to rebuild the system databases

 

Good References:

https://mssqltrek.com/2011/08/20/how-to-rebuild-master-database-aka-rebuilding-sql-server-2008r2/   ***

https://www.mssqltips.com/sqlservertip/3266/restoring-the-sql-server-master-database-even-without-a-backup/

http://www.mytechmantra.com/LearnSQLServer/Rebuild_System_Databases_In_SQL_Server_2008.html

http://www.codeproject.com/Tips/537811/Rebuilding-Master-Database-in-SQL-Server

 

******************************************************

Assuming you have a good backup of master to use, the process I use is as follows:

  1. Stop instance
  2. Open command prompt
  3. Run –m, DO NOT CLOSE WINDOW
  4. Open sqlcmd
  5. Restore master from file WITH REPLACE (Note: Windows will close, do not panic!)
  6. Restart instance

Img 2 Command Prompt

 

Advertisements