SQL SERVER 2008升级到SP4后,服务无法启动

本文涉及的产品
云数据库 RDS SQL Server,独享型 2核4GB
简介:

  为了提高SQL性能和安全性,2号给客户升级SQL 2008 SP4补丁,升级过程中一切顺利。但重启服务器后,发现SQL服务无法启动,事件日志引出此错误:

由于升级步骤'sqlagent100_msdb_upgrade.sql'遇到错误598(状态1,严重性25),因此数据库'master'的脚本级别升级失败。

wKioL1dfZETQcRTcAAHRd2uYqZE056.png-wh_50

尝试恢复模板MASTER数据库,修复安装,升级修复都无法解决,后在网上找方案,发现在SQL启动参数中加 ;-T902参数可以启动SQL,并且能成功登录SMSS,步骤如下:

Enable trace flag 902 on the instance of SQL Server 2008 R2. To do this, follow these steps:

Open SQL Server Configuration Manager.

In SQL Server Configuration Manager, click SQL Server Services.

Double-click the SQL Serverservice.

In the SQL Server Properties dialog box, click the Advanced tab.

On click the Advanced tab, locate the Startup Parameters item.

Add ;-T902 to the end of the existing string value, and then click OK.

Right-click the SQL Serverservice, and then click Start.

If the SQL Server Agent service is running, right-click the SQL Server Agent service, and then click Stop.

Open SQL Server Management Studio, and then connect to the instance of SQL Server 2008 R2.

Run the following statements:

EXEC sp_configure 'show advanced', 1; 

RECONFIGURE with override  ; 

EXEC sp_configure 'allow updates', 0; 

RECONFIGURE with override  ; 

EXEC sp_configure 'Agent XPs', 1; 

RECONFIGURE with override  ; 

GO


In SQL Server Configuration Manager, right-click the SQL Serverservice, and then click Stop.

Remove trace flag 902 on the instance of SQL Server 2008 R2. To do this, delete ;-T902 from the string value that you updated in step 1f.

Right-click the SQL Serverservice, and then click Start.

Right-click the SQL Server Agent service, and then click Start.

In SQL Server Management Studio, reconnect to the instance of SQL Server 2008 R2.

In Object Explorer, expand Management, right-click Data Collection, and then click Enable Data Collection.

Note If data collection is already enabled, the Enable Data Collection item is unavailable.


做完以上步骤后,再启动SQL服务,发现服务仍然异常,尝试再加 ;-T902参数并手工运行报错的sqlagent100_msdb_upgrade.sql脚本,发现运行结果有此报错:

对文件 "D:\SQLDATA\temp_MS_AgentSigningCertificate_database.mdf" 的目录查找失败,出现操作系统错误 2(系统找不到指定的文件。)。

发现D:\SQLDATA目录并不存在,于是手工建立SQLDATA目录,再运行脚本,成功完成。再在启动参数中删除;-T902 ,再重新启动服务即可。

wKioL1dfaK7SahxUAABm9Ss2mnU554.png-wh_50


也有人的问题略有不同,他操作后,引出了其它错误信息。

从事件里可以看到一个错误信息:

 

Could not allocate space for object 'dbo.#bulkpackage' in database 'tempdb'

 

这是由于 tempdb太小造成执行语句失败。

 

先用;-T902重启 SQL Server之后,把 tempdb文件改大。再删除 ;-T902。重启 SQL Server就行了。



------------------------------------

下面方法好像更简单:

启动 SQL Server 服务启跟踪标志902


 


一般使用命令: Net Start MSSQL$InstanceName /T902  如果是默认实例 Net Start MSSQLSERVER /T902



C:\Windows\system32>net start MSSQLSERVER /T902


The SQL Server (MSSQLSERVER) service is starting.


The SQL Server (MSSQLSERVER) service was started successfully.


转自:

http://www.cnblogs.com/kerrycode/p/4877910.html



本文转自 sfih 51CTO博客,原文链接:http://blog.51cto.com/dayday/1789021


相关实践学习
使用SQL语句管理索引
本次实验主要介绍如何在RDS-SQLServer数据库中,使用SQL语句管理索引。
SQL Server on Linux入门教程
SQL Server数据库一直只提供Windows下的版本。2016年微软宣布推出可运行在Linux系统下的SQL Server数据库,该版本目前还是早期预览版本。本课程主要介绍SQLServer On Linux的基本知识。 相关的阿里云产品:云数据库RDS SQL Server版 RDS SQL Server不仅拥有高可用架构和任意时间点的数据恢复功能,强力支撑各种企业应用,同时也包含了微软的License费用,减少额外支出。 了解产品详情: https://www.aliyun.com/product/rds/sqlserver
相关文章
|
4天前
|
SQL API 流计算
实时计算 Flink版产品使用合集之在Mac M1下的Docker环境中开启SQL Server代理的操作步骤是什么
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
19 1
|
3天前
|
SQL 数据处理 API
实时计算 Flink版产品使用合集之遇到SQL Server锁表问题如何解决
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
9 0
|
4天前
|
SQL 关系型数据库 MySQL
实时计算 Flink版产品使用合集之当 SQL Server 源数据库中的数据更新后,CDC 吐出的操作(op)是怎样的
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。
15 0
|
6天前
|
SQL XML Linux
SQL Server的版本
【5月更文挑战第14天】SQL Server的版本
21 3
|
6天前
|
SQL 关系型数据库 数据管理
Microsoft SQL Server 是微软公司开发的一款关系型数据库管理系统
【5月更文挑战第14天】Microsoft SQL Server 是微软公司开发的一款关系型数据库管理系统
16 2
|
6天前
|
SQL 存储 数据库连接
LabVIEW与SQL Server 2919 Express通讯
LabVIEW与SQL Server 2919 Express通讯
|
6天前
|
SQL Windows
安装SQL Server 2005时出现对性能监视器计数器注册表值执行系统配置检查失败的解决办法...
安装SQL Server 2005时出现对性能监视器计数器注册表值执行系统配置检查失败的解决办法...
14 4
|
6天前
|
SQL 数据可视化 Oracle
这篇文章教会你:从 SQL Server 移植到 DM(上)
这篇文章教会你:从 SQL Server 移植到 DM(上)
|
6天前
|
SQL 关系型数据库 数据库
SQL Server语法基础:入门到精通
SQL Server语法基础:入门到精通
SQL Server语法基础:入门到精通
|
6天前
|
SQL 存储 网络协议
SQL Server详细使用教程
SQL Server详细使用教程
33 2