Unraveling MS SQL 2000 Database Format (Part 2)

In this second part, I want to pinpoint the offset location for m_freeCnt, m_freeData and m_slotCnt.

This fields is very important in the case when you want to move certain record to another page block physically without corrupting the database.

Also, in the case of the corrupted page block, this values will end up with incorrect value. Hopefully, by checking and manually fixing the value will restore the page block consistencies.

Certain formula has to be applied so that this fields will have the correct values. The correct value will enabling the DBCC PAGE to parse the page block. If the value is inconsistent, then DBCC PAGE just show the raw data format, and in the worst case, will end up with corrupted database 🙂

The related post of how to update this byte correctly is in the “How to Change Page Record” post.

Let’s we use again the hex dump from previous post :

Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F

00000000 01 0F 00 00 08 01 00 00 00 00 00 00 00 00 00 00

00000010 00 00 00 00 00 00 01 00 63 00 00 00 01 1F DE 18

00000020 00 00 00 00 01 00 00 00 67 00 00 00 78 01 00 00

00000030 13 00 00 00 00 00 00 00 00 00 00 00 42 D2 00 00

00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

 

Offset 16-17 which is Hex 01 00 which is 0x0001 is m_SlotCnt.

Offset 1C-1D which is Hex 01 1F which is 0x1F01 = 7937 is m_freeCnt.

Offset 1E-1F which is Hex DE 18 which is 0x18DE = 6366 is m_freeData.

Please use the power given unto you wisely and with care 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: