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

Troubleshooting Guide: SQL Server Error 3634

Why This Error Happens

Error 3634 occurs when SQL Server’s Database Engine attempts a file system operation—such as creating, writing to, or accessing a backup, data, or log file—and the underlying Windows operating system rejects the request. This is most commonly caused by insufficient NTFS permissions for the SQL Server service account, a locked or corrupted file, a full disk volume, or restrictive security software (antivirus/EDR) intercepting the file handle. Because the error message is a generic wrapper around a raw OS-level error code, the exact cause depends on the specific %ls values returned in the SQL Server error log.

Step-by-Step Resolution Guide

Step 1: Identify the Exact OS Error and File Path

  • Open the SQL Server Error Log (via SSMS > Management > SQL Server Logs, or the ERRORLOG file in C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\) to find the fully expanded message.
  • Note the specific Windows error code (e.g., “Access is denied,” “The system cannot find the file specified,” or “There is not enough space on the disk”).
  • Identify the exact file path and operation (e.g., CREATE FILE, BACKUP, or FlushFileBuffers) mentioned in the log.

Step 2: Verify NTFS Permissions and Service Account Rights

  • Right-click the target folder (e.g., the DATA or Backup directory) and go to Properties > Security.
  • Ensure the SQL Server service account (visible in SQL Server Configuration Manager under the “Log On As” column) has Full Control over the specific folder.
  • Run the following command in an elevated PowerShell prompt to grant permissions if missing:
icacls "D:\SQLData" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T

Step 3: Check Disk Space and File Locks

  • Verify the destination drive has sufficient free space using Get-PSDrive in PowerShell; SQL Server requires available space for both the data file and the transaction log during write operations.
  • Use Resource Monitor (resmon.exe) to check if another process (like a third-party backup tool or antivirus) has placed an exclusive lock on the .mdf, .ldf, or .bak file.
  • Restart the “SQL Server (MSSQLSERVER)” service via SQL Server Configuration Manager to release any stale handles if a lock is found.

Step 4: Exclude SQL Server Directories from Antivirus/EDR Scanning

  • Navigate to your Windows Security or third-party antivirus settings.
  • Add exclusions for the SQL Server executable (sqlservr.exe) and all data/log directories to prevent real-time scanning from intercepting file I/O operations mid-write.
  • Reboot the Windows Server 2025 instance if exclusions do not take effect on the SQL Server service immediately.

Alternative or Verification Steps

  • To verify the fix, attempt to manually run the failed operation again (e.g., execute a BACKUP DATABASE command or restart the SQL Server service) and check the Error Log for the absence of Event ID 3634.
  • If the error persists specifically during backups, run CHKDSK D: /F (replacing D: with your target drive) during a maintenance window to rule out underlying disk corruption as the root cause.