暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

SQL SERVER 就地升级失败:等待数据库引擎恢复句柄失败

原创 Ellison 2022-07-29
3466


几周前,我正在执行从 SQL Server 2014 到 SQL Server 2017 的就地升级。在执行就地升级之前,我遵循了每一次预检查,但在安装结束时收到一条错误消息。


有问题的错误:

1 The following error has occurred: 
2
3 Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.


我将解释我为解决问题所采取的步骤,但首先让我解释一下有关环境的更多信息。我进行了一些从 SQL 2014 到 SQL 2017 的就地升级,所有升级都成功完成,没有任何问题,但这次失败了。此 SQL Server 实例的唯一不同之处在于它托管了 SSISDB 目录数据库。

故障排除

错误消息没有说太多,所以我尝试使用 -m 标志以单用户模式启动 SQL Server,以下是我在错误日志中找到的实际错误消息:


1  yyyy-MM-dd HH:mm:ss.SS spid7s      Database 'master' is upgrading script 'ISServer_upgrade.sql' from level 0 to level 500.
2  yyyy-MM-dd HH:mm:ss.SS spid7s      ---------------------------------------------
3  yyyy-MM-dd HH:mm:ss.SS spid7s      Starting execution of ISServer_upgrade.SQL
4  yyyy-MM-dd HH:mm:ss.SS spid7s      ---------------------------------------------
5  yyyy-MM-dd HH:mm:ss.SS spid7s
6  yyyy-MM-dd HH:mm:ss.SS spid7s      Taking SSISDB to single user mode
7  yyyy-MM-dd HH:mm:ss.SS spid7s      Setting database option SINGLE_USER to ON for database 'SSISDB'.
8  yyyy-MM-dd HH:mm:ss.SS spid7s      Error: 1712, Severity: 16, State: 1.
9  yyyy-MM-dd HH:mm:ss.SS spid7s      Online index operations can only be performed in Enterprise edition of SQL Server.yyyy-MM-dd HH:mm:ss.SS spid7s      Error: 917, Severity: 15, State: 1.
10 yyyy-MM-dd HH:mm:ss.SS spid7s      An upgrade script batch failed to execute for database 'master' due to compilation error. Check the previous error message for the line which caused compilation to fail.
11 yyyy-MM-dd HH:mm:ss.SS spid7s      Error: 912, Severity: 21, State: 2.
12 yyyy-MM-dd HH:mm:ss.SS spid7s      Script level upgrade for database 'master' failed because upgrade step 'ISServer_upgrade.sql' encountered error 917, state 1, severity 15. 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.
13 yyyy-MM-dd HH:mm:ss.SS spid7s      Error: 3417, Severity: 21, State: 3.
14 yyyy-MM-dd HH:mm:ss.SS 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.
15 yyyy-MM-dd HH:mm:ss.SS spid7s      SQL Server shutdown has been initiated


在进行了一些研究并查看了错误消息后,我发现这似乎是托管 SSISDB 数据库的 SQL Server 就地升级的常见问题。

解析度

为了解决这个问题,我删除了 SSISDB 目录(在备份之后),然后修复了修复所有问题的 SQL 实例。在此之后,我们手动恢复了 SSISDB 目录。

简而言之,如果您要对具有 SSISDB 目录的 SQL Server 实例执行就地升级,我建议先进行升级,然后再升级实例。升级后,您可以将 SSISDB 目录数据库恢复到 SQL 实例。

托管 SSISDB 目录的就地升级指南

如果您在不久的将来对 SQL Server 2016/2017 执行就地升级,请记住一些重要提示:

1. 如果您的 SQL 实例上有一个 SSISDB 目录需要就地升级,它将失败,升级后您将无法启动数据库引擎服务。这应该适用于从 SQL Server 2014 到 SQL Server 2016/2017 的就地执行。

2. 作为一种解决方法,备份 SSISDB 数据库并将其删除,然后执行升级;从那时起,事情应该会顺利进行。

3. 升级成功完成后,您可以恢复 SSISDB 数据库和目录。

4. 此时,SSISDB 目录将无法运行,并向您抛出各种没有任何意义的错误。问题是 SQL Server 2016 和 SQL Server 2017 SSISDB 目录有一些 SQL 2014(或更早支持的版本)中没有的附加表和视图

5. 从目录升级数据库也失败了,再次出现奇怪的错误,网上没有相关信息。

6.通过导出包然后删除旧的 SSISDB 目录来完成修复。重新创建新目录并从 .ISPAC 文件部署包

7.你将面临的问题是环境变量,因为它们会丢失。我使用从旧表 ( catalog.environment_variables ) 中选择插入将这些值直接添加到新的 SSISDB 数据库表中,它就像一个魅力。理想情况下,您希望在删除旧的 SSISDB 并执行升级之前保留 catalog.environment_variables 表的备份并导出 .ISPAC 文件。升级完成后,还原并修复 SSISDB 目录数据库。

8. 要记住的另一件事(与此问题无关)是 SSRS 现在是一项单独的服务,升级后将被删除。您必须单独安装它并将报告从旧版本迁移到新版本的 SSRS。

 

我希望你觉得这篇文章有帮助。随意提出任何问题或在评论中分享您的想法,并确保注册更新。



原文标题:SQL SERVER IN-PLACE UPGRADE FAILED: WAIT ON THE DATABASE ENGINE RECOVERY HANDLE FAILED

原文作者;Sandeep Arora

原文地址:https://blog.pythian.com/sql-server-in-place-upgrade-failed-wait-on-the-database-engine-recovery-handle-failed/

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论