Troubleshooting Guide: Error 8948 – PFS Page Type Mismatch in SQL Server 2025
Why This Error Happens
Error 8948 occurs when the Page Free Space (PFS) page’s allocation status byte for a given page does not match the actual type of data stored on that page, indicating database corruption. This mismatch is typically caused by physical disk-level I/O failures, improper shutdowns, faulty storage controllers/drivers, or corrupted memory pages being flushed to disk before a crash. It can also surface after restoring a backup that was taken while the database was already in an inconsistent state.
Step-by-Step Resolution Guide
Step 1: Run DBCC CHECKDB to Assess the Damage
- Open SQL Server Management Studio (SSMS) and connect to the affected instance.
- Execute the following command to get a full diagnostic report without making changes:
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;
- Review the output specifically for the
%S_PGIDvalues mentioned in the error to identify exactly which pages are affected.
Step 2: Restore from a Known Good Backup (Primary Fix)
- Since PFS corruption often indicates underlying storage issues, the safest fix is restoring the database from the last verified clean backup.
- Navigate to your backup directory (e.g.,
D:\SQLBackups\) and verify the backup integrity first:
RESTORE VERIFYONLY FROM DISK = 'D:\SQLBackups\YourDatabase.bak';
- Perform the restore operation:
RESTORE DATABASE YourDatabaseName FROM DISK = 'D:\SQLBackups\YourDatabase.bak' WITH REPLACE, RECOVERY;
- If possible, apply transaction log backups taken after the full backup to minimize data loss.
Step 3: Check Hardware and Windows Event Logs
- Open the Windows Event Viewer (
eventvwr.msc) on the Windows Server 2025 host and check the System log for Disk, Ntfs, or Storport warnings around the time the error first appeared. - Verify the physical disk health using
Get-PhysicalDiskin PowerShell to rule out failing SSD/HDD hardware. - Update storage drivers via Device Manager if the controller firmware is outdated, as this is a common cause of silent I/O corruption on Windows Server 2025.
Step 4: Run Repair as a Last Resort (Data Loss Possible)
- If no backup is available, set the database to single-user mode first:
ALTER DATABASE YourDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
- Run the repair command, acknowledging that this may deallocate the corrupted pages entirely:
DBCC CHECKDB ('YourDatabaseName', REPAIR_ALLOW_DATA_LOSS);
- Revert the database back to multi-user access once the repair completes:
ALTER DATABASE YourDatabaseName SET MULTI_USER;
Alternative or Verification Steps
- Verify the Fix: Re-run
DBCC CHECKDB ('YourDatabaseName') WITH NO_INFOMSGS, ALL_ERRORMSGS;after the restore or repair; a clean result with 0 allocation errors confirms the PFS mismatch has been resolved. - Alternative: If corruption recurs frequently, run
CHKDSK D: /F /R(replacingD:with your data drive) during a maintenance window to rule out underlying NTFS file system corruption on Windows Server 2025.