SQL Server Integrity Check - A Necessary Routine
- Verification of the allocated structures, i.e. GAM, SGAM, PFS, IAM...
- Verification of table consistency, including all of its indexes.
- Verification of the system catalogs.
- PFS pages, system tables and data purity detected errors aren't fixable by CheckDB.
- To repair using CheckDB, the database should be on SINGLE_USER mode.
- Fix the permission to create the snapshot.
- Execute the CheckDB with the TABLOCK option. This can bring problems, as the DB will be a target of locks.
- Create a process (job) doing the following steps:
- Create a snapshot of the database.
- Run the DBCC CheckDB on this snapshot. Yes, the DBCC CheckDB can run over databse snapshots. And it's obvious that a snapshot of a snapshot won't be created.
- SQL Server maintenance plan ignores the TempDB, but if the TempDB becomes corrupt the instance will shutdown. Use caution with this.
- Executing the CheckDB on the master database will cause the execution on the mssqlsystemresource database as well.
- NO_INFOMSGS: Avoid the output of info messages.
- ALL_ERRORMSDGS: Allow the output of error messages.
- Default since SQL Server 2008 SP1.
- NOINDEX: Skips nonclustered indexes verification.
- DATA_PURITY: Validates de data based on the column characteristcs.
- Default since SQL Server 2005.
- ESTIMATEONLY: Estimates the space needed on TempDB.
- As per Paul Randal, this option is broken on newer versions of SQL Server.
- TABLOCK: Uses locks instead of database snapshots.
- Useful when the snapshot creation is failing.
- EXTENDED_LOGICAL_CHECKS: Allows the validation on XML columns and Spatial indexes.
- This can be costly.
- PHYSICAL_ONLY: Skips most of the logical verifications.
- Need less resources to run, but a "full" execution should be sone periodically.
- CHECKALLOC
- CHECKTABLE
- CHECKCATALOG
- CHECKFILEGROUP
On this page
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Why Comprehensive Health Checks for MS SQL Servers Matter: Part 2

Why Comprehensive Health Checks for MS SQL Servers Matter: Part 2
May 4, 2022 12:00:00 AM
3
min read
Properly removing users in MySQL
Properly removing users in MySQL
May 12, 2016 12:00:00 AM
4
min read
Oracle 11G SCAN:Questions and Answers Post
Oracle 11G SCAN:Questions and Answers Post
Jul 18, 2011 12:00:00 AM
6
min read
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.