In the previous post of this series, I covered the system table checks that have to be done before anything else can be checked by CHECKDB. Now that I've described pages, extents, IAM chains/allocation units and the major allocation bitmaps, in this post I'll cover the allocation checks.
1. Primitive checks of critical system tables(Part 1...)
2. Allocation checks
This stage is in SQL Server 2000 and 2005. Allocation checks are checks of the various structures (IAM pages, IAM chains, allocation units, GAM/SGAM pages, PFS pages) that describe the allocations (pages, extents) that have been done within a database.
I'll describe how we go about collecting information from the various pages and then describe what some of the actual checks are.
The allocation checks are very fast (orders of magnitude faster than the logical checks, so fast in fact that they happen in the blink of an eye! well, perhaps I'm getting carried away a little as usual but you get the idea) because the number of database pages that have to be read is very small (so small in fact that... ok, I'll shut-up). The algorithm for gathering allocation data is as follows:
So, now we've got a whole bunch of allocation data that we're juggling and we need to make sense of it all to see if all the allocation structures are correct. Here's a non-exhaustive list of checks that we do with all this data:
Any errors found here will require REPAIR_ALLOW_DATA_LOSS to repair and some of the repairs are very complicated (e.g. multiply-allocated extents) - topic for a future blog post.
So, the allocation checks lay the next foundation level over the system table primitive checks and we're ready to move on to the logical checks.
3. Logical checks of critical system tables4. Logical checks of all tables(Part 3...)
5. Service Broker checks6. Metadata cross-checks7. Indexed view and XML index checks(Part 4...)
PingBack from http://www.julian-kuiters.id.au/article.php/sqlserver2005-inside-dbcc
PingBack from http://thestoragebench.info/story.php?id=10155