How to fix Error 3422 on Windows Server 2025 / Windows 11

Troubleshooting Guide: SQL Server Error 3422 — Database Shutdown Due to Internal Error

Why This Error Happens

Error 3422 occurs when the SQL Server Database Engine encounters a critical internal error while executing a specific routine, forcing it to take the database offline to prevent further damage or data corruption. This is most commonly triggered by corrupted data pages, damaged transaction log files, or unexpected I/O failures at the storage subsystem level. In some cases, it can also stem from insufficient disk space or a failing/misconfigured disk controller that interrupts a write operation mid-transaction.

Step-by-Step Resolution Guide

Step 1: Review the SQL Server Error Log for Context

  • Navigate to C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG (path may vary based on instance name/version).
  • Search for the specific error number (%d) and routine name (%hs) referenced alongside the 3422 message to identify the exact failing component (e.g., a storage engine or buffer pool routine).
  • Cross-reference the timestamp with Windows Event Viewer (eventvwr.msc) under Windows Logs > System to check for underlying disk or hardware warnings.

Step 2: Check Database and Disk Integrity

  • Open SQL Server Management Studio (SSMS) and run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to detect corruption.
  • Verify the physical disk hosting the .mdf and .ldf files is healthy by running chkdsk C: /f /r (replace C: with the appropriate drive letter) from an elevated Command Prompt, then reboot if prompted.
  • Confirm there is adequate free disk space (at least 15-20% free) on the volume to avoid log or tempdb growth failures.

Step 3: Restart SQL Server and Allow Auto-Recovery

  • Since the error indicates SQL Server will attempt a restart once connections are aborted, manually terminate any lingering sessions using KILL <session_id> via SSMS if they are not clearing automatically.
  • Restart the SQL Server service via services.msc or by running net stop MSSQLSERVER && net start MSSQLSERVER in an elevated Command Prompt.
  • Monitor the ERRORLOG again to confirm the database transitions from “Recovery Pending” to “Online.”

Step 4: Restore from Backup if Corruption Persists

  • If DBCC CHECKDB reports unrepairable corruption, restore the database from the last known good backup using RESTORE DATABASE [YourDatabaseName] FROM DISK = 'E:\Backups\YourDatabase.bak' WITH REPLACE;.
  • Ensure the backup file integrity is verified beforehand using RESTORE VERIFYONLY FROM DISK = 'E:\Backups\YourDatabase.bak';.

Alternative or Verification Steps

  • Verify the fix by querying sys.databases and confirming the state_desc column shows ONLINE for the affected database: SELECT name, state_desc FROM sys.databases WHERE name = 'YourDatabaseName';.
  • If the issue recurs intermittently, update storage drivers and firmware on Windows Server 2025/Windows 11, and consider running SQL Server in a different I/O mode (e.g., toggling Instant File Initialization or adjusting antivirus exclusions for the .mdf/.ldf directories) to rule out third-party I/O interference.