Was recently patching my SQL Server 2014 instance with Service Pack 2 in my lab, when I noticed I couldn’t start SQL Server post patching installation.
As i couldnt start SQL Server, i couldnt check the SQL Server Logs. Luckily i remembered that the SQL logs are physically stored where the SQL Server binaries are kept.
Found the Error.log under
D:\Program Files\Microsoft SQL Server\MSSQL10_50.VMWare\MSSQL\Log

Looks like the database is corrupted. Cannot recover the master database isnt a great message.

Normally I would restore the system database from backup, but in this case I was in an environment that didn’t have any backups available.
Solution:
To resolve, we need to rebuild the master database.
Pre-Reqs:
- SA password is known;
- SA account is enabled;
- SQL Server installation media for the particular SQL version is mounted.
To rebuild the master database we need to run the below command in an elevated command prompt:
- Navigate to the setup.exe is within the installation media.
CD E:
- Now run the command to rebuild the database.
./setup /ACTION=REBUILDDATABASE /INSTANCENAME=<instance_name> /SQLSYSADMINACCOUNTS=<admin_account> /SAPWD=<sa_password>
You should now be able to start SQL Server with no issues.
