web-dev-qa-db-ja.com

SQL Server 2008 R2 SP3のアップグレード中のエラー:MODIFY FILEが失敗しました。ファイル 'MSDBLog'は存在しません

SQL Server 2008 R2 SP3をインストールしたばかりで、インストールしてSQL Serverインスタンスを再度起動しようとすると、オンラインになりません。 SQL Serverエラーログで、次のものがログに記録されていることがわかります。

2014-10-20 16:51:13.04 spid8s      MODIFY FILE failed. File 'MSDBLog' does not exist.
2014-10-20 16:51:13.04 spid8s      Error: 912, Severity: 21, State: 2.
2014-10-20 16:51:13.04 spid8s      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-10-20 16:51:13.04 spid8s      Error: 3417, Severity: 21, State: 3.
2014-10-20 16:51:13.04 spid8s      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-10-20 16:51:13.04 spid8s      SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

アップグレードを失敗しないように修正するにはどうすればよいですか?

2
Richard

これは、msdbログファイル名がデフォルトの「MSDBLog」から変更されているために発生します。私の場合、「msdb_log」と呼ばれていました。 「MSDBLog」という名前はアップグレードスクリプトにハードコードされているため、名前が変更されていると失敗します。

この問題を修正するには、ログファイルの名前を「MSDBLog」に変更する必要があります。 SQLを起動時にアップグレードスクリプトを実行しないようにするには、トレースフラグ902でSQLを起動する必要があります。次に、修正を行い、トレースフラグを削除して、再度開始します。

  • SQL Server構成マネージャーを開く
  • 左側のペインの「SQL Serverサービス」に移動します
  • SQLインスタンスを右クリックし、[プロパティ]を選択します
  • 「詳細」タブをクリックします
  • 「スタートアップパラメータ」で、末尾に「; -T902」を追加します(引用符を除く)。
  • 「OK」をクリックして保存します
  • SQLインスタンスを開始する
  • ログファイルの名前を元の名前に戻します。

    ALTER DATABASE msdb MODIFY FILE(NAME = N'msdb_log '、NEWNAME = N'MSDBLog')

  • SQLインスタンスを停止する

  • 起動パラメーターの変更を元に戻す
  • SQLインスタンスを再起動します

アップグレードスクリプトが実行され、成功するはずです。

4
Richard

SQL 2012をSP2にアップグレードすると、最近同じエラーが発生しました。

2014-11-08 23:49:55.49 spid5s      Checking the size of MSDB...
2014-11-08 23:49:56.13 spid5s      Error: 5041, Severity: 16, State: 1.
2014-11-08 23:49:56.13 spid5s      MODIFY FILE failed. File 'MSDBLog' does not exist.
2014-11-08 23:49:56.13 spid5s      Error: 912, Severity: 21, State: 2.
2014-11-08 23:49:56.13 spid5s      Script level upgrade for database 'master' failed because upgrade step 'msdb110_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-11-08 23:49:56.13 spid5s      Error: 3417, Severity: 21, State: 3.
2014-11-08 23:49:56.13 spid5s      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-11-08 23:49:56.13 spid5s      SQL Server shutdown has been initiated
2014-11-08 23:49:56.13 spid5s      SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

メッセージは少し異なりますが、それを解決する鍵は"MSDBLog does not exist"でした。 SQL 2008 SP3のアップグレードとは少し異なるため、他のエラーの1つを検索しているときに表示されなかったため、この特定のメッセージをこの質問/回答に確実に追加しました。これをここに追加して、SQL 2012でこの問題に遭遇する将来の人々がこのページを見つけるのに役立つことを願っています。

Richardのおかげで、msdbの論理ファイル名を物理名と一致するように変更することで問題を解決できました。残念ながら、私は彼の回答に賛成票を投じる/コメントする十分な評判はありませんが、今後の検索のためにこのページにMYエラーメッセージを追加することが重要であると感じました。

アップグレードを開始する前に、MSDBが適切に(物理的および論理的に)命名されていることを確認します。幸運を!

0
MB_