この記事は、データベース アップグレード スクリプトを実行するときに、SQL Server の累積的な更新プログラム (CU) または Service Pack (SP) がエラー 574 を報告する問題のトラブルシューティングに役立ちます。
現象
SQL Server に CU または SP を適用すると、セットアップ プログラムは次のエラー メッセージを返します。
データベース エンジンの復旧ハンドルの待機に失敗しました。 考えられる原因については、SQL Server エラー ログを確認してください
さらに、次のエラー エントリが、エラー 912 および 3417 と共に SQL Server エラー ログに記録される場合があります。
15136 The database principal is set as the execution context of one or more procedures, functions, or event notifications and cannot be dropped.
15138 The database principal owns a %S_MSG in the database, and cannot be dropped.
15141 The server principal owns one or more %S_MSG(s) and cannot be dropped.
15154 The database principal owns an %S_MSG and cannot be dropped.
15155 The server principal owns a %S_MSG and cannot be dropped.
15183 The database principal owns objects in the database and cannot be dropped.
15184 The database principal owns data types in the database and cannot be dropped.
15186 The server principal is set as the execution context of a trigger or event notification and cannot be dropped.
15284 The database principal has granted or denied permissions to objects in the database and cannot be dropped.
15421 The database principal owns a database role and cannot be dropped.
27226 The database principal has granted or denied permissions to catalog objects in the database and cannot be dropped.
33015 The database principal is referenced by a %S_MSG in the database, and cannot be dropped.
Error: 912, Severity: 21, State: 2.
Script level upgrade for database 'master' failed because upgrade step 'SSIS_hotfix_install.sql' encountered error 945, state 2, 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.
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
原因
二重ハッシュ マーク (##) で囲まれたサーバー プリンシパルは、SQL Server のインストール時に証明書から作成されます。 これらのプリンシパルは、システムによって作成されたプリンシパルとして扱われます。 msdb
またはその他のデータベース内のユーザー オブジェクトを所有するデータベース プリンシパルにマップすることはできません。 この既定の構成を変更すると、SQL Server をアップグレードしようとするとエラーが発生する可能性があります。 これは、アップグレード スクリプトでは、これらのオブジェクトに SQL Server によって作成された依存関係のみが含まれていると想定されているためです。
解決方法
trace フラグ 902 を使用して SQL Server を起動します。
サーバー プリンシパルとデータベース プリンシパルのマッピングを確認するには、次のコマンドを実行します。
EXEC master.sys.sp_helplogins
影響を受けるオブジェクトの所有権を別のユーザーに変更します。
アップグレード スクリプトの実行を完了できるように、トレース フラグを
902
せずに SQL Server を再起動します。
Note
アップグレード スクリプトの実行に失敗することは、"wait on データベース エンジン recovery handle failed" エラーの一般的な原因の 1 つですが、この問題は他の理由でも発生する可能性があります。 このエラーは、更新プログラムのインストール後に、更新プログラムインストーラーがサービスを開始できなかったか、オンラインにできなかったことを意味します。 どちらの場合も、トラブルシューティングには、エラー ログとセットアップ ログのレビューが含まれており、エラーの原因を特定し、適切なアクションを実行します。