After patching or upgrading a SQL 2008 R2 or SQL 2012 the instance cannot be initialized in any node (if cluster) or individual (standalone). If you take a look at the ERRORLOG you will something like this:
2019-03-24 07:50:43.29 spid5s Setting object permissions... 2019-03-24 07:50:43.43 spid5s Error: 2714, Severity: 16, State: 6. 2019-03-24 07:50:43.43 spid5s There is already an object named 'TargetServersRole' in the database. 2019-03-24 07:50:43.43 spid5s Error: 2759, Severity: 16, State: 0. 2019-03-24 07:50:43.43 spid5s CREATE SCHEMA failed due to previous errors. 2019-03-24 07:50:43.43 spid5s Error: 912, Severity: 21, State: 2. 2019-03-24 07:50:43.43 spid5s Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 2714, state 6, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the 'master' database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion. 2019-03-24 07:50:43.43 spid5s Error: 3417, Severity: 21, State: 3. 2019-03-24 07:50:43.43 spid5s Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online. 2019-03-24 07:50:43.44 spid5s SQL Server shutdown has been initiated 2019-03-24 07:50:43.44 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
Before doing any modification, copy the system DB’s data and log files into a safe location the chances of master being corrupted are medium.
- Start by checking the ERRORLOG and identify the error. The path for ERRORLOG is in the properties of Configuration Manager:
- Start your SQL Server in emergency mode. You need to open a CMD as administrator and execute : NET START MSSQLSERVER /T902
- Once SQL has been started you can use SSMS and locate the path for msdb110_upgrade.sql
- Open the file and execute it in the impacted instance, you will see an error about TargerServerRole. See below.
- Delete the existing schema as shown below.
- Stop SQL Services NET STOP MSSQLSERVER
- Finally, start the services as normal. Everything should be back to normal. However, if you got a corrupted master and have no backups, you can follow up these steps: https://www.mssqltips.com/sqlservertip/3266/restoring-the-sql-server-master-database-even-without-a-backup/