Troubleshooting Guide: Error 4345 – Issues Recording Data in msdb..suspect_pages
Why This Error Happens
Error 4345 occurs when SQL Server’s internal process for logging page corruption events into the msdb.dbo.suspect_pages table fails, typically because the msdb database is in a restricted state (read-only, offline, or in single-user mode) or the table itself has reached its maximum row capacity (1,000 rows). This can also happen if the msdb database files are corrupted, the disk volume hosting msdb is full, or the SQL Server service account lacks the necessary write permissions on the msdb database. Since this table only logs informational corruption data, the error does not stop normal database operations but does prevent proper tracking of suspect pages for future repair operations.
Step-by-Step Resolution Guide
Step 1: Verify the State and Accessibility of msdb
- Open SQL Server Management Studio (SSMS) and run:
SELECT state_desc FROM sys.databases WHERE name = 'msdb'; - Confirm the result shows
ONLINE. If it showsRESTRICTED_USER,OFFLINE, orSUSPECT, this is likely the root cause. - Run
ALTER DATABASE msdb SET ONLINE;if the database is offline and no corruption is present. - Check Windows Server 2025 Disk Management or File Explorer to ensure the drive hosting
msdb.mdfandmsdb.ldf(commonly underC:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\) is not full.
Step 2: Check and Clear the suspect_pages Table Row Limit
- Connect via SSMS and run:
SELECT COUNT(*) FROM msdb.dbo.suspect_pages; - If the count is at or near 1000 rows, SQL Server cannot log new entries until space is cleared.
- Archive existing data if needed, then clear resolved entries:
DELETE FROM msdb.dbo.suspect_pages WHERE event_type = 5;(only removes entries marked as “repaired” or resolved). - Restart the SQL Server service via Services.msc (
SQL Server (MSSQLSERVER)) on Windows Server 2025 to refresh internal caching after cleanup.
Step 3: Validate Permissions for the SQL Server Service Account
- Open SQL Server Configuration Manager and note the service account running the SQL Server (MSSQLSERVER) service.
- In SSMS, navigate to
Security > Logins, locate the service account, and confirm it hasdb_owneror equivalent write permissions onmsdb. - Grant missing permissions using:
USE msdb; ALTER ROLE db_owner ADD MEMBER [DOMAIN\ServiceAccount]; - Restart the SQL Server service for permission changes to take effect.
Step 4: Run Database Consistency Checks on msdb
- Execute
DBCC CHECKDB ('msdb') WITH NO_INFOMSGS, ALL_ERRORMSGS;to rule out underlying corruption in system tables. - Review the output for any allocation or consistency errors specific to
suspect_pagesor related system tables. - If corruption is confirmed, restore
msdbfrom a recent known-good backup usingRESTORE DATABASE msdb FROM DISK = 'path\to\backup.bak' WITH REPLACE;
Alternative or Verification Steps
- To verify the fix, trigger a test checksum failure (in a non-production environment) or monitor the SQL Server Error Log (
Management > SQL Server Logsin SSMS) for Error 4345 recurrence over the next 24–48 hours. - If the issue persists despite the above steps, consider rebuilding the
msdbdatabase using the SQL Server 2025 setup installation media with theREBUILDDATABASEparameter, followed by reapplying SQL Agent jobs and maintenance plans from backups.