SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBCC PAGE


DBCC PAGE

Author
Message
BLOB EATER
BLOB EATER
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4208 Visits: 5070
Hi SSC,

Im not an advanced DBA so apologies if this question seems simple but I would like some guidance. I am trying to understand the output of DBCC page using the following example - from sqlskills.com

--------------------------------------------------------------------------

Slot 0 Offset 0x60 Length 33

Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS

Memory Dump @0x5C76C060

00000000: 30000800 05000000 0300f802 00160021 †0..............!
00000010: 0042616e 66667369 67687473 6565696e †.Banffsightseein
00000020: 67†††††††††††††††††††††††††††††††††††g

Slot 0 Column 0 Offset 0x11 Length 5

destination = Banff

Slot 0 Column 1 Offset 0x16 Length 11

activity = sightseeing

Slot 0 Column 2 Offset 0x4 Length 4

duration = 5

-----------------------------------------------------------------------


Can someone just point out to me where:

> Byte 0 is ? (This will help me to understand where bits 1-3 is to get the record type)
> what is meant by TagA byte of the record metadata and TagB?

again, apologies if this seems trivial, just require some assistance.

thanks,

A.
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21339 Visits: 7660
Dr.sql.com (10/10/2012)

again, apologies if this seems trivial, just require some assistance.


Arguing with DBCC Page is anything but trivial except for a limited number of people (<1000 at best, in my knowledge) on the planet. All of the planet. The rest of us just muddle through.

Is this simply exploration or are you trying to resolve a particular issue?


- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
GilaMonster
GilaMonster
SSC Guru
SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)

Group: General Forum Members
Points: 231349 Visits: 46350
TagA and TagB are just the two bytes (first and second) of the record header, nothing fancier than that. You don't need to decode them, DBCC Page does it for you, it contains info lik "Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS"

The "00000000" is the offset, so byte 0 = offset 00000000, so the first byte of the dump, in this case, Byte 0 is 0x30. The record has a null bitmap and variable length columns (but I didn't need to decode the header for that, DBCC PAge did it for me "Record Attributes = NULL_BITMAP VARIABLE_COLUMNS"

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


BLOB EATER
BLOB EATER
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4208 Visits: 5070
This is more complicated than the Artificial Intelligence Module I did at University few years ago.....Ermm

@ Craig - No issue, Im just finding it frustrating that I cant grasp this.

@ Gail - I was waiting for a MCM ;-)

Ok, so offset = 00000000 as you stated.
Then Bits 1-3 of byte 0 is what? 3,0,0 or 0,0,0 ?

It will probably help if I knew what you mean by 0x30? Is it related to 30000800?
(might sound stupid to you - sorry)
GilaMonster
GilaMonster
SSC Guru
SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)

Group: General Forum Members
Points: 231349 Visits: 46350
Err...
No offence, but if you don't understand hex representation, you're going to find the raw page dumps near impossible to decode.
You might want to first read up on hexadecimal and binary and how they're represented. Wiki should have something decent.

0x30 = 00110000 expressed in binary. It's the first byte of the header. So bits 4 and 5 are 1 and all the others are 0. Those two bits been set to 1 tell me (comparing against the structure of the DB header) that the row has a null bitmap (bit 4) and variable length columns (bit 5)

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)

Group: General Forum Members
Points: 55857 Visits: 17722
GilaMonster (10/10/2012)
TagA and TagB are just the two bytes (first and second) of the record header, nothing fancier than that. You don't need to decode them, DBCC Page does it for you, it contains info lik "Record Type = PRIMARY_RECORD Record Attributes = NULL_BITMAP VARIABLE_COLUMNS"

The "00000000" is the offset, so byte 0 = offset 00000000, so the first byte of the dump, in this case, Byte 0 is 0x30. The record has a null bitmap and variable length columns (but I didn't need to decode the header for that, DBCC PAge did it for me "Record Attributes = NULL_BITMAP VARIABLE_COLUMNS"

Argghhh bytes, bits, Hex, offsets :-)

Gail has already given you a good starter, the 0x30 is the hex value. The offset is the point in the file at which the record starts and then has a corresponding record length The slots are the records which you can see hold the column data. It's probably worth reading through this to get more of an understanding. Playing with a Hex editor on a test database should enlighten you more. Just don't run it on your Production systems or you won't be popular :-)

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
BLOB EATER
BLOB EATER
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4208 Visits: 5070
GilaMonster (10/10/2012)
Err...
No offence, but if you don't understand hex representation, you're going to find the raw page dumps near impossible to decode.
You might want to first read up on hexadecimal and binary and how they're represented. Wiki should have something decent.

0x30 = 00110000 expressed in binary. It's the first byte of the header. So bits 4 and 5 are 1 and all the others are 0. Those two bits been set to 1 tell me (comparing against the structure of the DB header) that the row has a null bitmap (bit 4) and variable length columns (bit 5)


That makes sense, Im just rusty, I will dig up my notes on oct, hex and binary number representation.

thanks.
Perry Whittle
Perry Whittle
SSC Guru
SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)SSC Guru (55K reputation)

Group: General Forum Members
Points: 55857 Visits: 17722
sql.com (10/10/2012)
@ Gail - I was waiting for a MCM ;-)

Why??

i could be wrong but i'm sure I'm not. I wouldn't think that the MCM course will teach you hex, binary, file offsets and the like. You either know it or you don't.

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
BLOB EATER
BLOB EATER
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4208 Visits: 5070
GilaMonster (10/10/2012)
Err...
No offence, but if you don't understand hex representation, you're going to find the raw page dumps near impossible to decode.
You might want to first read up on hexadecimal and binary and how they're represented. Wiki should have something decent.

0x30 = 00110000 expressed in binary. It's the first byte of the header. So bits 4 and 5 are 1 and all the others are 0. Those two bits been set to 1 tell me (comparing against the structure of the DB header) that the row has a null bitmap (bit 4) and variable length columns (bit 5)


Looks like an interesting read, I will read it tonight as evening study.

thanks.
BLOB EATER
BLOB EATER
SSCarpal Tunnel
SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)SSCarpal Tunnel (4.2K reputation)

Group: General Forum Members
Points: 4208 Visits: 5070
Perry Whittle (10/10/2012)
sql.com (10/10/2012)
@ Gail - I was waiting for a MCM ;-)

Why??

i could be wrong but i'm sure I'm not. I wouldn't think that the MCM course will teach you hex, binary, file offsets and the like. You either know it or you don't.


Just got over-excited. Nothing more, nothing less. I meant no disrespect.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search