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

Why This Error Happens

Error 5210 occurs when SQL Server’s online file/page relocation process (such as DBCC SHRINKFILE with the MOVETO option or internal defragmentation routines) encounters a page type it does not recognize as movable, typically because the page is part of a corrupted allocation structure or belongs to a system object that cannot be relocated. This is most commonly caused by physical disk-level corruption, an interrupted I/O operation, or storage controller inconsistencies that have altered the page header metadata. It can also occur if the database was improperly shut down or if the underlying storage (SAN, NVMe, or virtual disk) silently dropped a write.

Step-by-Step Resolution Guide

Step 1: Run a Full Consistency Check

  • Open SQL Server Management Studio (SSMS) or a sqlcmd session targeting the affected instance.
  • Execute DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; to identify the exact page and object affected.
  • Review the output for the specific Page ID (%d:%d) referenced in Error 5210 to confirm which table or index is impacted.

Step 2: Validate Underlying Storage Health

  • On Windows Server 2025 / Windows 11, open Event Viewer and check Windows Logs > System for Disk or NTFS warnings (Event ID 7, 11, or 51).
  • Run chkdsk D: /f /r (replace D: with your SQL data drive) during a maintenance window to repair file system-level errors.
  • If using virtualized or SAN storage, verify with your storage vendor’s diagnostic tool that no write-cache or controller errors occurred.

Step 3: Restore or Repair the Affected Database

  • If a clean backup exists, restore the database using RESTORE DATABASE YourDatabaseName FROM DISK = 'E:\Backups\YourDatabaseName.bak' WITH REPLACE;
  • If no backup is available, run DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS) as a last resort, understanding that this may delete corrupted rows.
  • Take the database offline temporarily using ALTER DATABASE YourDatabaseName SET OFFLINE; before performing repairs to prevent further writes to the corrupted page.

Step 4: Prevent Future Occurrences

  • Enable CHECKSUM page verification by running ALTER DATABASE YourDatabaseName SET PAGE_VERIFY CHECKSUM; to catch corruption earlier.
  • Schedule weekly DBCC CHECKDB jobs via SQL Server Agent to proactively detect page-level issues before they escalate.

Alternative or Verification Steps

  • After remediation, re-run DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS; and confirm it returns 0 allocation errors and 0 consistency errors.
  • If corruption persists after repair attempts, restore from the most recent verified backup instead of relying on REPAIR_ALLOW_DATA_LOSS, as repeated corruption often indicates a hardware-level failure requiring disk replacement.