Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

DBCC PAGE Expand / Collapse
Author
Message
Posted Wednesday, October 10, 2012 3:19 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 23, 2014 9:39 AM
Points: 174, Visits: 573
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.



-------------------------------------------
I'm not afraid of storms, for I'm learning to sail my ship
Post #1370784
Posted Wednesday, October 10, 2012 3:23 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 7:18 PM
Points: 6,250, Visits: 7,409
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
Post #1370786
Posted Wednesday, October 10, 2012 3:39 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 42,829, Visits: 35,958
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 2008, MVP
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

Post #1370795
Posted Wednesday, October 10, 2012 4:13 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 23, 2014 9:39 AM
Points: 174, Visits: 573
This is more complicated than the Artificial Intelligence Module I did at University few years ago.....

@ 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)


-------------------------------------------
I'm not afraid of storms, for I'm learning to sail my ship
Post #1370817
Posted Wednesday, October 10, 2012 4:27 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 42,829, Visits: 35,958
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 2008, MVP
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

Post #1370822
Posted Wednesday, October 10, 2012 4:40 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, August 29, 2014 9:57 AM
Points: 6,304, Visits: 13,601
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"
Post #1370828
Posted Wednesday, October 10, 2012 4:43 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 23, 2014 9:39 AM
Points: 174, Visits: 573
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.


-------------------------------------------
I'm not afraid of storms, for I'm learning to sail my ship
Post #1370832
Posted Wednesday, October 10, 2012 4:44 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Friday, August 29, 2014 9:57 AM
Points: 6,304, Visits: 13,601
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"
Post #1370833
Posted Wednesday, October 10, 2012 4:45 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 23, 2014 9:39 AM
Points: 174, Visits: 573
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.


-------------------------------------------
I'm not afraid of storms, for I'm learning to sail my ship
Post #1370834
Posted Wednesday, October 10, 2012 4:46 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 23, 2014 9:39 AM
Points: 174, Visits: 573
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.


-------------------------------------------
I'm not afraid of storms, for I'm learning to sail my ship
Post #1370835
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse