Sunday, September 7, 2014

SQL Server fails to start. Error: 912, Severity: 21, State: 2. Script level upgrade for database 'master' failed.

Issue Description:
        SQL Server services not coming online because TempDB Tlog files go full due to Active_Transaction during startup.

Error Message (ERRORLOG):
Error: 9002, Severity: 17, State: 4.
The transaction log for database 'tempdb' is full due to 'ACTIVE_TRANSACTION'.
Error: 912, Severity: 21, State: 2.
Script level upgrade for database 'master' failed because upgrade step 'msdb110_upgrade.sql' encountered error 9002, state 4, severity 17. 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.
Error: 3417, Severity: 21, State: 3.
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.
SQL Server shutdown has been initiated

Fix/Resolution:

  • Start SQL Server services from command line using the below parameters:
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn>sqlservr.exe -sMSSQLSERVER -f -T3608
  • Open connection to SQL Server and execute the below (SSMS GUI will not work. Will have to use SQLCMD or Query Window within SSMS):
--To confirm we have the connection on the correct server
        select serverproperty('servername')

--Executed the below to resize the TempDB Log file
        USE [master]
      GO
        ALTER DATABASE [tempdb] MODIFY FILE ( NAME = N'templog', SIZE = 10GB )
        GO

--From ERRORLOG found the below:
Clearing tempdb database.
Starting up database 'model'.
CHECKDB for database 'model' finished without errors on 2014-09-06 17:00:05.970 (local time). This is an informational message only; no user action is required.
Starting up database 'tempdb'
  • Stop SQL Server service that was started from command line (Ctrl + C).
  • Restart SQL Server service from SQL Server configuration manager.
  • The upgrade script should run successfully and user connections should now be successful.

7 comments:

  1. Great article! It really helped me to re-start the SQL server after I had the exact error message.
    Thanks.

    ReplyDelete
  2. I am really happy with your blog because your article is very unique and powerful for new reader.
    Click here:
    Selenium Training in Chennai | Selenium Training in Bangalore | Selenium Training in Pune | Selenium Training in Chennai

    ReplyDelete
  3. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    a+ training in chennai | a+ training institute in chennai | a+ training course in chennai | best a+ training in chennai

    ReplyDelete