SQL Server 從 SQL Server 2014 或 SQL Server 2016 升級至 2017 失敗,並傳回錯誤 1712
本文可協助您針對執行資料庫升級腳本時,將 SQL Server 2016 或 SQL Server 2014 升級至 SQL Server 2017 報告 1712 的問題進行疑難解答並加以解決。
徵兆
升級至 SQL Server 2017 實例在執行升級腳本時 ISServer_upgrade.sql
可能會失敗,並出現下列錯誤:
等候 Database Engine 復原控制代碼失敗。 請檢查 SQL Server 錯誤記錄檔以了解潛在原因。
當您檢查 SQL Server 錯誤記錄檔時,您會注意到下列其中一個錯誤專案:
2020-10-26 10:08:09.94 spid6s Database 'master' is upgrading script 'ISServer_upgrade.sql' from level 0 to level 500.
2020-10-26 10:08:09.94 spid6s ---------------------------------------------
2020-10-26 10:08:09.94 spid6s Starting execution of ISServer_upgrade.SQL
2020-10-26 10:08:09.94 spid6s ---------------------------------------------
2020-10-26 10:08:09.94 spid6s
2020-10-26 10:08:09.94 spid6s Taking SSISDB to single user mode
2020-10-26 10:08:09.94 spid6s Setting database option SINGLE_USER to ON for database 'SSISDB'.
2020-10-26 10:08:10.47 spid6s Error: 1712, Severity: 16, State: 1.
2020-10-26 10:08:10.47 spid6s Online index operations can only be performed in Enterprise edition of SQL Server.
2020-10-26 10:08:10.47 spid6s Error: 917, Severity: 15, State: 1.
2020-10-26 10:08:10.47 spid6s 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.
2020-10-26 10:08:10.47 spid6s Error: 912, Severity: 21, State: 2.
2020-10-26 10:08:10.47 spid6s 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.
2020-10-26 10:08:10.48 spid6s Error: 3417, Severity: 21, State: 3.
2020-10-26 10:08:10.48 spid6s 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.
2020-10-26 10:08:10.48 spid6s SQL Server shutdown has been initiated
2020-10-26 10:08:10.48 spid6s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
2020-10-26 10:08:10.50 spid15s The SQL Server Network Interface library successfully deregistered the Service Principal Name (SPN) [ MSSQLSvc/SAFHSQL01.SAFEHAVEN.com ] for the SQL Server service.
2020-10-26 10:08:10.50 spid15s The SQL Server Network Interface library successfully deregistered the Service Principal Name (SPN) [ MSSQLSvc/SAFHSQL01.SAFEHAVEN.com:1433 ] for the SQL Server service.
原因
用於製造 SQL Server 的 SQL Server 2017 版本 (RTM) 升級腳本包含動態連結庫 (DLL),可針對所有 SQL Server 版本執行在線索引作業,但只有 Enterprise 和 Developer 版本支援此功能。 如需資料庫升級腳本的詳細資訊,請參閱 針對套用更新時的升級腳本失敗進行疑難解答。
解決方法
若要解決 1712 錯誤,請遵循下列步驟:
使用追蹤旗標 (TF) 902 啟動 SQL Server。 如需詳細資訊,請參閱 使用追蹤旗標 902 啟動 SQL 的步驟。
注意
升級二進位檔之後發生此錯誤,SQL Server 資料庫引擎已經位於 SQL Server 2017 RTM 層級,您仍然可以使用 TF 902 啟動實例。
安裝 SQL Server 2017 CU5 或更高版本的 SQL Server 組建。
從啟動參數中移除 TF 902,然後重新啟動 SQL Server。
在 SQL Server 在沒有 TF 902 的情況下啟動之後,升級腳本會再次執行。
如果升級腳本順利完成,Service Pack (SP) 或累積更新 (CU) 升級就會完成。 您可以檢查 SQL Server 錯誤記錄檔和啟動程式資料夾,以確認已完成的安裝。
如果升級腳本再次失敗,請檢查 SQL Server 錯誤記錄檔中是否有其他錯誤專案,然後針對新的錯誤進行疑難解答。