Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 2714, state 6, severity 25.

I got the below error in one of my production environments one day after patching. Below are the error message. You are unable to bring the database engine and agent online, and you will face the below error messages in the error log of SQL Server and eventvwr of Windows server.


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 that might interfere with regular operation and the database will be taken offline. If the error happened during the 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.







This error is misleading us don't go for rebuild master database

You can also find the same information in the error log SQL server.











Workaround:

  1. This issue happens when we are trying to restart the SQL Server instance after patching has done
  2. We need to restart the services by mentioning -T902 parameter as start up parameter
  3. After restarting the servicesYou can find msdb110_upgrade.sql script under bin folder bin\install or upgrade folder and execute this script as well.
  4. After restarting the services, we can found that “TargetServerRole’ exist in msdb databases under schema(see above image)
  5. Delete the ‘TargetServersRole’ schema
  6. Then stop the services and remove -T902 parameter and start the services normally
  7. This time SQLServer services starts immediately and deleted TargetServerRole will reappear under schema.

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server