Wednesday, December 13, 2017

Script level upgrade for database master failed because upgrade step SSIS_hotfix_install.sql

After update windows including SQL 2012 SP2 unable to start SQL service/instance


We have SQL 2012 Ent 64 bit SP1
Window 2012 R2 Datacenter
After update windows including SQL 2012 SP2 unable to start SQL service/instance and following event log
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.
Script level upgrade for database 'master' failed because upgrade step 'SSIS_hotfix_install.sql' encountered error 945, state 2, 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.

Solution:
Start SQL Server service with Trace Flag 902: 
Right click on the command prompt and run as Administrator
When named instance
>Net Start MSSQL$InstanceName /T902
Or when default instance:
>Net Start MSSQLSEVER /T902
Open SQL Server Management Studio, go to Availability Group and remove SSISDB from the availability databases
Stop SQL Server services:  
>Net Stop MSSQL$InstanceName or >Net Stop MSSQLSERVER when default instance
Start SQL server service from SQL Server configuration manager
Add SSISDB back to Availability Group