次の方法で共有


MSSQLSERVER_9001

適用対象: SQL サーバー

詳細

属性 Value
製品名 SQL Server
イベント ID 9001
イベント ソース MSSQLSERVER
コンポーネント SQLEngine
シンボル名 LOG_NOT_AVAIL
メッセージ テキスト データベース '%.*ls' のログは使用できません。 イベント ログで、関連するエラー メッセージを確認してください。 エラーがある場合は解決し、データベースを再起動してください。

説明

エラー 9001 は、データベース ログ ファイルが使用できなくなったときに発生します。 データベース ログがオフラインになると、重大なエラーが発生し、データベースでトランザクションが発生するのを防ぎます。 このようなエラーが発生した場合、データベースを再起動するか、バックアップを復元する必要があります。 エラーは最終的な結果を示していますが、この状態の原因については説明しません。 その他の問題により、ログが使用できなくなっており、基になる問題を調査する必要があります。 SQL エラー ログにエラーが表示される方法の例を次に示します。

Error: 9001, Severity: 21, State: 5.
The log for database 'ContosoDb' is not available. Check the operating system error log for related error messages. Resolve any errors and restart the database.

一般的なエラー 9001 は、根本原因に関するより具体的な説明を提供する他のエラーと共に発生します。 たとえば、エラー 90023313331417204 (ファイルへのアクセス時に OS エラーを示す)、 17053 (OS エラーを示す)、 823などがあります。

特定の状況では、SQL Server が実行時にデータベースの再起動を試み、復旧を実行したり、それ自体 (サービス全体) を再起動したりすることがあります。 データベースの自動再起動が失敗した場合、または発生しなかった場合は、SQL Server の再起動を試み、データベースの復旧によってデータベースが正常にオンラインになるかどうかを確認できます。 使用できない場合は、トランザクション ログが使用できない根本的な原因に対処する必要があります。 データベースの再起動を示すエラー メッセージ 3422 の例を次に示します。

Database ContosoDb was shutdown due to error 9001 in routine 'XdesRMFull::CommitInternal'. Restart for non-snapshot databases will be attempted after all connections to the database are aborted.

次のメッセージは、SQL Server の再起動が発生しようとしていることを示しています。

Error: 3449, Severity: 21, State: 1.
SQL Server must shut down in order to recover a database (database ID 2). The database is either a user database that could not be shut down or a system database. Restart SQL Server. If the database fails to recover after another startup, repair or restore the database.

原因

データベースのトランザクション ログは、さまざまな理由で使用できなくなる可能性があります。 いくつかの例を次に示します。

  • トランザクション ログ ファイルは、障害が発生したか使用できないストレージ デバイスに存在します
  • ログ ファイルへの書き込みまたはログ ファイルからの読み取りができない、物理的に破損したトランザクション ログ ファイル
  • Transparent Data Encryption (TDE) による暗号化/暗号化解除に失敗したため、ファイルにアクセスできない
    • Key Vault サービスにアクセスできない
    • EKM プロバイダー モジュールが、正常な操作を妨げる例外、エラー、またはその他の問題に発生する
  • トランザクション ログに大きなトランザクション、ディスク領域の不足、またはファイル サイズの制限が課されるため、完全なトランザクション ログ。 エラー 9002 は、9001 より前の SQL Server エラー ログにある場合があります。 詳細については、 MSSQLSERVER_9002を参照してください。

ユーザー アクション

最初に 9001 より前のエラーを解決します。 その後、SQL Server インスタンスを再起動してデータベースを復旧します (まだ発生していない場合)。

トランザクション ログの完全なエラーを解決する

エラー 9001 より前にエラー 9002 が発生することがあります。 次に例を示します。

Error: 9002, Severity: 17, State: 9.
The transaction log for database 'ContosoDb' is full due to 'AVAILABILITY_REPLICA'.
Error: 3314, Severity: 21, State: 3.
During undoing of a logged operation in database 'ContosoDb' (page (1:32573799) if any), an error occurred at log record ID (7672713:36228:159). Typically, the specific failure is logged previously as an error in the operating system error log. Restore the database or file from a backup, or repair the database.
State information for database 'ContosoDb' - Hardened Lsn: '(7672713:38265:1)'    Commit LSN: '(7672712:1683087:46)'    Commit Time: 'Jul  1 2021  5:51AM'
Database ContosoDb was shutdown due to error 3314 in routine 'XdesRMReadWrite::RollbackToLsn'. Restart for non-snapshot databases will be attempted after all connections to the database are aborted.
Always On Availability Groups connection with secondary database terminated for primary database 'ContosoDb' on the availability replica 'PRDAT1ANLYSQL05' with Replica ID: {38a71ff9-f0ee-4737-9255-bb6a73e1c5d5}. This is an informational message only. No user action is required.
Error during rollback. shutting down database (location: 1).

Error: 9001, Severity: 21, State: 5.
The log for database 'ContosoDb' is not available. Check the operating system error log for related error messages. Resolve any errors and restart the database.

Recovery of database 'ContosoDb' (6) is 0% complete (approximately 60466 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.

このような場合は、根本原因 (完全なトランザクション ログ) の解決に重点を置きます

完全なトランザクション ログを解決するには、「 完全なトランザクション ログをトラブルシューティングする (SQL Server エラー 9002)」を参照してください。

  • トランザクション ログ領域を解放し、解放されなかった理由を確認する
  • トランザクション ログが存在するディスク領域を解放する
  • 場合によっては、既存のログ ファイルを展開するか、必要に応じて新しいログ ファイルを追加します

ハードウェアと OS の問題を解決し、必要に応じてバックアップから復元する

一般的なエラー 9001 は、トランザクション ログ ファイルが破損している場合、またはログ ファイルを使用できないストレージ デバイスの問題が原因で発生します。 次の 2 つのエラーの例を確認できます。

ストレージ ボリュームが使用できなくなり、OS から "デバイスの準備ができていません" というエラーが返された例。 使用できない状態でディスクが破損した結果として発生したその他のエラーが表示されます。 これらの例は、エラー 9001 が大きな問題の多くの症状の 1 つに過ぎないことを理解できるように、コンテキストを提供します。

Error: 823, Severity: 24, State: 2.
The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x000009afde6000 in file 'G:\Data\Files\ContosoDb_4.ldf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.

Error: 9001, Severity: 21, State: 3.
The log for database 'ContosoDb' is not available. Check the event log for related error messages. Resolve any errors and restart the database.

Database ContosoDb was shutdown due to error 9001 in routine 'XdesRMFull::CommitInternal'. Restart for non-snapshot databases will be attempted after all connections to the database are aborted.

Starting up database 'ContosoDb'.
Error: 17204, Severity: 16, State: 1.
FCB::Open failed: Could not open file G:\Data\Files\ContosoDb.mdf for file number 1.  OS error: 3(The system cannot find the path specified.).
Error: 5120, Severity: 16, State: 101.
Unable to open the physical file "G:\Data\Files\ContosoDb.mdf". Operating system error 3: "3(The system cannot find the path specified.)".
Error: 17207, Severity: 16, State: 1.
FileMgr::StartPrimaryDataFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'G:\Data\Files\ContosoDb_0.ndf'. Diagnose and correct the operating system error, and retry the operation.

OS でデバイス エラーが報告され、複数のデータベースのトランザクション ログにアクセスできなくなる別の例を次に示します。

Error: 17053, Severity: 16, State: 1.
SQLServerLogMgr::LogWriter: Operating system error 1117(The request could not be performed because of an I/O device error.) encountered.


Error: 9001, Severity: 21, State: 4.
The log for database 'ContosoDb' is not available. Check the event log for related error messages. Resolve any errors and restart the database.
Always On Availability Groups data movement for database 'ContosoDb' has been suspended for the following reason: "system" (Source ID 2; Source string: 'SUSPEND_FROM_REDO'). To resume data movement on the database, you will need to resume the database manually. For information about how to resume an availability database, see SQL Server Books Online.


Error: 9001, Severity: 21, State: 16.
The log for database 'tempdb' is not available. Check the event log for related error messages. Resolve any errors and restart the database.
Error: 3449, Severity: 21, State: 1.
SQL Server must shut down in order to recover a database (database ID 2). The database is either a user database that could not be shut down or a system database. Restart SQL Server. If the database fails to recover after another startup, repair or restore the database.

同時に、Windows システムイベントログはストレージデバイスエラーを報告します。

Warning       NODEDB1 129     pvscsi     Reset to device, \Device\RaidPort2, was issued.
Warning       NODEDB1 153     Disk       The IO operation at logical block address 0xxxxxxxx for Disk 4 (PDO name: \Device\0000007f) was retried.

このような問題に対処するには:

  • データベースとログ ファイルが存在するストレージ ボリュームがオンラインであることを確認し、コンピューターからストレージへの I/O パス全体が安定していて信頼性が高く、物理ファイルの損傷を引き起こすことはありません。
  • ハードウェアおよびデバイスの製造元と協力して、ハードウェアとその構成がデータベース システムの I/O 要件に適していることを確認してください。 I/O パス内のデバイス ドライバー、ファームウェア、BIOS、およびその他のサポートソフトウェア コンポーネントが最新であることを確認します。
  • DBCC CHECKDB を実行してデータベースの整合性を確認します (再起動後にオンラインにできる場合)
  • データベースとログ ファイルが完全ではなく、その結果データベースがオンラインにならない場合は、データベースの最新の正常なバックアップを復元します
  • 推奨事項のトラブルシューティングについては、MSSQLSERVER エラー 823 および DBCC CHECKDB によって報告されたデータベース整合性エラーのトラブルシューティングを参照してください。

TDE 暗号化または説明の失敗を解決する

外部の拡張キー管理 (EKM)/ハードウェア セキュリティ モジュール (HSM) サービスまたはプロバイダーを使用している場合は、サービスによって提供されるモジュールが安定して更新されていることを確認します。 EKM/HSM プロバイダー ベンダーと協力して、ファイルの暗号化/暗号化解除を実行するモジュールに関する問題を解決してください。

この問題が発生すると、SQL エラー ログで次の現象が発生する可能性があります。

**Dump thread - spid = 0, EC = 0x0000023FDA293320
***Stack Dump being sent to F:\Data\MSSQL13.INST1\MSSQL\LOG\SQLDump0007.txt
* *******************************************************************************
*
* BEGIN STACK DUMP:
*   11/22/22 12:04:58 spid 1
*
* Crypto Exception
*

00007FFBA0C81791 Module(ntdll+0000000000051791)
Stack Signature for the dump is 0x00000000D3AC1708
External dump process return code 0x20000001.  External dump process returned no errors.

Error: 15466, Severity: 16, State: 28.
An error occurred during decryption.
Error: 9001, Severity: 21, State: 16.
The log for database 'ContosoDb' is not available. Check the event log for related error messages. Resolve any errors and restart the database.