Troubleshooting Guide: Error 5286 – Page Could Not Be Moved (Active Online Index Build with LOBs)
Why This Error Happens
This error occurs when SQL Server’s shrink or defragmentation process attempts to relocate a data page that is currently locked by an active online index build operation involving LOB (Large Object) data types such as VARCHAR(MAX), VARBINARY(MAX), or XML. Because online index operations maintain a separate mapping structure for LOB pages during the build, the page relocation engine cannot safely move these pages without risking data corruption, so SQL Server blocks the move and raises Error 5286. This is typically a transient concurrency conflict rather than actual corruption, often triggered when DBCC SHRINKFILE, DBCC SHRINKDATABASE, or auto-shrink runs concurrently with a long-running ONLINE = ON index rebuild.
Step-by-Step Resolution Guide
Step 1: Identify the Conflicting Online Index Operation
- Query
sys.dm_exec_requestsandsys.index_resumable_operationsto find active online index builds:SELECT * FROM sys.dm_exec_requests WHERE command LIKE '%INDEX%'; - Cross-reference the session ID (SPID) with
sys.dm_exec_sql_text(sql_handle)to confirm it is a LOB-related index rebuild. - Note the databaseid and objectid to correlate with the shrink operation that triggered Error 5286.
Step 2: Pause or Reschedule the Shrink Operation
- Cancel the active
DBCC SHRINKFILEorDBCC SHRINKDATABASEsession usingKILL <SPID>once you confirm it is safe to terminate. - Disable Auto-Shrink on the affected database via SSMS: Right-click database > Properties > Options > set “Auto Shrink” to False.
- Alternatively, run:
ALTER DATABASE [YourDB] SET AUTO_SHRINK OFF;
Step 3: Allow the Online Index Build to Complete
- Monitor progress using
SELECT percent_complete, estimated_completion_time FROM sys.dm_exec_requests WHERE command = 'ALTER INDEX'; - Avoid running shrink operations until
percent_completereaches 100 and the session clears fromsys.dm_exec_requests. - For very large LOB tables, consider using
ALTER INDEX ... RESUMEwithMAX_DURATIONandWAIT_AT_LOW_PRIORITYoptions (new in SQL Server 2025) to better control blocking windows.
Step 4: Re-run the Shrink Operation Sequentially
- Once the index rebuild completes, re-issue the shrink command in isolation:
DBCC SHRINKFILE (N'YourDataFile', 0); - Schedule shrink operations via SQL Agent during maintenance windows when no
ONLINE = ONindex operations are scheduled. - Confirm no other resumable index operations are paused mid-build using
sys.index_resumable_operations.
Step 5: Apply Latest Cumulative Update
- Verify your SQL Server 2025 build number via
SELECT @@VERSION;and compare against the latest Cumulative Update (CU) on the Microsoft Update Catalog. - Install the latest CU, as this error has known fixes related to LOB page-mapping race conditions in earlier SQL Server 2025 builds.
- Restart the SQL Server service via
services.mscornet stop MSSQLSERVER && net start MSSQLSERVERafter patching.
Alternative or Verification Steps
- Verify the fix by re-running
DBCC SHRINKFILEagainst the same file after the index operation completes — it should finish without raising Error 5286, and checksys.dm_db_file_space_usageto confirm space was reclaimed. - If the error persists outside of shrink operations, run
DBCC CHECKDBwithNO_INFOMSGS, ALL_ERRORMSGSto rule out actual page-level corruption as an underlying cause.