安装SP3后,SqlServer处于脚本升级模式

时间:2014-12-02 10:06:54

标签: sql-server windows sql-server-2008

这与SqlServer is in script upgrade mode

几乎相同

但是我希望找到答案,因为那里的每个解决方案对我都不起作用。

我安装了SQL Server 2008R2 SP3。 Service Pack更新后,服务将启动,但在错误日志

中出现此错误的几秒钟内停止
10:53:47.93 spid7s      Error: 5041, Severity: 16, State: 1.
2014-12-02 10:53:47.93 spid7s      MODIFY FILE failed. File 'MSDBLog' does not exist.
2014-12-02 10:53:47.94 spid7s      Error: 912, Severity: 21, State: 2.
2014-12-02 10:53:47.94 spid7s      Script level upgrade for database 'master' failed because upgrade step 'sqlagent100_msdb_upgrade.sql' encountered error 598, 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.
2014-12-02 10:53:47.94 spid7s      Error: 3417, Severity: 21, State: 3.
2014-12-02 10:53:47.94 spid7s      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.
2014-12-02

这些是我的注册表设置:

  

HKHKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SQL Server \ MSSQL10_50.I2008 \ Setup \ SQLDataRoot

F:\ Program Files \ Microsoft SQL Server \ MSSQL10_50.I2008 \ MSSQL

  

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SQL Server \ MSSQL10_50.I2008 \ MSSQLServer \ DefaultData

K:\ MSSQL.1 \ MSSQL \数据\

根据http://blogs.msdn.com/b/sqlserverfaq/archive/2010/10/27/sql-server-2008-service-fails-to-start-after-applying-service-pack-1.aspx我试图将后一条路径改为

F:\ Program Files \ Microsoft SQL Server \ MSSQL10_50.I2008 \ MSSQL

我试过

F:\ Program Files \ Microsoft SQL Server \ MSSQL10_50.I2008 \ MSSQL \ Data

,但这没有任何作用。

在包含MSDB数据库的文件夹中,这些是权限:

SYSTEM: Full controll

SQLServerMSSSQLUser$<servername>$<instancename>: Full control

Administrators: Full control

我尝试添加运行SQL Server实例的服务帐户,但是那个功能也不行。 此外,硬盘上还有足够的空间。 我该怎么办?

1 个答案:

答案 0 :(得分:0)

最终,我找到了解决方案。文件MSDBlog.mdf已存在,但文件的逻辑名称为msdb_log。要解决这个问题:

  1. 使用-T902标志启动SQL Server服务,因此它会跳过脚本升级。
  2. 执行以下脚本来更改名称,在这种情况下,我将其更改为&#39; MSDBLog&#39;因为这是错误日志中提到的名称(请参阅第一篇文章):
  3. &GT;

    USE [msdb]
    GO
    ALTER DATABASE [msdb] MODIFY FILE (NAME=N'msdb_log', NEWNAME=N'MSDBLog')
    GO
    
    1. 重新启动SQL Server实例