DBCC checkdb / dbcc checktable
1. Review the suspect_pages table in msdb to check if other pages are encountering this problem.
Select * from msdb..suspect_pages
2. follow the steps blow to fix data corruption for each database,
1) backup database before actions
2) find damaged objects,
USE master;
DBCC CHECKDB (DBName) WITH ALL_ERRORMSGS, NO_INFOMSGS, TABLERESULTS;
3) repair the damaged objects for each DB
USE master;
ALTER DATABASE DBName SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
Use DBName;
DBCC CHECKTABLE (TableName, repair_rebuild);
DBCC CHECKTABLE (TableName, REPAIR_ALLOW_DATA_LOSS); --if repair_rebuild not work
![](https://dotblogsfile.blob.core.windows.net/user/ellie.hong/5f56014c-3970-461d-8d84-5ca948ccd072/1660980395.png.png)
USE master;
DBCC CHECKDB (MSDB, REPAIR_ALLOW_DATA_LOSS);
USE master;
ALTER DATABASE DBName SET MULTI_USER;
4) backup database after repair
3. check SQL error log , database properties : recovery model / compatibility level …….