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

Why This Error Happens

Error 8902 occurs when SQL Server’s internal memory manager detects corruption in the structures used to track allocation pages during a DBCC CHECKDB or CHECKTABLE operation. This typically results from insufficient memory grants allocated to the DBCC process, conflicts with Windows Server 2025’s memory compression feature, or actual physical corruption in the database’s allocation bitmaps (GAM, SGAM, or PFS pages). In rare cases, outdated SQL Server Native Client drivers interacting with the new memory management APIs in Windows Server 2025 can also trigger this error.

Step-by-Step Resolution Guide

Step 1: Verify Available System Memory and SQL Server Memory Configuration

  • Open SQL Server Management Studio (SSMS) and run sp_configure 'max server memory' to check current allocation.
  • Ensure at least 20% of physical RAM remains free for the OS and DBCC buffer pool extensions.
  • On Windows Server 2025, open Task Manager > Performance > Memory and confirm “Compressed” memory usage is not excessively high, as this can starve SQL Server’s memory grants.

Step 2: Disable Memory Compression Conflicts (Windows Server 2025 Specific)

  • Open an elevated PowerShell terminal and run:
  Get-MMAgent
  • If MemoryCompression is enabled and SQL Server is running on a dedicated database host, disable it to prevent interference with SQL Server’s memory-mapped file operations:
  Disable-MMAgent -mc
  • Restart the server for the change to take effect.

Step 3: Run DBCC CHECKDB with Extended Logging

  • Execute the following in SSMS to isolate whether the error is transient or structural:
  DBCC CHECKDB (YourDatabaseName) WITH NO_INFOMSGS, ALL_ERRORMSGS, DATA_PURITY;
  • Review the SQL Server Error Log located at:
    C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG
  • Look for accompanying messages referencing specific page IDs (PageId) or allocation unit IDs tied to the 8902 error.

Step 4: Update SQL Server Native Client and Cumulative Updates

  • Confirm you are running the latest Cumulative Update (CU) for SQL Server 2025 via SQL Server Setup > Check for Updates.
  • Download and apply any pending CU from the Microsoft Update Catalog, as early builds of SQL Server 2025 had known memory-grant handling bugs with Windows 11/Server 2025 kernel changes.
  • Reboot the server after installation to fully apply kernel-level driver updates.

Step 5: Rebuild Corrupted Allocation Pages (If Structural Damage Confirmed)

  • If DBCC CHECKDB confirms allocation-level corruption, take the database offline and restore from the last known good backup:
  RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\Backups\YourDatabaseName.bak' WITH REPLACE;
  • Avoid using REPAIR_ALLOW_DATA_LOSS unless no valid backup exists, as it may permanently discard corrupted allocation structures.

Alternative or Verification Steps

  • Re-run DBCC CHECKDB (YourDatabaseName) WITH NO_INFOMSGS, ALL_ERRORMSGS; after completing the steps above — a clean result with zero allocation errors confirms resolution.
  • If the error persists, run DBCC MEMORYSTATUS to capture a memory snapshot and compare against SQL Server’s “Resource Governor” memory pools to identify any ongoing memory pressure.