A blog by Jose Barreto, a member of the File Server team at Microsoft.
All messages posted to this blog are provided "AS IS" with no warranties, and confer no rights.
Information on unreleased products are subject to change without notice.
Dates related to unreleased products are estimates and are subject to change without notice.
The content of this site are personal opinions and might not represent the Microsoft Corporation view.
The information contained in this blog represents my view on the issues discussed as of the date of publication.
You should not consider older, out-of-date posts to reflect my current thoughts and opinions.
© Copyright 2004-2012 by Jose Barreto. All rights reserved.
Follow @josebarreto on Twitter for updates on new blog posts.
Here are some notes on "SQL Server 2008 Pages" I took while attending an advanced class on SQL Server taught by Paul Randal (http://sqlskills.com/AboutPaulSRandal.asp).
Please note that, although these notes were taken during the class, I might have added some of my own (mis)interpretation :-). Always check your facts on Books Online (I try to provide links when applicable). As with anything else you get from a blog, never use any of this in production before you thoroughly validate it a test environment. Please keep in mind that some of those will be hard to follow without the right pre-requisite knowledge and the right context. Reading the post from top to bottom will help.
Data Files
A database file is divided into
Pages include
Types of pages
Looking inside a page
Demo
-- Show DBCC PAGE results in messages DBCC TRACEON(3604) GO -- Make sure we're in master USE MASTER GO -- Create TEST database CREATE DATABASE TEST GO -- Make sure we're in TEST USE TEST GO -- Show File Header page (1:0) DBCC PAGE(TEST, 1, 0, 3) DBCC PAGE(TEST, 1, 0, 3) WITH TABLERESULTS GO -- Show first PFS page (1:1) DBCC PAGE(TEST, 1, 1, 3) GO -- Show first GAM page (1:2) DBCC PAGE(TEST, 1, 2, 3) GO -- Show first SGAM page (1:3) DBCC PAGE(TEST, 1, 3, 3) GO -- Show first DCM page (1:6) DBCC PAGE(TEST, 1, 6, 3) GO -- Show first BCM page (1:7) DBCC PAGE(TEST, 1, 7, 3) GO -- Show Boot page (1:9) DBCC PAGE(TEST, 1, 9, 3) GO -- Create TT table CREATE TABLE TT (ID INT, NM VARCHAR(50)) GO -- Insert some rows INSERT INTO TT (ID, NM) VALUES (0, 'ZERO'), (1, 'ONE'), (2, 'TWO'), (3, 'THREE'), (4, 'FOUR'), (5, 'FIVE'), (6, 'SIX'), (7, 'SEVEN'), (8, 'EIGHT'), (9, 'NINE') GO -- Look at data for index 0 = heap (two pages should show) DBCC IND('TEST','TT', 0) GO -- Look at first page, IAM (might not be 1:154 in your case) DBCC PAGE(TEST, 1, 154, 1) GO -- Look at second page, data in the heap (might not be 1:153 in your case) DBCC PAGE(TEST, 1, 153, 3)DBCC PAGE(TEST, 1, 153, 3) WITH TABLERESULTSGO -- Create two indexes, one clustered, one non-clustered CREATE CLUSTERED INDEX TTID ON TT(ID) CREATE NONCLUSTERED INDEX TTNM ON TT(NM) GO -- Look at data for Index 1 (two pages should show) DBCC IND('TEST','TT', 1) GO -- Look at a clustered index page (might not be 1:155 in your case) DBCC PAGE(TEST, 1, 155, 3) DBCC PAGE(TEST, 1, 155, 3) WITH TABLERESULTSGO -- Look at data for Index 2 (two pages should show) DBCC IND('TEST','TT', 2) GO -- Look at a non-clustered index page (might not be 1:153 in your case) DBCC PAGE(TEST, 1, 153, 3) GO
For more details, check Paul's posts at:
PingBack from http://www.keyongtech.com/5160922-data-page-storage-size