Quantcast
Channel: SQL Archives - SQL Authority with Pinal Dave
Viewing all articles
Browse latest Browse all 594

SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step msdb110_upgrade.sql encountered error 926, state 1, severity 25

$
0
0

SQL SERVER - Script level upgrade for database 'master' failed because upgrade step msdb110_upgrade.sql encountered error 926, state 1, severity 25 warning-1 I have helped many clients in upgrade failures via my On-Demand consulting and I am amazed to see various ways which can break SQL Server upgrade. In this blog we would learn about fixing error Script level upgrade for database ‘master’ failed because of upgrade step sqlagent100_msdb_upgrade.sql

Below are few earlier blogs which have other causes of same error:

SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step ‘sqlagent100_msdb_upgrade.sql’

SQL SERVER – Script level upgrade for database ‘master’ failed – There is already an object named ‘DatabaseMailUserRole’ in the database

SQL SERVER – Script level upgrade for database master failed – Error: 4860, Severity: 16, State: 1 – Cannot bulk load. SqlTraceCollect.dtsx does not exist

SQL SERVER – Error 15559 – Error 912 – Script Level Upgrade for Database ‘master’ Failed

SQL SERVER – Script Level Upgrade for Database ‘master’ Failed Because Upgrade Step ‘sqlagent100_msdb_upgrade.sql’ – Error: 5041: MODIFY FILE Failed

As I mentioned in an earlier blog, we need to look at the exact error in ERRORLOG. In my client’s case, here is what I saw in ERRORLOG.

  1. Error: 8355, Severity: 16, State: 1.
  2. Server-level event notifications cannot be delivered. Either Service Broker is disabled in msdb, or msdb failed to start. Event notifications in other databases could be affected as well. Bring msdb online, or enable Service Broker.
  3. Error: 926, Severity: 14, State: 1.
  4. Database ‘msdb’ cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.
  5. Error: 912, Severity: 21, State: 2.
  6. Script level upgrade for database ‘master’ failed because upgrade step ‘msdb110_upgrade.sql’ encountered error 926, state 1, 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.
  7. Error: 3417, Severity: 21, State: 3.
  8. 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.
  9. SQL Server shutdown has been initiated
  10. SQL Trace was stopped due to server shutdown. Trace ID = ‘1’. This is an informational message only; no user action is required.

I have put line number for clarity. Message in line number 7 onwards are scary and don’t trust/follow them. Upgrade failure is in line number 5 and 6. If you read complete message in line number 6, it tells error 926 encountered. Now, line number 3 is error number 926 which means database msdb can’t be opened.

WORKAROUND/SOLUTION

As mentioned in all earlier articles, we need to start SQL Service with trace flag 902 to bypass upgrade script and fix the cause of upgrade script failures. So, here are the steps I have done.

As I mentioned earlier, first we started SQL with trace flag 902. I started SQL using trace flag 902 as below via command prompt.

NET START MSSQLSERVER /T902

For named instance, we need to use below (replace instance name based on your environment)

NET START MSSQL$INSTANCENAME /T902

Refer: SQL SERVER – 2005 – Start Stop Restart SQL Server from Command Prompt

As soon as SQL was started, we were able to connect because upgrade didn’t run. Now, we need to fix issue i.e. fix the reason of MSDB suspect database. In my client’s situation, we restore to last known good backup of MSDB database. Once restore was completed, we stopped SQL Service and started normally (without any trace flag). This time upgrade scripts ran fine, and SQL was up and running.

Have you faced any other upgrade script failures? I would be happy to write a blog, if not written already, with due credit.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step msdb110_upgrade.sql encountered error 926, state 1, severity 25


Viewing all articles
Browse latest Browse all 594

Trending Articles