<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server Storage Engine : On-Disk Structures</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx</link><description>Tags: On-Disk Structures</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>CHECKDB (Part 8): Can repair fix everything?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2007/02/04/checkdb-part-8-did-repair-fix-everything.aspx</link><pubDate>Sun, 04 Feb 2007 19:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1598373</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/1598373.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=1598373</wfw:commentRss><description>&lt;P&gt;I was teaching at a Microsoft-internal class last week and there was a discussion on what corruptions can't be repaired using DBCC. At the same time, several threads popped up on forums and newsgroups with people hitting some of this unrepairable corruptions so I thought that would make a good topic for the next post in the CHECKDB series.&lt;/P&gt;
&lt;P&gt;Before anyone takes this the wrong&amp;nbsp;way - what do I mean by&amp;nbsp;"can't be repaired"? Remember that that purpose of repair is to make the database structurally consistent, and that to do this usually means deleting the corrupt data/structure (that's why the option to do this was aptly named REPAIR_ALLOW_DATA_LOSS - see &lt;A class="" href="http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/16/633645.aspx" mce_href="http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/16/633645.aspx"&gt;this post&lt;/A&gt; for more explanation on why repair can be bad). A corruption is deemed unrepairable when it doesn't make sense to repair it given the damage the repair would cause, or the corruption is so rare and so complicated to repair correctly that it's not worth the engineering effort to provide a repair. Remember also that &lt;U&gt;recovery from corruptions should be based on a sound backup strategy&lt;/U&gt;, not on running repair, so making this trade-off in functionality makes perfect sense.&lt;/P&gt;
&lt;P&gt;Here's a few of the more common unrepairable corruptions that people run into along with the reasons they can't be repaired by DBCC.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;PFS page header corruption&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;An example of this is on SQL Server 2005:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Msg 8946, Level 16, State 12, Line 1&lt;BR&gt;Table error: Allocation page (1:13280496) has invalid PFS_PAGE page header values.&lt;BR&gt;Type is 0. Check type, alloc unit ID and page ID on the page.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;CHECKDB uses the PFS pages to determine which pages are allocated - and so which pages to read to drive the various consistency checks. The only repair for a PFS page is to reconsutruct it - they can't simply be deleted as they're a fixed part of the fabric of the database. PFS pages cannot be rebuilt because there is no infallible way to determine which pages are allocated or not. There are various algorithms I've experimented with to rebuild them with optimistic or pessimistic setting of page allocation statuses and then re-run the various consisteny checks to try to sort out the incorrect choices, but they all require very long run-times. Given the frequency with which we see these corruptions, and the engineering effort required to come up with an (imperfect) solution, I made the choice to leave this as unrepairable.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Critical system table clustered-index leaf-page corruption&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;An example of this is on SQL Server 2000:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Server: Msg 8966, Level 16, State 1, Line 1&lt;BR&gt;Could not read and latch page (1:18645) with latch type SH. sysindexes failed.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;And on SQL Server 2005:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&lt;FONT size=1&gt;Msg 7985, Level 16, State 2, Server SUNART, Line 1&lt;BR&gt;System table pre-checks: Object ID 4. Could not read and latch page (1:51) with&lt;BR&gt;latch type SH. Check statement terminated due to unrepairable error.&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;In a &lt;A class="" href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/19/636410.aspx" mce_href="https://blogs.msdn.com:443/sqlserverstorageengine/archive/2006/06/19/636410.aspx"&gt;previous post&lt;/A&gt; I described why how and why we do special checks of the clustered indexes of the critical system tables. If any of the pages at the leaf-level of these indexes are corrupt, we cannot repair them. Repairing would mean deallocating the page, wiping out the most important metadata for potentially hundreds of user tables and so effectively deleteing all of these tables. That's obviously an unpalatable repair for anyone to allow and so we don't do it.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Column value&amp;nbsp;corruption&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here's an example of this on SQL Server 2005:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Msg 2570, Level 16, State 3, Line 1&lt;BR&gt;Page (1:152), slot 0 in object ID 2073058421, index ID 0, partition ID 72057594038321152, alloc unit ID 72057594042318848 (type "In-row data"). Column "c1" value is out of range for data type "datetime".&amp;nbsp; Update column to a legal value.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;This is where a column has a stored value that is outside the valid range for the column type. There are a couple of repairs we &lt;EM&gt;could&lt;/EM&gt; do for this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;delete the entire record&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;insert a dummy value&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;#1 isn't very palatable because then we've lost data and its not a &lt;EM&gt;structural&lt;/EM&gt; problem in the database so doesn't &lt;EM&gt;have&lt;/EM&gt; to be repaired. #2 is dangerous - what value should we choose as the dummy value? Any value we put in may adversely affect business logic, or fire a trigger, or have some unwelcome meaning in the context of the table - even a NULL. Given these problems, we chose to allow people to fix the corrupt values themselves.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Metadata corruption&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Here's an example of this on SQL Server 2005:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Msg 3854, Level 16, State 1, Line 2&lt;BR&gt;Attribute (referenced_major_id=2089058478) of row (class=0,object_id=2105058535,column_id=0,referenced_major_id=2089058478,referenced_minor_id=0) in sys.sql_dependencies has a matching row (object_id=2089058478) in sys.objects (type=SN) that is invalid.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;This example is relatively benign. There are other examples that will cause CHECKDB to terminate - not as bad as the critical system table corruption example above, but enough that CHECKDB doesn't trust the metadata enough to use it to drive consistency checks. Repairing metadata corruption has the same problems as repairing critical system table corruption - any repair means deleting metadata about one or more tables, and hence deleting the tables themselves. It's far better to leave the corruption unrepaired so that as much data as possible can be extracted from the remaining tables.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Repair can't fix everything. You may end up having to perform manual and time-consuming data extraction from the corrupt database and losing lots of data because of, say,&amp;nbsp;a critical system table corruption. Bottom line (as usual) - make sure you have valid backups so you don't get into this state!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1598373" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC/default.aspx">DBCC</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC+CHECKDB+Series/default.aspx">DBCC CHECKDB Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>More undocumented fun: DBCC IND, DBCC PAGE, and off-row columns</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/12/13/More-undocumented-fun_3A00_-DBCC-IND_2C00_-DBCC-PAGE_2C00_-and-off_2D00_row-columns.aspx</link><pubDate>Thu, 14 Dec 2006 01:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1278602</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/1278602.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=1278602</wfw:commentRss><description>&lt;P&gt;&lt;EM&gt;(Final blog post of the year for me. Its been a bit of a wild ride the last 6 months - 7 TechEds on 3 continents, 46 blog posts&amp;nbsp;and&amp;nbsp;some major life changes - but now things have calmed down and I should be back to more regular posting in 2007. Tomorrow I fly out to &lt;A class="" href="http://www.wakatobi.com/" mce_href="http://www.wakatobi.com"&gt;Wakatobi&lt;/A&gt; in Indonesia to go diving with my partner until January, which is some long overdue R&amp;amp;R. I'll post a link to some photos in January - she's already been out there for two weeks on a live-aboard and has over 3000 photos... In the meantime, I have all my loose-ends tied up at work so time to squeeze in a post. Thanks for all your comments and emails this year - I hope you all have a great holiday and may your pagers be silent throughout!)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;At TechEd in November, in one of the sessions I did with &lt;A class="" href="http://www.sqlskills.com/blogs/kimberly/" mce_href="http://www.sqlskills.com/blogs/kimberly/"&gt;Kimberly&lt;/A&gt; we demo'd both DBCC IND and DBCC PAGE in the context of following links to columns that have been pushed off-row when the row size exceeds 8060 bytes. The point of the demo is to show that even if an index is perfectly defragmented, the performance of a query that does a range scan may suffer if off-row columns are part of the result set because getting to those off-row columns involves random IOs.&lt;/P&gt;
&lt;P&gt;What I'd like to do in this post is run through the demo we did, and at the same time introduce you to the undocumented DBCC IND command. This is like DBCC PAGE - it's used extensively internally but isn't documented or supported - use at your own risk. You already know about using DBCC PAGE to investigate page contents from my previous posts (&lt;A class="" href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/08/09/692806.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/08/09/692806.aspx"&gt;here&lt;/A&gt; and &lt;A class="" href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx"&gt;here&lt;/A&gt;) so I'm not going to go into details.&lt;/P&gt;
&lt;P&gt;To start off, we create a table with a schema that can cause rows to be greater than 8060 bytes. In previous versions, creating a schema like this has always been possible, but actually getting rows larger then 8060 was not. Checkout my previous post on &lt;A class="" href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/646865.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/646865.aspx"&gt;IAM chains and allocation units in SQL Server 2005&lt;/A&gt;&amp;nbsp;for more details of large rows (and a few other cool new features in 2005). I'll assume that you've got a database called dbccpagetest that you're using.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TABLE&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(c&lt;/FONT&gt;&lt;FONT size=2&gt;1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&amp;nbsp;&lt;/FONT&gt;&lt;FONT size=2&gt;c2 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VARCHAR&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;8000&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; c3 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VARCHAR&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;8000&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CLUSTERED&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INDEX&lt;/FONT&gt;&lt;FONT size=2&gt; row_cl &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;c1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;Now we need to populate the table so we have something to look at.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'b'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;2&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'b'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;3&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'b'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;4&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'b'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;5&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'b'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;And now the new command - use DBCC IND to find out which page IDs to look at with DBCC PAGE.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DBCC&lt;/FONT&gt;&lt;FONT size=2&gt; IND &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'dbccpagetest'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'rowoverflowtest'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;The output is (prettified in Excel):&lt;/P&gt;
&lt;P mce_keep="true"&gt;
&lt;TABLE class="" style="WIDTH: 445pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=594 border=0 x:str&gt;
&lt;COLGROUP&gt;
&lt;COL style="WIDTH: 28pt; mso-width-source: userset; mso-width-alt: 1336" span=2 width=38&gt;
&lt;COL style="WIDTH: 27pt; mso-width-source: userset; mso-width-alt: 1280" width=36&gt;
&lt;COL style="WIDTH: 28pt; mso-width-source: userset; mso-width-alt: 1308" width=37&gt;
&lt;COL style="WIDTH: 54pt; mso-width-source: userset; mso-width-alt: 2560" width=72&gt;
&lt;COL style="WIDTH: 30pt; mso-width-source: userset; mso-width-alt: 1422" width=40&gt;
&lt;COL style="WIDTH: 42pt; mso-width-source: userset; mso-width-alt: 1991" width=56&gt;
&lt;COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4664" width=131&gt;
&lt;COL style="WIDTH: 48pt" width=64&gt;
&lt;COL style="WIDTH: 32pt; mso-width-source: userset; mso-width-alt: 1507" width=42&gt;
&lt;COL style="WIDTH: 30pt; mso-width-source: userset; mso-width-alt: 1422" width=40&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 43.2pt; mso-height-source: userset" height=58&gt;
&lt;TD class=xl24 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 43.2pt; BACKGROUND-COLOR: transparent" width=38 height=58 class="xl24"&gt;PageFID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=38 class="xl25"&gt;PagePID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=36 class="xl25"&gt;IAMFID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=37 class="xl25"&gt;IAMPID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=72 class="xl25"&gt;ObjectID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl25"&gt;IndexID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=56 class="xl25"&gt;PartitionNumber&lt;/TD&gt;
&lt;TD class=xl29 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 98pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=131 class="xl29"&gt;PartitionID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=64 class="xl25"&gt;iam_chain_type&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=42 class="xl25"&gt;PageType&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl25"&gt;IndexLevel&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 26.4pt" height=35&gt;
&lt;TD class=xl26 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: #c1ccd9; HEIGHT: 26.4pt; BACKGROUND-COLOR: transparent" width=38 height=35 class="xl26" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=38 class="xl27" x:num u1:num&gt;156&lt;/TD&gt;
&lt;TD class=xl28 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=36 class="xl28"&gt;NULL&lt;/TD&gt;
&lt;TD class=xl28 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=37 class="xl28"&gt;NULL&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=72 class="xl27" x:num u1:num&gt;133575514&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=40 class="xl27" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=56 class="xl27" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" class="xl30"&gt;72057594039959552&lt;/TD&gt;
&lt;TD class=xl28 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=64 class="xl28"&gt;In-row data&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=42 class="xl27" x:num u1:num&gt;10&lt;/TD&gt;
&lt;TD class=xl28 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=40 class="xl28"&gt;NULL&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 27pt" height=36&gt;
&lt;TD class=xl31 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 27pt; BACKGROUND-COLOR: transparent" width=38 height=36 class="xl31" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=38 class="xl32" x:num u1:num&gt;155&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=36 class="xl32" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=37 class="xl32" x:num u1:num&gt;156&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=72 class="xl32" x:num u1:num&gt;133575514&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl32" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=56 class="xl32" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl34 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" class="xl34"&gt;72057594039959552&lt;/TD&gt;
&lt;TD class=xl33 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=64 class="xl33"&gt;In-row data&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=42 class="xl32" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl32" x:num u1:num&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;(I've&amp;nbsp;stripped off the 4 trailing&amp;nbsp;columns, NextPageFID, NextPagePID,&amp;nbsp;PrevPageFID, PrevPagePID so it&amp;nbsp;all fits in the window. They're all zero.)&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;The columns mean:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PageFID - the file ID of the page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PagePID - the page number in the file&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;IAMFID - the file ID of the IAM page that maps this page (this will be NULL for IAM pages themselves as they're not self-referential)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;IAMPID - the page number in the file of the IAM page that maps this page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;ObjectID - the ID of the object this page is part of&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;IndexID - the ID of the index this page is part of&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PartitionNumber - the partition number (as defined by the partitioning scheme for the index) of the partition this page is part of&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PartitionID - the internal ID of the partition this page is part of&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;iam_chain_type - see &lt;A class="" href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/646865.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/646865.aspx"&gt;IAM chains and allocation units in SQL Server 2005&lt;/A&gt;&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PageType - the page type. Some common ones are:&lt;/DIV&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;1 - data page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;2 - index page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;3 and 4 - text pages&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;8 - GAM page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;9 - SGAM page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;10 - IAM page&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;11 - PFS page&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;IndexLevel - what level the page is at in the index (if at all). Remember that index levels go from 0 at the leaf to N at the root page (except in clustered indexes in SQL Server 2000 and 7.0 - where there's a 0 at the leaf level (data pages) and a 0 at the next level up (first level of index pages))&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;NextPageFID and NextPagePID - the page ID of the next page in the doubly-linked list of pages at this level of the index&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;PrevPageFID and PrevPagePID - the page ID of the previous page in the doubly-linked list of pages at this level of the index&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;So you can see we've got a single page clustered index with an IAM page. Note that the page IDs returned may differ on your server. Let's look at the data page, focusing on the record for c1 = 3.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DBCC&lt;/FONT&gt;&lt;FONT size=2&gt; TRACEON &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;3604&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DBCC&lt;/FONT&gt;&lt;FONT size=2&gt; PAGE &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;dbccpagetest&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 155&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 3&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/FONT&gt;Don't forget that we need to turn on T3604 first to get the output back to the console. The dump for the 3rd row is (remembering that slots are number from zero, so slot 2 is row 3):&lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;Slot 2 Offset 0x216 Length 219&lt;/P&gt;
&lt;P&gt;Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS&lt;/P&gt;
&lt;P&gt;Memory Dump @0x44DCC216&lt;/P&gt;
&lt;P&gt;00000000: 30000800 03000000 04000003 00130077 †0..............w &lt;/P&gt;
&lt;P&gt;00000010: 00db0061 61616161 61616161 61616161 †...aaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000020: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000030: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000040: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000050: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000060: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000070: 61616161 61616162 62626262 62626262 †aaaaaaabbbbbbbbb &lt;/P&gt;
&lt;P&gt;00000080: 62626262 62626262 62626262 62626262 †bbbbbbbbbbbbbbbb &lt;/P&gt;
&lt;P&gt;00000090: 62626262 62626262 62626262 62626262 †bbbbbbbbbbbbbbbb &lt;/P&gt;
&lt;P&gt;000000A0: 62626262 62626262 62626262 62626262 †bbbbbbbbbbbbbbbb &lt;/P&gt;
&lt;P&gt;000000B0: 62626262 62626262 62626262 62626262 †bbbbbbbbbbbbbbbb &lt;/P&gt;
&lt;P&gt;000000C0: 62626262 62626262 62626262 62626262 †bbbbbbbbbbbbbbbb &lt;/P&gt;
&lt;P&gt;000000D0: 62626262 62626262 626262†††††††††††††bbbbbbbbbbb &lt;/P&gt;
&lt;P&gt;UNIQUIFIER = [NULL] &lt;/P&gt;
&lt;P&gt;Slot 2 Column 1 Offset 0x4 Length 4&lt;/P&gt;
&lt;P&gt;c1 = 3 &lt;/P&gt;
&lt;P&gt;Slot 2 Column 2 Offset 0x13 Length 100&lt;/P&gt;
&lt;P&gt;c2 = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;/P&gt;
&lt;P&gt;Slot 2 Column 3 Offset 0x77 Length 100&lt;/P&gt;
&lt;P&gt;c3 = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb&lt;/P&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;You can see that all the data is stored in-row. Now&amp;nbsp;we update one of the columns so that the row size exceeds 8060 bytes.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;UPDATE&lt;/FONT&gt;&lt;FONT size=2&gt; rowoverflowtest &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;SET&lt;/FONT&gt;&lt;FONT size=2&gt; c3 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;REPLICATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'c'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 8000&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;WHERE&lt;/FONT&gt;&lt;FONT size=2&gt; c1 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; 3&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;And run DBCC IND again to see if anything changed. The output is:&lt;/P&gt;
&lt;P mce_keep="true"&gt;
&lt;TABLE class="" style="WIDTH: 445pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=594 border=0 x:str&gt;
&lt;COLGROUP&gt;
&lt;COL style="WIDTH: 28pt; mso-width-source: userset; mso-width-alt: 1336" span=2 width=38&gt;
&lt;COL style="WIDTH: 27pt; mso-width-source: userset; mso-width-alt: 1280" width=36&gt;
&lt;COL style="WIDTH: 28pt; mso-width-source: userset; mso-width-alt: 1308" width=37&gt;
&lt;COL style="WIDTH: 54pt; mso-width-source: userset; mso-width-alt: 2560" width=72&gt;
&lt;COL style="WIDTH: 30pt; mso-width-source: userset; mso-width-alt: 1422" width=40&gt;
&lt;COL style="WIDTH: 42pt; mso-width-source: userset; mso-width-alt: 1991" width=56&gt;
&lt;COL style="WIDTH: 98pt; mso-width-source: userset; mso-width-alt: 4664" width=131&gt;
&lt;COL style="WIDTH: 48pt" width=64&gt;
&lt;COL style="WIDTH: 32pt; mso-width-source: userset; mso-width-alt: 1507" width=42&gt;
&lt;COL style="WIDTH: 30pt; mso-width-source: userset; mso-width-alt: 1422" width=40&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 43.2pt; mso-height-source: userset" height=58&gt;
&lt;TD class=xl24 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 43.2pt; BACKGROUND-COLOR: transparent" width=38 height=58 class="xl24"&gt;PageFID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=38 class="xl25"&gt;PagePID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=36 class="xl25"&gt;IAMFID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=37 class="xl25"&gt;IAMPID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=72 class="xl25"&gt;ObjectID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl25"&gt;IndexID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=56 class="xl25"&gt;PartitionNumber&lt;/TD&gt;
&lt;TD class=xl32 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 98pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=131 class="xl32"&gt;PartitionID&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=64 class="xl25"&gt;iam_chain_type&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=42 class="xl25"&gt;PageType&lt;/TD&gt;
&lt;TD class=xl25 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl25"&gt;IndexLevel&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 26.4pt" height=35&gt;
&lt;TD class=xl35 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 26.4pt; BACKGROUND-COLOR: transparent" width=38 height=35 class="xl35" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl36 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=38 class="xl36" x:num u1:num&gt;156&lt;/TD&gt;
&lt;TD class=xl37 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=36 class="xl37"&gt;NULL&lt;/TD&gt;
&lt;TD class=xl37 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=37 class="xl37"&gt;NULL&lt;/TD&gt;
&lt;TD class=xl36 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=72 class="xl36" x:num u1:num&gt;133575514&lt;/TD&gt;
&lt;TD class=xl36 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl36" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl36 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=56 class="xl36" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl38 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 98pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=131 class="xl38"&gt;72057594039959552&lt;/TD&gt;
&lt;TD class=xl37 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=64 class="xl37"&gt;In-row data&lt;/TD&gt;
&lt;TD class=xl36 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=42 class="xl36" x:num u1:num&gt;10&lt;/TD&gt;
&lt;TD class=xl37 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl37"&gt;NULL&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 26.4pt" height=35&gt;
&lt;TD class=xl26 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: #c1ccd9; HEIGHT: 26.4pt; BACKGROUND-COLOR: transparent" width=38 height=35 class="xl26" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=38 class="xl27" x:num u1:num&gt;155&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=36 class="xl27" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=37 class="xl27" x:num u1:num&gt;156&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=72 class="xl27" x:num u1:num&gt;133575514&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=40 class="xl27" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=56 class="xl27" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl33 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 98pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=131 class="xl33"&gt;72057594039959552&lt;/TD&gt;
&lt;TD class=xl28 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=64 class="xl28"&gt;In-row data&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=42 class="xl27" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl27 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: #c1ccd9; BACKGROUND-COLOR: transparent" width=40 class="xl27" x:num u1:num&gt;0&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 39.6pt" height=53&gt;
&lt;TD class=xl39 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: windowtext 0.5pt solid; HEIGHT: 39.6pt; BACKGROUND-COLOR: transparent" width=38 height=53 class="xl39" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl40 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=38 class="xl40" x:num u1:num&gt;158&lt;/TD&gt;
&lt;TD class=xl41 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=36 class="xl41"&gt;NULL&lt;/TD&gt;
&lt;TD class=xl41 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=37 class="xl41"&gt;NULL&lt;/TD&gt;
&lt;TD class=xl40 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=72 class="xl40" x:num u1:num&gt;133575514&lt;/TD&gt;
&lt;TD class=xl40 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl40" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl40 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=56 class="xl40" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl42 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 98pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=131 class="xl42"&gt;72057594039959552&lt;/TD&gt;
&lt;TD class=xl41 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=64 class="xl41"&gt;Row-overflow data&lt;/TD&gt;
&lt;TD class=xl40 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=42 class="xl40" x:num u1:num&gt;10&lt;/TD&gt;
&lt;TD class=xl41 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 0.5pt solid; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl41"&gt;NULL&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 40.2pt" height=54&gt;
&lt;TD class=xl29 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: windowtext 1pt solid; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; HEIGHT: 40.2pt; BACKGROUND-COLOR: transparent" width=38 height=54 class="xl29" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=38 class="xl30" x:num u1:num&gt;157&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 27pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=36 class="xl30" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 28pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=37 class="xl30" x:num u1:num&gt;158&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 54pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=72 class="xl30" x:num u1:num&gt;133575514&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl30" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 42pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=56 class="xl30" x:num u1:num&gt;1&lt;/TD&gt;
&lt;TD class=xl34 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: windowtext; WIDTH: 98pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=131 class="xl34"&gt;72057594039959552&lt;/TD&gt;
&lt;TD class=xl31 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 48pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=64 class="xl31"&gt;Row-overflow data&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 32pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=42 class="xl30" x:num u1:num&gt;3&lt;/TD&gt;
&lt;TD class=xl30 style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: #c1ccd9; BORDER-LEFT: #c1ccd9; WIDTH: 30pt; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent" width=40 class="xl30" x:num u1:num&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;(Again, I've stripped off the trailing 4 columns - they're all zero)&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Cool - we have another IAM page and a text page, in a row-overflow IAM chain. So something must have been pushed off-row into page (1:157). Let's have another look at the clustered-index data page, focusing on the 3rd row again:&lt;FONT size=1&gt;&lt;/P&gt;
&lt;P&gt;Slot 2 Offset 0x4a7 Length 143&lt;/P&gt;
&lt;P&gt;Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS&lt;/P&gt;
&lt;P&gt;Memory Dump @0x44DCC4A7&lt;/P&gt;
&lt;P&gt;00000000: 30000800 03000000 04000003 00130077 †0..............w &lt;/P&gt;
&lt;P&gt;00000010: 008f8061 61616161 61616161 61616161 †...aaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000020: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000030: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000040: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000050: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000060: 61616161 61616161 61616161 61616161 †aaaaaaaaaaaaaaaa &lt;/P&gt;
&lt;P&gt;00000070: 61616161 61616102 00004401 000000a6 †aaaaaaa...D..... &lt;/P&gt;
&lt;P&gt;00000080: 2e000040 1f00009d 00000001 000000††††...@........... &lt;/P&gt;
&lt;P&gt;UNIQUIFIER = [NULL] &lt;/P&gt;
&lt;P&gt;Slot 2 Column 1 Offset 0x4 Length 4&lt;/P&gt;
&lt;P&gt;c1 = 3 &lt;/P&gt;
&lt;P&gt;Slot 2 Column 2 Offset 0x13 Length 100&lt;/P&gt;
&lt;P&gt;c2 = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&lt;/P&gt;
&lt;P&gt;c3 = [BLOB Inline Root] Slot 2 Column 3 Offset 0x77 Length 24&lt;/P&gt;
&lt;P&gt;Level = 0 Unused = 68 UpdateSeq = 1&lt;/P&gt;
&lt;P&gt;TimeStamp = 782630912 &lt;/P&gt;
&lt;P&gt;Link 0&lt;/P&gt;
&lt;P&gt;Size = 8000 RowId = (1:157:0) &lt;/P&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;The 2nd varchar column is no longer stored on the page - instead the value have been replaced with an in-row blob root, pointing to an 8000 byte long blob fragment stored in slot 0 of page (1:157). If we dump it with DBCC PAGE we should see its got our value in:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DBCC&lt;/FONT&gt;&lt;FONT size=2&gt; PAGE &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;dbccpagetest&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 157&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 3&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;And the output is (slightly curtailed):&lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;PAGE: (1:157)&lt;/P&gt;
&lt;P&gt;BUFFER:&lt;/P&gt;
&lt;P&gt;BUF @0x02BE8D84&lt;/P&gt;
&lt;P&gt;bpage = 0x03FB6000 bhash = 0x00000000 bpageno = (1:157)&lt;/P&gt;
&lt;P&gt;bdbid = 9 breferences = 0 bUse1 = 8105&lt;/P&gt;
&lt;P&gt;bstat = 0xc0010b blog = 0x1432159b bnext = 0x00000000&lt;/P&gt;
&lt;P&gt;PAGE HEADER:&lt;/P&gt;
&lt;P&gt;Page @0x03FB6000&lt;/P&gt;
&lt;P&gt;m_pageId = (1:157) m_headerVersion = 1 m_type = 3&lt;/P&gt;
&lt;P&gt;m_typeFlagBits = 0x0 m_level = 0 m_flagBits = 0x8000&lt;/P&gt;
&lt;P&gt;m_objId (AllocUnitId.idObj) = 117 m_indexId (AllocUnitId.idInd) = 256 &lt;/P&gt;
&lt;P&gt;Metadata: AllocUnitId = 72057594045595648 &lt;/P&gt;
&lt;P&gt;Metadata: PartitionId = 72057594039959552 Metadata: IndexId = 1&lt;/P&gt;
&lt;P&gt;Metadata: ObjectId = 133575514 m_prevPage = (0:0) m_nextPage = (0:0)&lt;/P&gt;
&lt;P&gt;pminlen = 0 m_slotCnt = 1 m_freeCnt = 80&lt;/P&gt;
&lt;P&gt;m_freeData = 8110 m_reservedCnt = 0 m_lsn = (21:107:19)&lt;/P&gt;
&lt;P&gt;m_xactReserved = 0 m_xdesId = (0:0) m_ghostRecCnt = 0&lt;/P&gt;
&lt;P&gt;m_tornBits = 0 &lt;/P&gt;
&lt;P&gt;Allocation Status&lt;/P&gt;
&lt;P&gt;GAM (1:2) = ALLOCATED SGAM (1:3) = ALLOCATED &lt;/P&gt;
&lt;P&gt;PFS (1:1) = 0x64 MIXED_EXT ALLOCATED 100_PCT_FULL DIFF (1:6) = CHANGED&lt;/P&gt;
&lt;P&gt;ML (1:7) = NOT MIN_LOGGED &lt;/P&gt;
&lt;P&gt;Blob row at: Page (1:157) Slot 0 Length: 8014 Type: 3 (DATA)&lt;/P&gt;
&lt;P&gt;Blob Id:782630912&lt;/P&gt;
&lt;P&gt;44DCC06E: 63636363 63636363 63636363 63636363 cccccccccccccccc&lt;/P&gt;
&lt;P&gt;44DCC07E: 63636363 63636363 63636363 63636363 cccccccccccccccc&lt;/P&gt;
&lt;P&gt;44DCC08E: 63636363 63636363 63636363 63636363 cccccccccccccccc&lt;/P&gt;
&lt;P&gt;&amp;lt;snipped out for brevity&amp;gt;&lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;44DCDF7E: 63636363 63636363 63636363 63636363 cccccccccccccccc&lt;/P&gt;
&lt;P&gt;44DCDF8E: 63636363 63636363 63636363 63636363 cccccccccccccccc&lt;/P&gt;
&lt;P&gt;44DCDF9E: 63636363 63636363 63636363 63636363 cccccccccccccccc&lt;/P&gt;
&lt;P&gt;DBCC execution completed. If DBCC printed error messages, contact your system administrator.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P mce_keep="true"&gt;Yep - that's our updated column.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Now, this is a contrived example to force columns off-row, but you can imagine a case where a column is unexpectedly pushed off-row in some rows of a table and suddenly a query slows down. You look at the fragmentation and the query plan and everything looks good but don't realize that you're taking random IOs to return the columns you've asked for.&lt;/P&gt;
&lt;P mce_keep="true"&gt;That's all - now it's time for me to go and pack my diving gear and head off towards the sun (20 1/2 hours of flights over 31 1/2 hours to get to Bali tomorrow - ugh!). Have fun playing with DBCC over the holidays and I'll be back in January.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1278602" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC/default.aspx">DBCC</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx">Index Fragmentation Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>When can allocation order scans be used?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/11/09/when-can-allocation-order-scans-be-used.aspx</link><pubDate>Thu, 09 Nov 2006 05:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1042255</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/1042255.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=1042255</wfw:commentRss><description>&lt;P&gt;I know this is jumping the gun a little as I haven't made it this far in my series on &lt;A class="" href="https://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx"&gt;fragmentation&lt;/A&gt;, but this came up in a chalk-talk I did yesterday at TechEd Developers in Barcelona and is worth blogging about.&lt;/P&gt;
&lt;P&gt;You'd expect a &lt;EM&gt;select * from mytable&lt;/EM&gt; query on a table with a clustered index to use an allocation order scan to return the data, as that's the fastest way to read all the pages at the leaf-level of an index. In fact, the query plan will show an unordered clustered index scan. Well, guess again. What I didn't remember, and thanks to SQL Server MVP &lt;STRONG&gt;Maciej Pilecki&lt;/STRONG&gt;&amp;nbsp;for pointing this out during my talk (even though I didn't believe him at first), is that an allocation order scan can't be used when there's any possibility of the data changing beneath the scan.&lt;/P&gt;
&lt;P&gt;Consider an example where an allocation order scan is progressing and a page that the scan has already read then splits - adding a newly allocated page at the end of the allocation-order list of pages. The scan will eventually come to the new page and then re-read some of the rows it has already read - producing duplicates in the scan output - clearly undesirable.&lt;/P&gt;
&lt;P&gt;The only time such a scan will be used is when there's no possibility of the data changing (e.g. when the &lt;EM&gt;TABLOCK&lt;/EM&gt; hint is specified, or when the table is in a read-only database) or when&amp;nbsp;its explicitly stated that we don't care (e.g.&amp;nbsp;when the &lt;EM&gt;NOLOCK&lt;/EM&gt; hint is specifed or under &lt;EM&gt;READ UNCOMMITTED&lt;/EM&gt; isolation level). As a further twist, there's a trade-off with setup cost of the allocation order scan against the number of pages that will b read - an allocation order scan will only be used if there's more than 64 pages to be read.&lt;/P&gt;
&lt;P&gt;Below&amp;nbsp;I've included a simple script that demonstrates the behavior. For me, the funny thing is that I should have remembered this behavior as it's exactly the same reason why &lt;EM&gt;DBCC SHOWCONTIG&lt;/EM&gt; takes a shared table lock when in the default mode - it's using an allocation order scan and needs to ensure that the data doesn't change and produce duplicates. Oh well - you (re)learn something every day!&lt;/P&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;-- Drop and recreate the test database&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;USE&lt;/FONT&gt;&lt;FONT size=2&gt; master&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DROP&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;FONT size=2&gt; allocationordertest&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;FONT size=2&gt; allocationordertest&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;USE&lt;/FONT&gt;&lt;FONT size=2&gt; allocationordertest&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;-- Create a simple table that we can fill up quickly, plus a clustered index&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TABLE&lt;/FONT&gt;&lt;FONT size=2&gt; t1 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;c1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; c2 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VARCHAR&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;8000&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;));&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CLUSTERED&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INDEX&lt;/FONT&gt;&lt;FONT size=2&gt; t1c1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; t1 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;c1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;-- Add some rows, making sure to produce an out-of-order dataset when scanned in allocation order.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DECLARE&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; 10&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;WHILE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;@a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT size=2&gt; 100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;BEGIN&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; t1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;@a&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replicate&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 5000&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;))&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;END&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;WHILE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;@a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT size=2&gt; 10&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;BEGIN&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; t1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;@a&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;replicate&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'a'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 5000&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;))&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; @a &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;END&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;-- Now try to do an allocation order scan - doesn't work...&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;*&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; t1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;
&lt;P&gt;-- Until we add the right conditions.&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;*&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; t1 &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;WITH&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;TABLOCK&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1042255" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/TechEd+2006/default.aspx">TechEd 2006</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx">Index Fragmentation Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Fragmentation (part 4): what are heaps?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/09/19/761437.aspx</link><pubDate>Tue, 19 Sep 2006 04:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:761437</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/761437.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=761437</wfw:commentRss><description>&lt;DIV&gt;Ok - really catching up with the various blog post series I started back in June/July - time to bang out the next few posts in the series on index fragmentation. Remember I'm starting from first principles and covering&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/23/644607.aspx"&gt;What are records?&lt;/A&gt;
&lt;LI&gt;&lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/26/647005.aspx"&gt;What are pages?&lt;/A&gt; 
&lt;LI&gt;&lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/28/649884.aspx"&gt;What are extents?&lt;/A&gt; 
&lt;LI&gt;What is a heap? 
&lt;LI&gt;What is a clustered index? 
&lt;LI&gt;What is a non-clustered index?&lt;/LI&gt;&lt;/UL&gt;
&lt;DIV&gt;before getting into the details of fragmentation.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;So what is a heap?&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;A heap is the simplest storage arrangement and is an unordered table (or you could think of it as a collection of unordered pages). 
&lt;LI&gt;This means that rows will be inserted into the heap anywhere where there is space (don't let this statement confuse you - for a table that has nothing but inserts, records will always be appended to the last allocated page). 
&lt;LI&gt;A heap consists entirely of data pages - as there is no b-tree, there are no index pages. 
&lt;LI&gt;As a heap is unordered, the data pages are not linked in any way. (Ah - there are some exceptions. In SQL Server 2000 and 2005 (and maybe in 7.0 - I don't remember), the sysfiles1 table is a linked-heap. This table contains the locations of the files comprising the database and so for safety's sake we want the pages to be linked, but not with the complexity of having a b-tree because we read the pages directly at startup time. In SQL Server 2005, some other system tables are also linked-heaps). 
&lt;LI&gt;If you want to do a singleton lookup from a heap, the whole heap has to be scanned to find the row(s) matching the search predicate. 
&lt;LI&gt;Doing a select (*) of the contents of a heap will not guarantee to return the rows in the order they were inserted (as it did in 6.5 when all heaps were linked as sysfiles1 is and the space from singleton deletes was not reclaimed). This is because the pages are accessed in allocation order. 
&lt;LI&gt;Non-clustered index records&amp;nbsp;contain the physical RID (record ID or record locator) of the corresponding heap record.&lt;/LI&gt;&lt;/UL&gt;
&lt;DIV&gt;Heaps have one interesting feature - &lt;EM&gt;forwarded records&lt;/EM&gt;. If a record needs to be updated, the updated record size is greater than the current record size, and there is no space on the page to fit the new record in then we have two choices:&lt;/DIV&gt;
&lt;OL&gt;
&lt;LI&gt;move the record to a new page and change all the non-clustered index records that point to it to point to the new location of the record 
&lt;LI&gt;move the record to a new page and leave a &lt;EM&gt;forwarding record&lt;/EM&gt; in the original location to point to the new location&lt;/LI&gt;&lt;/OL&gt;
&lt;DIV&gt;Guess which approach we took? Right, #2. Approach #1 has enormous performance implications because of the extra IOs and logging involved. The forwarding record has the physical location of the new record and the forwarded record has a back-pointer to the forwarding record (so that if its deleted, the forwarding record can be deleted too).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;This is one drawback of using heaps - all the extra space that's "wasted" with the forwarding/forwarded records. Another drawback is that when scanning through the heap, forwarding records have to followed immediately (as opposed to ignoring them and just reading the forwarded records when they're encountered). This is to vastly reduce the possiblity of read anomalies (such as non-repeatable reads or missed rows if a row moves before the scan point during a scan).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;And that's it. Next up is clustered indexes...&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=761437" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx">Index Fragmentation Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Don't try this at home kids... (data recovery using DBCC PAGE)</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/08/09/693625.aspx</link><pubDate>Wed, 09 Aug 2006 22:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:693625</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/693625.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=693625</wfw:commentRss><description>&lt;P&gt;Time to cough up a real-life data recovery scenario to temporarily stop those people who badger me relentlessly for scenarios...&lt;/P&gt;
&lt;P&gt;We have a situation currently with a customer who managed to delete all their data during a SAN reconfig and then found out that their tape backups hadn't been working properly (the same sad story I've heard a thousand times). They did have a primary filegroup backup plus a backup of a secondary filegroup from a different point. This is on SQL Server 2005.&lt;/P&gt;
&lt;P&gt;The backups are restored, but the storage engine metadata for the table with the critical data in is messed up - &lt;FONT face="Courier New"&gt;sys.allocunits&lt;/FONT&gt; somehow has the wrong allocation unit IDs, first page, and root pages. So, what the hell can you do?&lt;/P&gt;
&lt;P&gt;Easy (and fun if you're twisted like me).&lt;/P&gt;
&lt;P&gt;We need to find the following info for the data allocation unit:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the page ID of the head of the IAM chain for the allocation unit 
&lt;LI&gt;the root page of the clustered index 
&lt;LI&gt;the first page of the clustered index&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;And there's a twist, the table has a column of type &lt;EM&gt;image&lt;/EM&gt; so we also need to find the allocation unit ID and page ID of the head of the IAM chain for the LOB allocation unit.&lt;/P&gt;
&lt;P&gt;The easiest way to do this is to scan through the data files, doing &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt;s of every page and storing the results in a table for later analysis. How? Ah, there's something I haven't told you about &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; - it has a &lt;FONT face="Courier New"&gt;WITH TABLERESULTS&lt;/FONT&gt; option.&lt;/P&gt;
&lt;P&gt;So, setup a simple script to&amp;nbsp;&lt;FONT face="Courier New"&gt;INSERT/EXEC&lt;/FONT&gt; a&amp;nbsp;&lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; of every page with option 0 (for speed, otherwise it has to take the time to go through and crack and format every record on every page) and save the results to a table.&lt;/P&gt;
&lt;P&gt;To find the root page of the clustered index, query the table for the page with &lt;FONT face="Courier New"&gt;m_type = 2&lt;/FONT&gt; (an index page) and the highest &lt;FONT face="Courier New"&gt;m_level&lt;/FONT&gt;. The level number increases from the leaf of the b-tree to the root page, so the page with the highest level is the root.&lt;/P&gt;
&lt;P&gt;To find the first page, crack open the first record on the root page, and extract the page ID of the child page that the index record points to. This is the left-hand edge of the next level lower in the b-tree. Continue doing this until you find the page with &lt;FONT face="Courier New"&gt;m_level = 0&lt;/FONT&gt;. (Note that on SQL Server 2000, you'll need to look for &lt;FONT face="Courier New"&gt;m_level = 0&lt;/FONT&gt; AND &lt;FONT face="Courier New"&gt;m_type = 1&lt;/FONT&gt; - this is because pages at the leaf level and the level above in a SQL Server 2000 clustered index all have &lt;FONT face="Courier New"&gt;m_level = 0&lt;/FONT&gt;).&lt;/P&gt;
&lt;P&gt;To find the head of the IAM chain is a little trickier. You need to find any page with &lt;FONT face="Courier New"&gt;m_type = 10&lt;/FONT&gt; and following the &lt;FONT face="Courier New"&gt;m_prevPage&lt;/FONT&gt; links until its NULL. Then do an option 3 dump of the page and ensure that the &lt;FONT face="Courier New"&gt;sequenceNumber&lt;/FONT&gt; in the IAM page header is 0 (remember that an IAM chain is ordered by the sequence numbers in the IAM pages).&lt;/P&gt;
&lt;P&gt;Cool - we've done the clustered index.&lt;/P&gt;
&lt;P&gt;Now for the LOB allocation unit. Crack any row at the leaf level of the clustered index. You'll see that one of the columns is a text pointer, containing a page ID and slot number of the text fragment in the LOB allocation unit. Do a &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; of that page and now you know the allocation unit ID of the LOB allocation unit and can use the methodology above to find the head of its IAM chain.&lt;/P&gt;
&lt;P&gt;Now all you have to do is alter the hidden and unbindable &lt;FONT face="Courier New"&gt;sys.allocunits&lt;/FONT&gt; table to contain the correct data... Who's buying the beer?&amp;nbsp;:-)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=693625" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC/default.aspx">DBCC</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Poking about with DBCC PAGE (Part 1 of ?)</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/08/09/692806.aspx</link><pubDate>Wed, 09 Aug 2006 04:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:692806</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/692806.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=692806</wfw:commentRss><description>&lt;P&gt;&lt;EM&gt;(It's been a while since I last posted - summer fun's been in the way obviously and I've been busy picking up some new and exciting (for me) SQL skills, partially to help with four upcoming TechEds I'll be doing in China and Hong Kong. The posting frequency should increase towards the end of the week but in the meantime, this one's a special request.)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I've been getting lots of requests for more info about how to use &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; since my &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx"&gt;Paul-tells-all post&lt;/A&gt; a while back and I had&amp;nbsp;been planning to wait until I'd posted more about the internals of &lt;FONT face="Courier New"&gt;DBCC CHECKDB&lt;/FONT&gt; and moved on to various examples of corruptions before starting to use &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; again in the blog. However, a friend made me an offer I couldn't refuse and so I've caved in and I'm starting the series now :-)&lt;/P&gt;
&lt;P&gt;I'm going to start with cracking a record from scratch. Yes, I know that option 3 of &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; will do it for you - but how does it do it? Sometimes you may not have table metadata and so &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; won't be able to use option 3 - in that case you'll need to crack it yourself. Also, there are plenty of curious people who like to be immersed in the bits and bytes and besides, cracking records manually is fun (if you're twisted as well as curious like I am&amp;nbsp;:-)&lt;/P&gt;
&lt;P&gt;I've created an example database, &lt;EM&gt;dbccpagetest&lt;/EM&gt;,&amp;nbsp;on SQL Server 2005 which I've zipped up and attached to this post. This way you can all use the same data and pages as me without having to go through the tedium of working out where pages are using the PFS pages (as I explained in the &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx"&gt;initial &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; post&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;You won't be able to attach it to SQL Server 2000 but you can always download &lt;A href="http://msdn.microsoft.com/vstudio/express/sql/download/"&gt;SQL Server 2005 Express Edition&lt;/A&gt; and play with it on that. Unzip the files and attached them using the &lt;FONT face="Courier New"&gt;CREATE DATABASE ... FOR ATTACH&lt;/FONT&gt; syntax:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;FONT size=2&gt; dbccpagetest&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FILENAME&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\dbccpagetest.mdf'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;FOR&lt;/FONT&gt;&lt;FONT size=2&gt; ATTACH;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;Note that if the filenames haven't changed since they were created, you only need to specify the primary file in the &lt;FONT face="Courier New"&gt;CREATE DATABASE&lt;/FONT&gt; statement. Very cool.&lt;/P&gt;
&lt;P&gt;The database has a single table with&amp;nbsp;a couple of rows, created using the following T-SQL:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TABLE&lt;/FONT&gt;&lt;FONT size=2&gt; example &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VARCHAR&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;activity &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VARCHAR&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;100&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;),&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;duration &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INT&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; example &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'Banff'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'sightseeing'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 5&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; example &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;VALUES&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'Chicago'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'sailing'&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 4&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;The data page is page (1:152). Dumping that page using option 3 will give output including:&lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slot 0 Offset 0x60 Length 33&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Memory Dump @0x44DFC060&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;00000000: 30000800 05000000 0300f802 00160021 †0..............! &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;00000010: 0042616e 66667369 67687473 6565696e †.Banffsightseein &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;00000020: 67†††††††††††††††††††††††††††††††††††g &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slot 0 Column 0 Offset 0x11 Length 5&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;destination = Banff &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slot 0 Column 1 Offset 0x16 Length 11&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;activity = sightseeing &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Slot 0 Column 2 Offset 0x4 Length 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;duration = 5 &lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;Previously&amp;nbsp;(&lt;EM&gt;that word always makes me think of Twin Peaks - 'Previously in Twin Peaks...', but I digress...)&lt;/EM&gt; I'd posted about the structure of a record - here it is again:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;record header 
&lt;UL&gt;
&lt;LI&gt;4 bytes long 
&lt;LI&gt;two bytes of record metadata (record type) 
&lt;LI&gt;two bytes pointing forward in the record to the NULL bitmap&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;fixed length portion of the record, containing the columns storing data types that have fixed lengths (e.g. &lt;EM&gt;bigint&lt;/EM&gt;, &lt;EM&gt;char(10)&lt;/EM&gt;, &lt;EM&gt;datetime&lt;/EM&gt;) 
&lt;LI&gt;NULL bitmap 
&lt;UL&gt;
&lt;LI&gt;two bytes for count of columns in the record 
&lt;LI&gt;variable number of bytes to store one bit per column in the record, regardless of whether the column is nullable or not 
&lt;LI&gt;this allows an optimization when reading columns that are NULL (see &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/29/650349.aspx"&gt;here&lt;/A&gt; for more info)&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;variable-length column offset array 
&lt;UL&gt;
&lt;LI&gt;two bytes for the count of variable-length columns 
&lt;LI&gt;two bytes per variable length column, giving the offset to the start of the column valu&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;versioning tag 
&lt;UL&gt;
&lt;LI&gt;this is in SQL Server 2005 only 
&lt;LI&gt;this is a 14-byte structure that contains a timestamp plus a pointer into the version store in tempdb&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;So, let's go through the record from the dump fragment above and figure out what everything means. I'm not going to give all the excruciating detail on every possible value of every byte, but will give you enough to be able to crack records yourself (if you're twisted like me...)&lt;/P&gt;
&lt;P&gt;Byte 0 is the TagA byte of the record metadata. Its &lt;FONT face="Courier New"&gt;0x30&lt;/FONT&gt;, which corresponds to &lt;FONT face="Courier New"&gt;0x10&lt;/FONT&gt; (bit 4) and &lt;FONT face="Courier New"&gt;0x20&lt;/FONT&gt; (bit 5). Bit 4 means the record has a NULL bitmap and bit 5 means the record has variable length columns. If &lt;FONT face="Courier New"&gt;0x40&lt;/FONT&gt; (bit 6) was also set, that would indicate that the record has a versioning tag. If &lt;FONT face="Courier New"&gt;0x80&lt;/FONT&gt; (bit 7) was also set, that would indicate that byte 1 has a value in it.&lt;/P&gt;
&lt;P&gt;Bits 1-3 of byte 0 give the record type. The possible values are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;0 = primary record 
&lt;UL&gt;
&lt;LI&gt;a data record in a heap that hasn't been forwarded or a data record at the leaf level of a clustered index.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;1 = forwarded record 
&lt;UL&gt;
&lt;LI&gt;a data record in a heap that's been updated and was too large to fit in-place on its original page and so has been moved to another page. A forwarding record is left in its place and points to the new location of the record. This is done to avoid having to update any non-clustered index records that point back directly to the original physical location of the record.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;2 = forwarding record 
&lt;UL&gt;
&lt;LI&gt;sometimes also called a forwarding stub.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;3 = index record 
&lt;UL&gt;
&lt;LI&gt;an index record in the tree of a clustered index, or in any level of a non-clustered index.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;4 = blob fragment 
&lt;LI&gt;5 = ghost index record 
&lt;LI&gt;6 = ghost data record 
&lt;UL&gt;
&lt;LI&gt;these two are self-explanatory&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;7 = ghost version record 
&lt;UL&gt;
&lt;LI&gt;a special 15-byte record containing a single byte record header plus a 14-byte versioning tag that is used in some circumstances (like ghosting a versioned blob record)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In our example, none of these bits are set which means the record is a primary record. If the record was an index record, byte 0 would have the value &lt;FONT face="Courier New"&gt;0x36&lt;/FONT&gt;. Remember that the record type starts on bit 1, not bit 0, and so the record type value from the enumeration above needs to be shifted left a bit (multiplied by two) to get its value in the byte.&lt;/P&gt;
&lt;P&gt;Byte 1 is the TagB byte of the record metadata. It can either be &lt;FONT face="Courier New"&gt;0x00&lt;/FONT&gt; or &lt;FONT face="Courier New"&gt;0x01&lt;/FONT&gt;. If it is &lt;FONT face="Courier New"&gt;0x01&lt;/FONT&gt;, that means the record type is ghost forwarded record. In this case its &lt;FONT face="Courier New"&gt;0x00&lt;/FONT&gt;, which is what we expect given the TagA byte value.&lt;/P&gt;
&lt;P&gt;Bytes 2 and 3 are the offset of the NULL bitmap in the record. This is &lt;FONT face="Courier New"&gt;0x0008&lt;/FONT&gt; (&lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; presents multi-byte values in hex dumps as least-significant byte first). This means that there's a 4-byte fixed length portion of the record starting at byte 4. We expect this because we know the table schema.&lt;/P&gt;
&lt;P&gt;Bytes 4 to 7 are the fixed length portion. Again, because we know the table schema, we know to interpret these bytes as a 4-byte integer. Without that knowledge, you'd have to guess. The value therefore is &lt;FONT face="Courier New"&gt;0x00000005&lt;/FONT&gt;, which is what we'd expect to see as the value of the &lt;EM&gt;duration&lt;/EM&gt; column.&lt;/P&gt;
&lt;P&gt;Bytes 8 and 9 are the count of columns in the record. This is &lt;FONT face="Courier New"&gt;0x0003&lt;/FONT&gt; which is correct. Given that there are only 3 columns, the NULL bitmap of one bit per column will fit in a single byte.&lt;/P&gt;
&lt;P&gt;Byte 10 is the NULL bitmap. Hey - it's value is &lt;FONT face="Courier New"&gt;0xF8&lt;/FONT&gt; - what's up with that? Convert it to binary and what do you get? &lt;FONT face="Courier New"&gt;11111000&lt;/FONT&gt; This makes perfect sense - bits 0-2 represent columns 1-3 and they're all 0, meaning the columns aren't NULL. Bits 3-7 represent non-existent columns and they're set to 1 for clarity. So the &lt;FONT face="Courier New"&gt;0xF8&lt;/FONT&gt; value makes sense - phew.&lt;/P&gt;
&lt;P&gt;Bytes 11 and 12 are the count of variable length columns in the record. That value is &lt;FONT face="Courier New"&gt;0x0002&lt;/FONT&gt;, which we again know to be correct. This means there will be two two-byte entries in the variable length column offset array. These will be bytes 13-14 and 15-16, having values of &lt;FONT face="Courier New"&gt;0x0016&lt;/FONT&gt; and &lt;FONT face="Courier New"&gt;0x0021&lt;/FONT&gt; respectively.&lt;/P&gt;
&lt;P&gt;Now, the explanation that the variable length column offset array stores the offsets to the start of the column value is over-simplified. The entries actually point to the start of the following column value - this is done so that we know how long each column is (they are variable length after all). Notice that the offset of the first variable length column value isn't stored - it doesn't need to be because by definition it must begin right after the last offset in the variable length column offset array.&lt;/P&gt;
&lt;P&gt;So, the final offset is bytes 15 and 16, which means the offset of the start of the first variable length column must be byte 17 (or 0x11 in hex), which agrees with the &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; dump. The offset of the second variable length column is &lt;FONT face="Courier New"&gt;0x0016&lt;/FONT&gt;, so the first value is from byte 17 to byte 21 inclusive. This value is &lt;FONT face="Courier New"&gt;0x42616E6666&lt;/FONT&gt;. We know from the table metadata that this is&amp;nbsp;the first&amp;nbsp;varchar column, &lt;EM&gt;destination&lt;/EM&gt;. Checking our handy &lt;A href="http://en.wikipedia.org/wiki/ASCII"&gt;ASCII conversion table&lt;/A&gt;&amp;nbsp;we find that this translates to '&lt;FONT face="Courier New"&gt;Banff&lt;/FONT&gt;'.&lt;/P&gt;
&lt;P&gt;Using similar logic, the second value is from byte 22 to byte 32 inclusive and has the value '&lt;FONT face="Courier New"&gt;sightseeing&lt;/FONT&gt;'. Both of these match the data we're expecting.&lt;/P&gt;
&lt;P&gt;And that's it. We've just cracked a record from scratch. Now you try it with the second row in the table. In future posts I'll start making things more complicated (maybe trace into the version store or add in some off-row LOB values).&lt;/P&gt;
&lt;P&gt;Hopefully this will satisfy all of those who've been waiting for more info on using DBCC PAGE and now I'm looking forward to getting my side of the bargain from my friend...&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=692806" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/sqlserverstorageengine/attachment/692806.ashx" length="1075145" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC/default.aspx">DBCC</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Under the covers: GAM, SGAM, and PFS pages</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/07/08/under-the-covers-gam-sgam-and-pfs-pages.aspx</link><pubDate>Sun, 09 Jul 2006 00:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:660071</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/660071.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=660071</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;EM&gt;(Been a week or so since the last post but I haven't burnt out with blogging yet - I was on vacation &lt;/EM&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;EM&gt;over the July 4th weekend and totally offline in and around a small town called Pullman in &lt;/EM&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;EM&gt;south-eastern Washington.)&lt;/EM&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;In a &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/28/649884.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/28/649884.aspx"&gt;previous post&lt;/A&gt; I described extents, and in &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/24/645803.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/24/645803.aspx"&gt;another previous post&lt;/A&gt; a while back I described how &lt;/o:p&gt;&lt;o:p&gt;the extents and pages that are allocated to an IAM chain are tracked in IAM pages. What I didn't &lt;/o:p&gt;&lt;o:p&gt;describe is how the allocation status of individual pages is tracked, or how the global allocation &lt;/o:p&gt;&lt;o:p&gt;bitmaps work - that's the subject of this post.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;This is the last post that lays the groundwork to &lt;/o:p&gt;&lt;o:p&gt;be able to discuss allocation checks in CHECKDB - the subject of the following post - and various &lt;/o:p&gt;&lt;o:p&gt;corruption scenarios (yes Kimberly, I'm going to get to scenarios...)&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;Bear in mind that everything below is exactly the same in SQL Server 2000 and 2005.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;STRONG&gt;GAM pages&lt;/STRONG&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;GAM stands for &lt;STRONG&gt;G&lt;/STRONG&gt;lobal &lt;STRONG&gt;A&lt;/STRONG&gt;llocation &lt;STRONG&gt;M&lt;/STRONG&gt;ap. If you remember from before, database &lt;/o:p&gt;&lt;o:p&gt;data files are split up into &lt;EM&gt;GAM intervals&lt;/EM&gt; (don't get confused - they're not split physically, just conceptually). A GAM interval is equivalent to the amount of &lt;/o:p&gt;&lt;o:p&gt;space that the bitmaps in GAM, SGAM, and IAM pages track - 64000 extents or almost 4GB. These&amp;nbsp;&lt;/o:p&gt;&lt;o:p&gt;bitmaps are the same size in each of these three page types and have one bit per extent, but they &lt;/o:p&gt;&lt;o:p&gt;mean different things in each of the different allocation pages.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;One thing to note, at the start of every GAM interval is a &lt;EM&gt;GAM extent&lt;/EM&gt; which contains the &lt;/o:p&gt;&lt;o:p&gt;global allocation pages that track that GAM interval. This GAM extent cannot be used for any &lt;/o:p&gt;&lt;o:p&gt;regular page allocations.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;The bits in the GAM bitmap have the following semantics:&lt;/o:p&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;STRONG&gt;bit = 1&lt;/STRONG&gt;: the extent is available for allocation (you could think of it as currently &lt;/o:p&gt;&lt;o:p&gt;allocated to the GAM page)&lt;/o:p&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;STRONG&gt;bit = 0&lt;/STRONG&gt;: the extent is already allocated for use&lt;/o:p&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;These semantics are the same for mixed and dedicated/uniform extents.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;STRONG&gt;SGAM pages&lt;/STRONG&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;I remember last year having an email discussion about what the 'S' stands for in SGAM. Various names have been used over the &lt;/o:p&gt;&lt;o:p&gt;years inside and outside Microsoft but the official name that Books Online uses is &lt;STRONG&gt;S&lt;/STRONG&gt;hared &lt;/o:p&gt;&lt;o:p&gt;&lt;STRONG&gt;G&lt;/STRONG&gt;lobal &lt;STRONG&gt;A&lt;/STRONG&gt;llocation &lt;STRONG&gt;M&lt;/STRONG&gt;ap. To be honest, we always just call them &lt;EM&gt;'es-gams'&lt;/EM&gt; and &lt;/o:p&gt;&lt;o:p&gt;never spell it out.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;As I said above, the SGAM bitmap is exactly the same as the GAM bitmap in structure and the interval it covers, but the semantics of the &lt;/o:p&gt;&lt;o:p&gt;bits are different:&lt;/o:p&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;STRONG&gt;bit = 1&lt;/STRONG&gt;: the extent is a mixed extent and has at least one unallocated page available for &lt;/o:p&gt;&lt;o:p&gt;use&lt;/o:p&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;STRONG&gt;bit = 0&lt;/STRONG&gt;: the extent is either dedicated or is a mixed extent with no unallocated pages &lt;/o:p&gt;&lt;o:p&gt;(essentially the same situation given that the SGAM is used to find mixed extents with unallocated &lt;/o:p&gt;&lt;o:p&gt;pages)&lt;/o:p&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;STRONG&gt;GAM, SGAM and IAM pages&lt;/STRONG&gt;&lt;BR&gt;So, taking the GAM, SGAM and IAM pages together (remember that in the IAM bitmap, the bit is set if the extent is allocated to the IAM chain/allocation unit), the various combinations of bits are:&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;
&lt;TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid"&gt;
&lt;TBODY&gt;
&lt;TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;GAM&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;SGAM&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Any IAM&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;Comments&lt;o:p&gt;&lt;/o:p&gt;&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 1"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Mixed extent with all pages allocated&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 2"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Dedicated extent (must be allocated to only a single IAM page)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 3"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Mixed extent with &amp;gt;= 1 unallocated page&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 4"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Invalid state&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 5"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Unallocated extent&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 6"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Invalid state&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 7"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Invalid state&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="mso-yfti-irow: 8; mso-yfti-lastrow: yes"&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 59.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=100&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #c1ccd9; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: #c1ccd9; WIDTH: 209.6pt; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=349&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Invalid state&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;&lt;/o:p&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;You can see that only 4 of the 8 possible bit combinations for any particular extent are valid. Anything else constitutes a corruption of some sort and can lead to all kinds of horrible situations - more on some of these in later posts.&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;(But I can't resist - &lt;EM&gt;'how do these corruptions happen?'&lt;/EM&gt; I'm sure someone is asking. Every database page is 8KB, which is really 16 512-byte disk segments. Imagine a flaky IO system writing some random data into one of the disk segments of a GAM page and causing multiple IAM pages to think they have the same extents allocated...)&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;STRONG&gt;PFS pages&lt;/STRONG&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;PFS stands for &lt;STRONG&gt;P&lt;/STRONG&gt;age &lt;STRONG&gt;F&lt;/STRONG&gt;ree &lt;STRONG&gt;S&lt;/STRONG&gt;pace, but the PFS page tracks much more than that. As well as GAM intervals, every database file is also split (conceptually) into &lt;EM&gt;PFS intervals&lt;/EM&gt;. A PFS interval is 8088 pages, or about 64MB. A PFS page doesn't have a bitmap - it has a &lt;EM&gt;byte&lt;/EM&gt;-map, with one byte for each page in the PFS interval (not including itself).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The bits in each byte are encoded to mean the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;bits 0-2: how much free space is on the page&lt;/DIV&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0x00 is empty&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0x01 is 1 to 50% full&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0x02 is 51 to 80% full&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0x03 is 81 to 95% full&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;0x04 is 96 to 100% full&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;bit 3 (0x08): is there one or more ghost records on the page?&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;bit 4 (0x10): is the page an IAM page?&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;bit 5 (0x20): is the page a mixed-page?&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;bit 6 (0x40): is the page allocated?&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;For instance, an IAM page will have&amp;nbsp;a PFS byte value of 0x70 (allocated + IAM page + mixed page). You can examine PFS pages using &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx"&gt;&lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;(the instructions in that post use a PFS page as an example).&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Free space is only tracked for pages storing LOB values (i.e. &lt;FONT face="Courier New"&gt;text&lt;/FONT&gt;/&lt;FONT face="Courier New"&gt;image&lt;/FONT&gt; in SQL Server 2000, plus &lt;FONT face="Courier New"&gt;varchar(max)&lt;/FONT&gt;/&lt;FONT face="Courier New"&gt;varbinary(max)&lt;/FONT&gt;/&lt;FONT face="Courier New"&gt;XML&lt;/FONT&gt; and row-overflow data in SQL Server 2005) and heap data pages. This is because these are the only pages that store unordered data and so insertions can occur anywhere there's space. For indexes, there's an explicit ordering so there's no choice in the insertion point.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The point at which a PFS byte is reset is not intuitive. Just yesterday I was helping a couple of MVPs with an issue and one of the questions was (paraphrasing) &lt;EM&gt;"This page has a PFS byte value of 0x04 - how can it be full when its not allocated?"&lt;/EM&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The answer is that PFS bytes are not fully reset until the page is reallocated. On deallocation, the only bit in the PFS byte that's changed is the allocation status bit - this makes it very easy to rollback a deallocation.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Here's an example. Using a database with a simple table with one row. A &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; of the IAM page includes:&lt;/P&gt;&lt;FONT size=1&gt;&lt;FONT size=1&gt;
&lt;P&gt;PFS (1:1) = 0x70 IAM_PG MIXED_EXT ALLOCATED 0_PCT_FULL&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;If I run the following:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;BEGIN&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TRANSACTION&lt;/P&gt;
&lt;P&gt;DROP&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TABLE&lt;/FONT&gt;&lt;FONT size=2&gt; T1&lt;/P&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;And then do the &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; again, the output now includes:&lt;/o:p&gt;&lt;/P&gt;&lt;o:p&gt;&lt;FONT size=1&gt;&lt;FONT size=1&gt;
&lt;P&gt;PFS (1:1) = 0x30 IAM_PG MIXED_EXT 0_PCT_FULL&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/o:p&gt;&lt;o:p&gt;And if I rollback then transaction, the &lt;FONT face="Courier New"&gt;DBCC PAGE&lt;/FONT&gt; output reverts to:&lt;/o:p&gt;&lt;/P&gt;&lt;o:p&gt;&lt;FONT size=1&gt;
&lt;P&gt;PFS (1:1) = 0x70 IAM_PG MIXED_EXT ALLOCATED 0_PCT_FULL&lt;/P&gt;&lt;/FONT&gt;&lt;/o:p&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;Now that these three pages have been discussed, we're free to explore allocation checks and corruptions and I'm free to go and have breakfast!&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;(This is just adding the blog to Technorati -&amp;nbsp;&lt;A href="http://technorati.com/claim/gtmw68tky" rel=me mce_href="http://technorati.com/claim/gtmw68tky"&gt;Technorati Profile&lt;/A&gt;)&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=660071" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Why is the NULL bitmap in a record an optimization?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/29/650349.aspx</link><pubDate>Thu, 29 Jun 2006 04:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:650349</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/650349.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=650349</wfw:commentRss><description>&lt;P&gt;I've had some questions&amp;nbsp;sent in comments&amp;nbsp;and I wanted to reply to some of them using a post so others who aren't subscribed to the comment sections can see the answers.&lt;/P&gt;
&lt;P&gt;
&lt;TABLE cellSpacing=0 cellPadding=0 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR vAlign=top&gt;
&lt;TD class="Comment CommentAvatar"&gt;&amp;nbsp; &lt;/TD&gt;
&lt;TD class="Comment CommentContent" width="100%"&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;H4 class=CommentTitle&gt;&lt;A id=_ctl0____ctl0____ctl0__ctl0_bcr__ctl0___Comments___Comments__ctl4_NameLink title="Wesley Backelant" href="https://blogs.msdn.com/utility/Redirect.aspx?U=http%3a%2f%2fdis4ea.blogspot.com"&gt;&lt;FONT color=#0033cc size=2&gt;Wesley Backelant&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt; said:&lt;/FONT&gt;&lt;/H4&gt;
&lt;DIV class=CommentText&gt;&lt;FONT size=2&gt;I was wondering what exactly you mean by "this allows an optimization when reading columns that are NULL". &amp;nbsp;Could you elaborate on that?&lt;/FONT&gt; &lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;DIV class=CommentText dir=ltr&gt;Firstly, having a null bitmap removes the need for storing special 'NULL' values for fixed-length datatypes. Without the null bitmap, how can you tell whether a column is NULL?&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;That's easy for a variable-length column - just check the length. If it's zero, then the column is NULL.&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;[Edit] Ryan Stonecipher (the dev responsible for DBCC) pointed out that I'd forgotten the case of empty strings - thanks Ryan. In this case, an empty string also has a zero length so for varchar columns you'd need to use the fixed-length solution described below.&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;It's not so easy for fixed-length columns, which, as their name suggests, have a fixed-length so that trick doesn't work. The only solution is to define a special 'NULL' value, which limits the effective range of the datatype being stored.&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;Secondly, it saves CPU cycles. If there was no NULL bitmap, then there are extra instructions executed for fixed- and variable-length columns.&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class=CommentText dir=ltr&gt;For fixed-length:&lt;/DIV&gt;
&lt;OL dir=ltr&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;read in the stored column value (possibly taking a cpu data cache miss)&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;load&amp;nbsp;the pre-defined NULL value for that datatype (possibly taking a cpu data cache miss, but only for the first read in the case of a multiple row select)&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;do a comparison between the two values&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=CommentText&gt;For variable-length:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;calculate the offset of the variable length array&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;read the number of variable length columns (possibly taking a cpu data cache miss)&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;calculate&amp;nbsp;the position in&amp;nbsp;the variable length offset array to read&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;read the column offset from it (possibly taking a cpu data cache miss)&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;read&amp;nbsp;the next one too (possibly taking another cpu data cache miss, if the offset in step 4 was on the boundary of a cache line size)&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;compare them to see if they're the same&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=CommentText&gt;But with a NULL bitmap, all you have to do is:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;read the NULL bitmap offset (possibly taking a cpu data cache miss)&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;calculate the additional offset of the NULL bit you want to read&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=CommentText&gt;read it (possibly taking a cpu data cache miss)&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=CommentText&gt;So, its about even for a lookup of a single fixed-length column, but for variable-length columns, and for multiple row selects, there's a clear advantage to having the NULL bitmap.&lt;/P&gt;
&lt;P class=CommentText&gt;Hope this makes my comment a bit clearer.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=650349" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Fragmentation (part 3): What are extents?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/28/649884.aspx</link><pubDate>Wed, 28 Jun 2006 20:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:649884</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/649884.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=649884</wfw:commentRss><description>&lt;P&gt;&lt;EM&gt;(Ok - another flight - another blog post. This time its Boston back to Seattle. The three of us who'd come over for the training course upgraded to 1st Class on Alaska for the flight back (great value at $100 for a 6-hour flight) and so there's oodles of room for laptops, newspapers, and long legs)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;In the previous posts I explained about database pages -&amp;nbsp;their structure and some page types. Now I'd like to explain how we group pages into units called &lt;EM&gt;extents&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;An extent is a group of eight physically consecutive pages in a database data file. Extents are always aligned on 64KB boundaries (i.e. 8-page boundaries), starting at the beginning of each data file. Extents, and all their properties, are exactly the same in SQL Server 2000 and 2005.&lt;/P&gt;
&lt;P&gt;There are two types of extents: &lt;EM&gt;mixed&lt;/EM&gt; extents and &lt;EM&gt;dedicated&lt;/EM&gt; (or &lt;EM&gt;uniform&lt;/EM&gt;) extents.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mixed extents&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The first 8 pages that are allocated to any &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/646865.aspx"&gt;IAM chain&lt;/A&gt; (either for an index in SQL Server 2000 or allocation unit in SQL Server 2005) are single-page allocations, which we called &lt;EM&gt;mixed pages&lt;/EM&gt;. This means that only a single page is allocated to the IAM chain at a time, rather than a whole extent. The rationale behind this is to allow very small tables to take up the minimum amount of space.&lt;/P&gt;
&lt;P&gt;These mixed pages are allocated from mixed extents that are not allocated to any particular IAM chain. The extent is tracked as being allocated globally, so no IAM chain can allocate it.&lt;/P&gt;
&lt;P&gt;As the mixed extent is not allocated to any particular IAM chain, this means that it may hold pages allocated to 8 separate IAM chains. IAM pages themselves are always mixed pages, regardless of how many pages have been allocated to an IAM chain. This means a mixed extent may hold a variety of page types too,including IAM, data, index, or text pages.&lt;/P&gt;
&lt;P&gt;Two interesting facts:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;once an IAM chain has passed the 8-page threshold and switched to allocating dedicated extents, it will &lt;EM&gt;never&lt;/EM&gt; go back to allocating mixed pages again.&lt;/LI&gt;
&lt;LI&gt;for the purposes of fragmentation, we completely ignore mixed pages and extents as there are so few of them in each IAM chain and it complicates the various algorithms involved.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Dedicated/Uniform extents&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Once the magic 8-page threshold is passed, all further allocations are from dedicated extents. This means that an extent at a time is allocated to an IAM chain (and marked as such in one of the IAM pages in the IAM chain). This is also tracked globally.&lt;/P&gt;
&lt;P&gt;All pages from a dedicated extent &lt;EM&gt;must&lt;/EM&gt; be allocated to the same IAM chain, and they will all be the same type except in the case of clustered indexes, where there could be a mixture of data pages (from the leaf level) and index pages (from the upper b-tree levels).&lt;/P&gt;
&lt;P&gt;Two more interesting facts:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;just because an extent is allocated to an IAM chain, that doesn't mean that all the pages are. The pages are allocated as needed, so initially only one page will be allocated. There are some exceptions to this rule, including during an offline index build operation, but I'm not going to go into the algorithm details.&lt;/LI&gt;
&lt;LI&gt;dedicated extents can be deallocated from an IAM chain if all the pages in the extent become deallocated.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You may ask &lt;EM&gt;"how do you know which pages are allocated in an extent?"&lt;/EM&gt; and &lt;EM&gt;"how do you track the global allocation state of extents, especially mixed extents?"&lt;/EM&gt;. The answers are by using the PFS pages, and by using the GAM + SGAM pages respectively. I'll cover these in the next post.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(Passing over Montana now at 8pm -&amp;nbsp;pretty clear skies and the sun's at an angle to throw the landscape into sharp relief - very cool. First class is great - actual crockery rather than plastic plates, cups and food...)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.chewie.members.winisp.net/images/blog/coffee.jpg"&gt;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=649884" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx">Index Fragmentation Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Under the covers: IAM chains and allocation units in SQL Server 2005</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/under-the-covers-iam-chains-and-allocation-units-in-sql-server-2005.aspx</link><pubDate>Mon, 26 Jun 2006 09:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:646865</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/646865.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=646865</wfw:commentRss><description>&lt;P&gt;&lt;EM&gt;(I'm sitting here in Seattle airport at 7am on Sunday waiting to catch the same flight to Boston that I caught two weeks ago. Instead of TechEd, this time I'm going to a training course at MIT. I'd enjoy the air travel a lot more with a bigger gap in between the flights. At least I got an aisle seat and another 5000 air miles...)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Anyway, time for part two of the discussion of IAM chains.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/24/645803.aspx" mce_href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/24/645803.aspx"&gt;Yesterday&lt;/A&gt; I explained what IAM chains are and how they correspond to indexes in SQL Server 2000. A table can have a heap or clustered index, plus up to 249 non-clustered indexes, plus storage for LOB values (commonly called the text index). This means that in SQL Server 2000, there can be a maximum of 251 IAM chains per table.&lt;/P&gt;
&lt;P&gt;In SQL Server 2005, IAM chains and IAM pages are exactly the same, but what they correspond to is different. A table can now have up to &lt;STRONG&gt;750000&lt;/STRONG&gt; IAM chains! Wow! What on earth did we do?...&lt;/P&gt;
&lt;P&gt;There are now three things that IAM chains map space allocations for:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;heaps and b-trees (a b-tree is the internal structure used to store an index) 
&lt;LI&gt;LOB data 
&lt;LI&gt;row-overflow data&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;and we now call these units of space allocation tracking &lt;EM&gt;allocation units&lt;/EM&gt;. The internal names for these three types of allocation unit are (respectively):&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;hobt allocation unit (&lt;U&gt;H&lt;/U&gt;eap &lt;U&gt;O&lt;/U&gt;r &lt;U&gt;B&lt;/U&gt;-&lt;U&gt;T&lt;/U&gt;ree, pronounced 'hobbit', yes, as in Lord Of The Rings) 
&lt;LI&gt;LOB allocation unit 
&lt;LI&gt;SLOB allocation unit (&lt;U&gt;S&lt;/U&gt;mall-&lt;U&gt;LOB&lt;/U&gt;)&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;[Edit]And the external names are, respectively:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;IN_ROW_DATA allocation unit&lt;/LI&gt;
&lt;LI&gt;LOB_DATA allocation unit&lt;/LI&gt;
&lt;LI&gt;ROW_OVERFLOW_DATA allocation unit&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Let's look at three new features in SQL Server 2005 that made&amp;nbsp;these changes are necessary and boosted the number of potential IAM chains per table.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Included Columns&lt;BR&gt;&lt;/STRONG&gt;This is the ability for non-clustered indexes to include non-key columns at the leaf-level. This is useful for three reasons:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;it allows a non-clustered index to truly cover a query where the query results include more than 16 columns or the combination of column lengths in the query results is greater than 900 bytes (remember that a non-clustered index key is limited to 16 columns and 900 bytes) 
&lt;LI&gt;it allows columns to be include in the non-clustered index that have data types that cannot be part of an index key (e.g. &lt;FONT face="Courier New"&gt;text&lt;/FONT&gt; or &lt;FONT face="Courier New"&gt;XML&lt;/FONT&gt;) 
&lt;LI&gt;it allows a non-clustered index to cover a query without having to have all the columns included in the index key. As the index key is included in rows at all levels of the b-tree, this allows the index to be smaller.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;An example of space saving: imagine a 100 million row index, with a key length of 900 bytes, but only the first two integer keys are really needed as the index key, the other 4 fixed-length columns could be included.&lt;/P&gt;
&lt;P&gt;With the 900 byte key, 8 rows can fit per database page (i.e. the &lt;EM&gt;fanout&lt;/EM&gt; is 8). This means there will be 12500000 pages at the leaf level, 1562500 pages at the next level up in the b-tree and so on, giving a total of 12500000 + 1562500 + 195313 + 24415 + 3052 + 382 + 48 + 6 + 1 = 14285717 pages (including 1785717 to store the upper levels of the b-tree).&lt;/P&gt;
&lt;P&gt;If we go with the included columns method then the key size shrinks to 8 bytes, and with the row overhead we can get the row length in the upper levels of the b-tree down to 15 bytes (giving a fanout of approx. 537). Note that the fanout at the leaf-level is still going to be 8,&amp;nbsp; because the amount of data stored in each row at the leaf-level is the same. So, this means there will be 12500000 pages at the leaf level, 23278 pages at the next level up and so on, giving a total of 12500000 + 23278 + 44 + 1 = 12523323 pages (including 23323 to store the upper levels of the b-tree). Compared to the full-size 900-byte key, this is a 12% saving of 1762394 pages, or 13.6GB! Obviously this is a contrived case but you can see how the savings can occur.&lt;/P&gt;
&lt;P&gt;Anyway, I digress. The main reason for adding this feature it to enable true covering queries. A covering query is one where the query optimizer knows it can get all the query results from the non-clustered index and so the query can be satisfied without having to incur the extra IOs of looking up data in the base table - a significant performance saving.&lt;/P&gt;
&lt;P&gt;Now that non-clustered indexes can have included columns, and those columns can be LOB data types. This means that having a single LOB allocation unit (as in the case of the single text index in SQL Server 2000) isn't possible any more because each index may have its own set of LOBs. Now, you may ask why we didn't just have a single set of LOBs with multiple references from various indexes plus the base table. We considered that but it would have made things a lot more complicated.&lt;/P&gt;
&lt;P&gt;So, with this new feature, each index needs two allocation units - one for the data or index rows (the hobt allocation unit) and one for any LOB data.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Large Rows&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;One of the things that has plagued schema designers for a long time is the 8060 byte limit on table row sizes so we've removed this restriction in SQL Server 2005. The way we've done this is to allow variable-length columns (e.g. &lt;FONT face="Courier New"&gt;varchar&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;sqlvariant&lt;/FONT&gt;) to get pushed off-row when the row size gets too big to fit on a single page.&lt;/P&gt;
&lt;P&gt;But where do these column values get pushed to? We effectively turn them into mini LOB columns. The column value in the row is replaced with a 16-byte pointer to the off-row column value, which is stored as if its a LOB value in a seperate allocation unit -&amp;nbsp;the row-overflow (or SLOB) allocation unit. These values are stored in text pages in exactly the same way as regular LOB values are, just&amp;nbsp;using a seperate allocation unit.&amp;nbsp;The SLOB allocation unit is only created when the first column value is pushed off-row.&lt;/P&gt;
&lt;P&gt;This feature works for non-clustered indexes too - if you consider the ability to have included columns in non-clustered indexes then you could easily have non-clustered index rows that won't fit on a page. It would have been short-sighted of us to get rid of the 900-byte limit and replace it with an 8060-byte limit by not extending the row-overflow feature to non-clustered indexes too.&lt;/P&gt;
&lt;P&gt;Now with the addition of this new feature, each index can have up to three allocation units - hobt, LOB, and SLOB. Even with this, that only makes a maximum of 750 IAM chains per table (remember an IAM chain now maps the storage allocations for an allocation unit, so 250 indexes * 3 allocation units = 750 IAM chains). But I mentioned 750 &lt;EM&gt;thousand&lt;/EM&gt; IAM chains per table earlier - where do all the rest come from?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Partitioning&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is what gives us the 1000x multiplier. As you may already know, partitioning is the new feature that allows tables and indexes to be split into a series of ranges, with each range stored separately (most commonly in seperate filegroups). Partitioning is a topic for a separate post.&lt;/P&gt;
&lt;P&gt;If each range or &lt;EM&gt;partition&lt;/EM&gt; of the table or index is stored seperately, then each is going to need its own hobt allocation unit. Of course, the LOB values associated with each partition need to be stored with it, and so each partition also needs a LOB allocation unit. Also, the row-overflow feature is per-row, and so rows in each partition will overflow into SLOB allocation units just as for un-partitioned tables and indexes. Thus each partition of a table or index can have up to three allocation units (and hence three IAM chains).&lt;/P&gt;
&lt;P&gt;Still, where does that 1000 come in? Each table or index can have up to 1000 partitions. This gives us 250 indexes x 1000 partitions x 3 allocation units = 750000 IAM chains. Realistically this probably won't happen, but it is possible.&lt;/P&gt;
&lt;P&gt;Now you know some more of how things are organized in SQL Server 2000 and SQL Server 2005 and hopefully this will help understanding some of my future posts.&lt;/P&gt;
&lt;P&gt;Ah - here comes the breakfast cart...&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=646865" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Fragmentation (part 2): What are pages?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/26/647005.aspx</link><pubDate>Mon, 26 Jun 2006 04:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:647005</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/647005.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=647005</wfw:commentRss><description>&lt;P&gt;&lt;EM&gt;(Boston continues its reputation - with me at least - for great seafood - calamari and pan-seared fresh halibut this evening. Yum! I was tempted to get on the T - Boston's subway system - and see what's happening downtown but with no jacket I'd get wet. So, instead I'll be boring and geeky and write another blog post - you guys are spoiled today.)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Hopefully I'm getting close to resolving the chicken-and-egg problem of being able to discuss topics without having to promise further posts to explain terms.&lt;/P&gt;
&lt;P&gt;In the &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/23/644607.aspx"&gt;previous post&lt;/A&gt; in this series I explained what records are. &lt;EM&gt;Pages&lt;/EM&gt; exist to store records. A database page is an 8192-byte (8KB) chunk of a database data file. They are aligned on 8KB boundaries within the data files, starting at byte-offset 0 in the file.&lt;/P&gt;
&lt;P&gt;A page has a structure as shown below (all pages have the same basic structure):&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.chewie.members.winisp.net/images/blog/page.gif"&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Page header&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The 96-byte page header is the same for every page. You can see an example of the fields that are stored within a page header in the last post on &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx"&gt;DBCC PAGE&lt;/A&gt;. When considering fragmentation, the most important fields are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Next page pointer 
&lt;UL&gt;
&lt;LI&gt;The pages in each level of the index are joined in a doubly-linked list according to the logical order (as defined by the index keys) of the index. The next page pointer does not necessarily point to the immediately adjacent physical page in the file (fragmentation... 
&lt;LI&gt;As these are doubly-linked lists, there is also a previous page pointer.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Page level 
&lt;UL&gt;
&lt;LI&gt;The various algorithms I'll describe later have to know whether the page being examined is from the leaf-level of the index or not (i.e. page level = 0). Page level increases from the leaf-level to the root page at the top of the b-tree&amp;nbsp;(except in clustered indexes in SQL Server 2000 where there are two level=0 levels - the leaf-level and the level above it - this is just for simplicity :-) How do you tell them apart? You need to look at the page type too - data pages are at the leaf-level, index pages in the level above)&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Free space count 
&lt;UL&gt;
&lt;LI&gt;This shows how much free space is available in the page. This is used to calculate the average page density - the less free space, the higher the page density.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Other interesting fields in the page header are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;object ID and index ID 
&lt;UL&gt;
&lt;LI&gt;in SQL Server 2000, these correspond to the actual relationl object ID and index ID to which the page is allocated. 
&lt;LI&gt;in SQL Server 2005, this mapping no longer exists. The two IDs on each page correspond (through a calculation) to the allocation unit ID of the &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/25/646865.aspx"&gt;allocation unit&lt;/A&gt; the page is allocated to. A series of metadata lookups are necessary to determine the parent object and index.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;page type 
&lt;UL&gt;
&lt;LI&gt;There are a bunch of different page types, most of which I'll be explaining more about in subsequent posts over the next few weeks. Some interesting ones are (well, interesting to me anyway): 
&lt;UL&gt;
&lt;LI&gt;data page (holds data records) 
&lt;LI&gt;index page (holds non-clustered index leaf records and non-leaf records from clustered and non-clustered indexes) 
&lt;LI&gt;&lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/24/645803.aspx"&gt;IAM page&lt;/A&gt; (holds allocation information about extents within a fixed 4GB GAM interval that are allocated to an index or allocation unit, in SQL Server 2000 and 2005 respectively. IAM = &lt;U&gt;I&lt;/U&gt;ndex &lt;U&gt;A&lt;/U&gt;llocation &lt;U&gt;M&lt;/U&gt;ap.) 
&lt;LI&gt;GAM and SGAM&amp;nbsp;pages (holds global allocation information about extents in a GAM interval. GAM = &lt;U&gt;G&lt;/U&gt;lobal &lt;U&gt;A&lt;/U&gt;llocation &lt;U&gt;M&lt;/U&gt;ap. SGAM = &lt;U&gt;S&lt;/U&gt;hared &lt;U&gt;GAM&lt;/U&gt;.) 
&lt;LI&gt;PFS page (holds allocation and free space information about pages within a PFS interval&amp;nbsp;- approx 64MB. PFS = &lt;U&gt;P&lt;/U&gt;age &lt;U&gt;F&lt;/U&gt;ree &lt;U&gt;S&lt;/U&gt;pace.) 
&lt;LI&gt;text page (actually two types that hold leaf and intermediates nodes in text trees) 
&lt;LI&gt;sort page (holds sort records being used in active sort operations) 
&lt;LI&gt;differential bitmap page (holds information about which extents in a GAM interval&amp;nbsp;have changed since the last full or differential backup) 
&lt;LI&gt;bulk-changed map page (holds information about which extents in a GAM interval have changed while in bulklogged mode since the last backup. This is what allows you to switch to bulk-logged mode for bulk-loads and index rebuilds without worrying about breaking a backup chain.) 
&lt;LI&gt;boot page (holds information about the database - one page used per database) 
&lt;LI&gt;fileheader page (holds information about the file - one page per file)&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;slot count 
&lt;UL&gt;
&lt;LI&gt;This lists the number of occupied record slots on the page (including ghost records). 
&lt;LI&gt;It can also be described as giving the number of entries in the slot array.&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;ghost record count 
&lt;UL&gt;
&lt;LI&gt;self-explanatory&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;page ID 
&lt;UL&gt;
&lt;LI&gt;a page's ID is made up of the file ID and the page position within the file and is always written as &lt;EM&gt;(file:page)&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Slot array&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It is a very common misconception that records within a page are &lt;EM&gt;always&lt;/EM&gt; stored in logical order. This is not true. There is another misconception that all the free-space in a page is always maintained in one contiguous chunk. This also is not true. (Yes, the image above shows the free space in one chunk and that very often&lt;EM&gt;&amp;nbsp; is&lt;/EM&gt; the case for pages that are being filled gradually.)&lt;/P&gt;
&lt;P&gt;If a record is deleted from a page, everything remaining on the page is not suddenly compacted - inserters pay the cost of compaction when its necessary, not deleters.&lt;/P&gt;
&lt;P&gt;Consider a completely full page - this means that record deletions cause free space holes within the page. If a new record needs to be inserted onto the page, and one of the holes is big enough to squeeze the record into, why go to the bother of comapcting it? Just stick the record in and carry on.&lt;/P&gt;
&lt;P&gt;Ah - but hold on a minute, what if the record should &lt;EM&gt;logically&lt;/EM&gt; have come at the end of all other records on the page, but we've just inserted it in the middle - doesn't that screw things up somewhat?&lt;/P&gt;
&lt;P&gt;No, because the slot array is ordered and get reshuffled as records are inserted and deleted from pages. As long as the first slot array entry points to the logically first record on the page, everythings fine. Each slot entry is just a two-byte pointer into the page - so its far more efficient to manipulate the slot array than it is to manipulate a bunch of records on the page. Only when we know there's enough free space contained within the page to fit in a record, but its spread about the page do we compact the records on the page to make the free space into a contiguous chunk.&lt;/P&gt;
&lt;P&gt;One interesting fact is that the slot array grows backwards from the end of the page, so the free space is squeezed from the top by new rows, and from the bottom by the slot array.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Records&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You know what these are already - we talked about them last time!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;IO&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Pages are the basic unit of IO that SQL server uses. The buffer pool maps individual pages and torn-page protection and page checksums are implemented per-page. Fragmentation is mostly concerned with pages, and the efficiency of being able to read them in logical order (as defined by their next page pointers).&lt;/P&gt;
&lt;P&gt;They can be allocated individually or in extents, which we'll cover next time...&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=647005" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx">Index Fragmentation Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Under the covers: IAM chains in SQL Server 2000</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/24/645803.aspx</link><pubDate>Sat, 24 Jun 2006 17:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:645803</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/645803.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=645803</wfw:commentRss><description>&lt;P&gt;I've reached a point in my various ramblings where I need to do some glossary work. First up is an explanation of IAM chains. This will be in two parts, detailing how they're used in SQL Server 2000 and then in 2005. (Probably tomorrow as the sun's shining and I want to play with my tractor once the time of day&amp;nbsp;- 7.30am now&amp;nbsp;- becomes a little more socially acceptable for a large diesel engine to be running.)&lt;/P&gt;
&lt;P&gt;As with so many of the explanations of database structure internals, there's the chicken-and-egg problem unless I'm standing in front of you with a big whiteboard, so I'll refer to things that haven't been defined yet. We'll get there eventually, I promise.&lt;/P&gt;
&lt;P&gt;An IAM (Index Allocation Map) page tracks approximately 4GB worth of space in a single file, aligned on a 4GB boundary. These 4GB chunks are called 'GAM intervals' (another post!). The IAM page tracks what space within that specific GAM interval belongs to a single entity (I'm chosing my words carefully here and not using any word that has SQL Server connotations like 'object'). I'll get to the structure of an IAM page below.&lt;/P&gt;
&lt;P&gt;Now, as an IAM page can only track the space for a single GAM interval in a single file, if the database has multiple files, or some files are more then 4GB, and the entity has space allocated from multiple files or multiple GAM intervals within a file, then you can see how multiple IAM pages are needed for each entity to track all the space that its using.&lt;/P&gt;
&lt;P&gt;This is where an IAM chain comes in. It's a linked-list of IAM pages that track the space allocated to a single entity. The linked-list is not sorted at all - IAM pages are appended to it in the order that they're needed. The IAM pages within the list are numbered, again, in the order that they were appended to the list.&lt;/P&gt;
&lt;P&gt;Definition of 'entity' - what uses an IAM chain? This is vastly different in SQL Server 2000 and 2005, hence the need for two posts.&lt;/P&gt;
&lt;P&gt;In SQL Server 2000, a single IAM chain is used for each:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;heap or clustered index&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;a table can only have one or the other, not both&lt;/LI&gt;
&lt;LI&gt;these have index IDs of 0 and 1 respectively&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;non-clustered index&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;these have index IDs from 2 to 250 (i.e. you can only(!) have 249 of them)&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;text storage&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;for LOB columns in the heap or clustered index&lt;/LI&gt;
&lt;LI&gt;sometimes called the 'text index'&lt;/LI&gt;
&lt;LI&gt;these have a fixedindex ID of 255&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;This is very simple, right? I usually generalize and say that in SQL Server 2000, there's one IAM chain per index (which fits nicely if you remember that IAM stands for &lt;EM&gt;Index&lt;/EM&gt; Allocation Map).&lt;/P&gt;
&lt;P&gt;How exactly does each IAM page track space usage within the GAM interval that it maps to? Each IAM page has two &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/23/644607.aspx"&gt;records&lt;/A&gt;, an IAM page header and a bitmap.&lt;/P&gt;
&lt;P&gt;The IAM page header tracks metadata about the IAM chain, including:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the GAM interval that the IAM page maps&lt;/LI&gt;
&lt;LI&gt;the sequence number of the IAM page within the IAM chain&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;this increases by one for each page added to the chain&lt;/LI&gt;
&lt;LI&gt;the pages are linked using their previous and next page pointers and the linked-list must be in strict sequence number order&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;the object and index IDs of the index that the chain maps&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;all the IAM pages in the IAM chain (and in fact all pages allocated to the index) have the same object and index ID stamped in their page headers.&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;It also contains the single-page array. This is only used in the first IAM page in the chain and tracks single pages that have been allocated to the index, instead of extents (an extent is a group of 8 contiguous pages - I'll cover pages and extents more fully next week in Fragmentation parts 2 and&amp;nbsp;3 - it's that chicken-and-egg thing again).&lt;/P&gt;
&lt;P&gt;The bitmap occupies the rest of the IAM page and has a bit for each extent in the GAM interval&amp;nbsp; The bit is set if the extent is allocated to the index, and clear if it is not. Obviously two IAM pages that map the same GAM interval for different indexes cannot both have the same bit set (sounds like a job for CHECKDB!)&lt;/P&gt;
&lt;P&gt;You can look at the contents of an IAM page using DBCC PAGE. Use the instructions in &lt;A href="https://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx"&gt;this post&lt;/A&gt; to work out what pages are IAM pages and have a look.&lt;/P&gt;
&lt;P&gt;Some random things to note about IAM chains and pages:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;they are not self-referential (they do not track the space taken up by themselves)&lt;/LI&gt;
&lt;LI&gt;if some data is deleted, leading to space deallocation, leading to a GAM interval no longer having any space allocated for an index, the IAM page is not deleted&lt;/LI&gt;
&lt;LI&gt;the only operations that delete pages from the IAM chain are &lt;FONT face="Courier New"&gt;TRUNCATE TABLE&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;DROP TABLE&lt;/FONT&gt;, and certain repairs in &lt;FONT face="Courier New"&gt;DBCC CHECKDB&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face="Courier New"&gt;DBCC INDEXDEFRAG&lt;/FONT&gt; makes a copy of the IAM chain for an index and sorts it by file and GAM interval to allow it to work out what the next physical extent/page in each file is&lt;/LI&gt;
&lt;LI&gt;the IAM chain repairs are far-and-away the most complicated&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In the next post, I'll explain how SQL Server 2005 has changed things.&lt;/P&gt;
&lt;P&gt;(I notice that some previous posts get rated 4/5 and some 5/5 - I'd love to know what it is that's missing from posts that get rated 4/5 so I can make them more useful/enjoyable - drop me a line...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=645803" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>Fragmentation (part 1): What are records?</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/23/644607.aspx</link><pubDate>Fri, 23 Jun 2006 18:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:644607</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/644607.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=644607</wfw:commentRss><description>&lt;P&gt;This blogging thing sucks you in, doesn't it? Not content with having an ongoing series on disaster recovery and CHECKDB (with another 6 and 25 more posts planned respectively), I'm starting a new series on fragmentation. This will begin from first principles and work up, in approximately 18 posts over the next few months. The first few posts could be skipped by some people and will cover:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;What are records?&lt;/LI&gt;
&lt;LI&gt;What are pages?&lt;/LI&gt;
&lt;LI&gt;What are extents?&lt;/LI&gt;
&lt;LI&gt;What is a heap? &lt;/LI&gt;
&lt;LI&gt;What is a clustered index?&lt;/LI&gt;
&lt;LI&gt;What is a non-clustered index?&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Bear with me as I build up the terminology. You could also check out Kalen's excellent book &lt;EM&gt;Inside SQL Server 2000&lt;/EM&gt; for details on these topics. (Her upcoming volume on the Storage Engine for &lt;EM&gt;Inside SQL Server 2005&lt;/EM&gt; should be out sometime this summer - buy it!).&lt;/P&gt;
&lt;P&gt;The idea for this series came to mind last Friday at TechEd when I spent about 3 hours repeating a deck on fragmentation I gave to the North Texas SSUG in April 2004, people kept wandering by and stopping to listen. If that many people are interested in this stuff, it should make good blog material, and it also seems to be frequently misunderstood. The level of sophistication here ranges from not having any idea what fragmentation is up to defragging or rebuilding all indexes every night. I didn't see anyone there who knew just when it was worth removing fragmentation so I decided to explain here. The first 6 posts will also be useful as background for the CHECKDB internals series I'm doing.&lt;/P&gt;
&lt;P&gt;So, what are&amp;nbsp;records? At the simplest level, a record is the physical storage associated with a table or index row. Of course, it gets much more complicated than that...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data records&lt;/STRONG&gt;&lt;/P&gt;&lt;STRONG&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;/STRONG&gt;These store table rows in a heap, or in the leaf level of a clustered index. They store all the columns of the table row that will fit in a single 8Kb page.&lt;/LI&gt;
&lt;LI&gt;Data records are stored on data pages.&lt;/LI&gt;
&lt;LI&gt;If any columns are for LOB data types (&lt;FONT face="Courier New"&gt;text&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;ntext&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;image&lt;/FONT&gt;, and the new LOB types in SQL Server 2005 - &lt;FONT face="Courier New"&gt;varchar(max)&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;nvarchar(max)&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;varbinary(max)&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;XML&lt;/FONT&gt;), then there's a pointer stored in the data record which points to a text record on a different page (the root of a loose tree that stores the LOB value). Exceptions to this are when schema has been set to store LOB columns 'in-row' when possible. This is when a LOB value is small enough to fit within the confines of the data page that holds the data record, and so is stored in the same data record. This is a performance benefit as selecting the LOB column does not require an extra IO to read the text record.&lt;/LI&gt;
&lt;LI&gt;In SQL Server 2005, non-LOB variable length columns (e.g. &lt;FONT face="Courier New"&gt;varchar&lt;/FONT&gt;, &lt;FONT face="Courier New"&gt;sqlvariant&lt;/FONT&gt;) may also be stored 'off-row' as part of the new capability (called &lt;EM&gt;row-overflow&lt;/EM&gt;) of having table rows longer than 8060 bytes. In this case the storage format is the same as for LOB values - a pointer in the data record pointing to a text record.&lt;/LI&gt;
&lt;LI&gt;I'll go into how the columns are laid out differently between heaps and clustered indexes in parts 4 and 5. There are also some twists in the record types for heaps that I'll cover in part 4.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Index records&lt;/STRONG&gt;&lt;/P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;/STRONG&gt;There are two types of index records (which differ only in what columns they store):&lt;/LI&gt;
&lt;OL&gt;
&lt;LI&gt;Those that store non-clustered index rows&lt;/LI&gt;
&lt;LI&gt;Those that comprise the b-tree that make up clustered and non-clustered indexes.&lt;/LI&gt;&lt;/OL&gt;
&lt;LI&gt;I'll explain more about the differences between these in parts 5 and 6 - it can be quite complicated (especially the differences between SQL Server 2000 and 2005) and is worth doing in separate posts.&lt;/LI&gt;
&lt;LI&gt;Index records are stored on index pages.&lt;/LI&gt;
&lt;LI&gt;Index records typically do not contain all the column values in a table (although some do - called &lt;EM&gt;covering&lt;/EM&gt; indexes).&lt;/LI&gt;
&lt;LI&gt;In SQL Server 2005, non-clustered index records can include LOB values as &lt;EM&gt;included columns&lt;/EM&gt; (with the storage details exactly the same as for data records) and also can have &lt;EM&gt;row-overflow&lt;/EM&gt; data that is pushed off-row (again, in exactly the same way as for data records).&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Text records&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There are various types of text records that comprise the tree structure that stores LOB values, stored on two types of text page.&lt;/LI&gt;
&lt;LI&gt;An in-depth explanation of the various types and how they hang together is beyond the scope of this post and discussion.&lt;/LI&gt;
&lt;LI&gt;They are also used to store variable-length column values that have been pushed out of data or index records as part of the &lt;EM&gt;row-overflow&lt;/EM&gt; capability.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Ghost records&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;These are records that have been logically deleted but not physically deleted from the leaf level of an index.&lt;/LI&gt;
&lt;LI&gt;The reasons for this are complicated, but basically having ghost records simplfies key-range locking and&amp;nbsp;transaction rollback.&lt;/LI&gt;
&lt;LI&gt;The record is marked with a bit that indicates it's a ghost record and cannot be physically deleted until the transaction that caused it to be ghosted commits. Once this is done, it is deleted by an asynchronous background proces (called the &lt;EM&gt;ghost-cleanup task&lt;/EM&gt;) or it is converted back to a real record by an insert of a record with the exact same set of keys.&lt;/LI&gt;
&lt;LI&gt;Ghost records will be mentioned later in the series when I discuss page compaction.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Other record types&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There are also records that are used to store various allocation bitmaps, intermediate results of sort operations, and file and database metadata (e.g. in the per-file fileheader page and database boot page).&lt;/LI&gt;
&lt;LI&gt;These are not relevant to a discussion of&amp;nbsp; fragmentation so won't be considered further here.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Record structure&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;All records have the same structure, regardless of their type and use, but the number and type of columns will be different. For instance, a data record from a table with a complex schema may have hundreds of columns of various types whereas an allocation bitmap record will have a single column, filling up the whole page.&lt;/P&gt;
&lt;P&gt;The record structure isn't relevant to a discussion on fragmentation but is for CHECKDB internals, so here it is:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;record header&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;4 bytes long&lt;/LI&gt;
&lt;LI&gt;two bytes of record metadata (record type)&lt;/LI&gt;
&lt;LI&gt;two bytes pointing forward in the record to the NULL bitmap&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;fixed length portion of the record, containing the columns storing data types that have fixed lengths (e.g. &lt;EM&gt;bigint&lt;/EM&gt;, &lt;EM&gt;char(10)&lt;/EM&gt;, &lt;EM&gt;datetime&lt;/EM&gt;)&lt;/LI&gt;
&lt;LI&gt;NULL bitmap&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;two bytes for count of columns in the record&lt;/LI&gt;
&lt;LI&gt;variable number of bytes to store one bit per column in the record, regardless of whether the column is nullable or not (this is different and simpler than SQL Server 2000 which had one bit per nullable column only)&lt;/LI&gt;
&lt;LI&gt;this allows an optimization when reading columns that are NULL&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;variable-length column offset array&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;two bytes for the count of variable-length columns&lt;/LI&gt;
&lt;LI&gt;two bytes per variable length column, giving the offset to the start of the column value&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;versioning tag&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;this is in SQL Server 2005 only&lt;/LI&gt;
&lt;LI&gt;this is a 14-byte structure that contains a timestamp plus a pointer into the version store in tempdb&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;If you have any questions on this stuff - put them in the comments of drop me an email.&lt;/P&gt;
&lt;P&gt;Next time - what are pages?&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=644607" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Index+Fragmentation+Series/default.aspx">Index Fragmentation Series</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item><item><title>How to use DBCC PAGE</title><link>http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/10/625659.aspx</link><pubDate>Sat, 10 Jun 2006 21:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:625659</guid><dc:creator>Paul Randal - MSFT</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/sqlserverstorageengine/comments/625659.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlserverstorageengine/commentrss.aspx?PostID=625659</wfw:commentRss><description>&lt;P&gt;Yes, finally I come clean and tell all. It's an open secret that there's an undocumented DBCC command called DBCC PAGE that you can use to look at the contents of database pages. I've recommended in forum postings that people use it and Product Support also asks customers to use it during various investigations. Bottom line - it's there, and its extremely well tested (we use it extensively internally in literally thousands of tests). Bear in mind, however, that it is undocumented and thus unsupported - you won't get any help using if from Product Support. Can you use it on production systems? I don't see any reason why not but you should be wary, as with any undocumented command, procedure or trace flag.&lt;/P&gt;
&lt;P&gt;Why am I doing this? I get asked this so much from people that are curious and I'd like to do some posts on interpreting CHECKDB results, which is a little hard unless you use DBCC PAGE.&lt;/P&gt;
&lt;P&gt;So what's the syntax?&lt;/P&gt;&lt;FONT face="Courier New" size=3&gt;
&lt;P&gt;dbcc page ( {'dbname' | dbid}, filenum, pagenum [, printopt={0|1|2|3} ])&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;The filenum and pagenum parameters are taken from the page IDs that come from various system tables and appear in DBCC or other system error messages. A page ID of, say, (1:354) has filenum = 1 and pagenum = 354.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;The printopt parameter has the following meanings:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face="Times New Roman"&gt;0 - print just the page header&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Times New Roman"&gt;1 - page header plus per-row hex dumps and a dump of the page slot array (unless its a page that doesn't have one, like allocation bitmaps)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Times New Roman"&gt;2 - page header plus whole page hex dump&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face="Times New Roman"&gt;3 - page header plus detailed per-row interpretation&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;The per-row interpretation work for all page types, including allocation bitmaps.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;By default, the output is sent to the errorlog. If you want the output to come back to your current connection, turn on trace flag 3604.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Times New Roman"&gt;How do you find a page to dump? There are some easy ones - the allocation bitmaps. For example, lets dump the first PFS page in the database, just looking at its header:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DBCC&lt;/FONT&gt;&lt;FONT size=2&gt; PAGE &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;master&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 0&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face="Times New Roman"&gt;&lt;FONT size=1&gt;
&lt;P&gt;PAGE: (1:1)&lt;/P&gt;
&lt;P&gt;BUFFER:&lt;/P&gt;
&lt;P&gt;BUF @0x02BB582C&lt;/P&gt;
&lt;P&gt;bpage = 0x03772000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bhash = 0x00000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bpageno = (1:1)&lt;/P&gt;
&lt;P&gt;bdbid = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;breferences = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bUse1 = 42182&lt;/P&gt;
&lt;P&gt;bstat = 0xc0000b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;blog = 0x21598979&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bnext = 0x00000000&lt;/P&gt;
&lt;P&gt;PAGE HEADER:&lt;/P&gt;
&lt;P&gt;Page @0x03772000&lt;/P&gt;
&lt;P&gt;m_pageId = (1:1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_headerVersion = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_type = 11&lt;/P&gt;
&lt;P&gt;m_typeFlagBits = 0x3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_level = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_flagBits = 0x0&lt;/P&gt;
&lt;P&gt;m_objId (AllocUnitId.idObj) = 99&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_indexId (AllocUnitId.idInd) = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Metadata: AllocUnitId = 6488064&lt;/P&gt;
&lt;P&gt;Metadata: PartitionId = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Metadata: IndexId = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Metadata: ObjectId = 99&lt;/P&gt;
&lt;P&gt;m_prevPage = (0:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_nextPage = (0:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pminlen = 0&lt;/P&gt;
&lt;P&gt;m_slotCnt = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_freeCnt = 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_freeData = 8188&lt;/P&gt;
&lt;P&gt;m_reservedCnt = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_lsn = (199:344:5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_xactReserved = 0&lt;/P&gt;
&lt;P&gt;m_xdesId = (0:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_ghostRecCnt = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_tornBits = 351018853&lt;/P&gt;
&lt;P&gt;Allocation Status&lt;/P&gt;
&lt;P&gt;GAM (1:2) = ALLOCATED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SGAM (1:3) = NOT ALLOCATED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PFS (1:1) = 0x44 ALLOCATED 100_PCT_FULL&lt;/P&gt;
&lt;P&gt;DIFF (1:6) = CHANGED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ML (1:7) = NOT MIN_LOGGED &lt;/P&gt;
&lt;P&gt;DBCC execution completed. If DBCC printed error messages, contact your system administrator.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;There are a bunch of things on this that are beyond the scope of this post to explain - I'll get to them in future posts. One thing you'll notice is that there's some interpretation of the object and index IDs that are stamped on the page. This is because in SQL Server 2005, these are derived from the allocation unit ID, not the actual object and index ID. Simplistically, this is because of partitioning - each index can now have multiple b-trees, and hence multiple IAM chains. Each IAM chain is called an allocation unit. In the next post I'll go into some detail on how this is structured. Chicken-and-egg problem again, or a teaser to keep reading the blog :-)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Now how about if we ask for the detailed dump of the PFS page?&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;DBCC&lt;/FONT&gt;&lt;FONT size=2&gt; PAGE &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;master&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; 3&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;);&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;GO&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;PAGE: (1:1)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;BUFFER:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;BUF @0x02BB582C&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;bpage = 0x03772000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bhash = 0x00000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bpageno = (1:1)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;bdbid = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;breferences = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;bUse1 = 42182&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;bstat = 0xc0000b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;blog = 0x21598979&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bnext = 0x00000000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;PAGE HEADER:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;Page @0x03772000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_pageId = (1:1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_headerVersion = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_type = 11&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_typeFlagBits = 0x3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_level = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_flagBits = 0x0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_objId (AllocUnitId.idObj) = 99&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_indexId (AllocUnitId.idInd) = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Metadata: AllocUnitId = 6488064&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;Metadata: PartitionId = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Metadata: IndexId = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Metadata: ObjectId = 99&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_prevPage = (0:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_nextPage = (0:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pminlen = 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_slotCnt = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_freeCnt = 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_freeData = 8188&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_reservedCnt = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_lsn = (199:344:5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_xactReserved = 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;m_xdesId = (0:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_ghostRecCnt = 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m_tornBits = 351018853&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;Allocation Status&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;GAM (1:2) = ALLOCATED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SGAM (1:3) = NOT ALLOCATED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PFS (1:1) = 0x44 ALLOCATED 100_PCT_FULL&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;DIFF (1:6) = CHANGED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ML (1:7) = NOT MIN_LOGGED&lt;/FONT&gt; &lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;PFS: Page Alloc Status @0x4414C000&lt;/P&gt;
&lt;P&gt;(1:0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- (1:3)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATED 100_PCT_FULL &lt;/P&gt;
&lt;P&gt;(1:4)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- (1:5)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= NOT ALLOCATED 0_PCT_FULL &lt;/P&gt;
&lt;P&gt;(1:6)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- (1:7)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATED 100_PCT_FULL &lt;/P&gt;
&lt;P&gt;(1:8)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATED 0_PCT_FULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mixed Ext&lt;/P&gt;
&lt;P&gt;(1:9)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- (1:10)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATED 100_PCT_FULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mixed Ext&lt;/P&gt;
&lt;P&gt;(1:11)&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATED 0_PCT_FULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mixed Ext&lt;/P&gt;
&lt;P&gt;(1:12)&amp;nbsp;&amp;nbsp;-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ALLOCATED 0_PCT_FULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IAM Page&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Mixed Ext&lt;/P&gt;
&lt;P&gt;&amp;lt;deleted to keep this post from being enormous&amp;gt;&lt;/P&gt;
&lt;P&gt;DBCC execution completed. If DBCC printed error messages, contact your system administrator.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;How about being able to dump some pages from a user table? Firstly, you have to work out which pages comprise the table and index. Here's one way to do this (without having to divulge any more undocumented commands :-)&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT size=3&gt;create an empty database&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT size=3&gt;do a type 3 page dump of the first page PFS page in the database (1:1) using DBCC PAGE&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT size=3&gt;creating a simple heap and insert a few rows into it&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT size=3&gt;do another PFS dump like in step 2 and you'll see some more pages have been allocated - these are the ones being used to store your new table. One of them will be the IAM page and another will be a data page.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT size=3&gt;Find some pages to dump and play about with&amp;nbsp;DBCC PAGE. Experiment with adding indexes and LOB columns to see what different kinds of pages are created and look at the linkages between them.&amp;nbsp;I'll go into what the various parts of the output mean in another post - in the meantime, if there's anything in particular you want to know, add a comment and I'll reply.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;Have fun!&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=625659" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/DBCC/default.aspx">DBCC</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/Disaster+Recovery/default.aspx">Disaster Recovery</category><category domain="http://blogs.msdn.com/sqlserverstorageengine/archive/tags/On-Disk+Structures/default.aspx">On-Disk Structures</category></item></channel></rss>