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

Troubleshooting Guide: Error 3111 – Control Page Restoration Failure

Why This Error Happens

Error 3111 occurs when SQL Server 2025 detects corruption on a control page—such as a GAM, SGAM, PFS, or boot page—that cannot be restored through a single-page restore operation because these pages are critical to the structural integrity of the entire database. This typically results from underlying disk I/O failures, improper shutdowns, storage subsystem corruption, or antivirus/backup software interfering with the database files (.mdf/.ldf) while SQL Server has them open. Since control pages map the allocation of every other page in the file, SQL Server refuses to perform an isolated page restore and instead requires a full database or file-level restore to maintain consistency.

Step-by-Step Resolution Guide

Step 1: Verify the Extent and Scope of Corruption

  • Open SQL Server Management Studio (SSMS) 21 or Azure Data Studio connected to your SQL Server 2025 instance.
  • Run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to confirm which pages are affected.
  • Check the SQL Server Error Log (default path: C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\Log\ERRORLOG) for correlating I/O or hardware-level warnings.

Step 2: Take a Tail-Log Backup (If Database Is Still Online)

  • Execute BACKUP LOG YourDatabaseName TO DISK = 'C:\Backups\YourDatabase_tail.trn' WITH NORECOVERY;
  • This captures any transactions since the last backup, which is essential since single-page restore is not an option here.
  • Skip this step only if the database is already offline or suspect.

Step 3: Restore the Full Database from a Clean Backup

  • Locate your most recent verified full backup file (e.g., C:\Backups\YourDatabase_FULL.bak).
  • Run: RESTORE DATABASE YourDatabaseName FROM DISK = 'C:\Backups\YourDatabase_FULL.bak' WITH REPLACE, NORECOVERY;
  • Apply subsequent differential and transaction log backups in sequence, ending with WITH RECOVERY on the final log restore.

Step 4: Check Underlying Storage Hardware

  • Open Event Viewer on Windows Server 2025 (eventvwr.msc) and navigate to Windows Logs > System to check for Disk or NTFS error events.
  • Run chkdsk C: /f /r (adjust drive letter to match your data volume) during a scheduled maintenance window.
  • Confirm storage drivers and firmware are updated, especially if using SAN/NAS or virtualized storage (Hyper-V/VMware).

Step 5: Exclude SQL Server Files from Antivirus Scanning

  • Open Windows Security or your third-party antivirus console.
  • Add exclusions for the .mdf, .ldf, and .ndf file paths, typically under C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\.
  • Restart the SQL Server service via services.msc or net start MSSQLSERVER to apply changes cleanly.

Alternative or Verification Steps

  • After restoring, re-run DBCC CHECKDB('YourDatabaseName') WITH NO_INFOMSGS; to confirm zero allocation or consistency errors are returned.
  • If no clean backup is available, as a last resort run DBCC CHECKDB('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) in single-user mode, but only after exhausting backup/restore options since this can result in permanent data loss.