In previous test, I just create table with two columns, how about for a table with a lot of columns? The basic block format does not change, the key is how to extract the rows. I get one row piece from Oracle dump as following.
tab 0, row 1, @0x1ec3
tl: 6 fb: --H-FL-- lb: 0x0 cc: 25
col 0: *NULL*
col 1: *NULL*
......
col 24: [ 1] 4e
bindmp: 00 02 19 00 c9 4e
The bindmp part is actually the binary data Oracle used to store all the 25 column's data. How it works? Following is my research.
00 -- Still unknown
02 -- Piece count
19 -- Column count
00 -- piece 0
c9 4e -- piece 1
For each piece, it contains one byte as the piece indicator and may have some piece data (usually column data).
piece indicator [column data]
For the piece indicator, it can have three different values.
0xff - 0xff -- A NULL Column
0xC8 - 0xfe -- Column length + 200, follow by column data
0x00 - 0xC8 -- The row pointer (row id) of tab 0.
Let check the row 0 of tab 0 in this example.
tab 0, row 0, @0x1ec9
tl: 56 fb: --H-FL-- lb: 0x0 cc: 24
col 0: *NULL*
col 1: *NULL*
col 2: [ 5] 56 41 4c 49 44
col 3: [ 2] c1 02
col 4: [ 3] c2 03 38
col 5: *NULL*
col 6: *NULL*
col 7: [ 1] 4e
col 8: [10] 20 20 20 20 20 20 20 20 20 31
col 9: [10] 20 20 20 20 20 20 20 20 20 31
col 10: [ 5] 20 20 20 20 4e
col 11: [ 7] 45 4e 41 42 4c 45 44
col 12: [ 2] 4e 4f
col 13: *NULL*
col 14: [ 1] 4e
col 15: [ 2] 4e 4f
col 16: [ 7] 44 45 46 41 55 4c 54
col 17: [ 8] 44 49 53 41 42 4c 45 44
col 18: [ 2] 4e 4f
col 19: [ 8] 44 49 53 41 42 4c 45 44
col 20: *NULL*
col 21: [ 8] 44 49 53 41 42 4c 45 44
col 22: [ 8] 44 49 53 41 42 4c 45 44
col 23: [ 2] 4e 4f
bindmp: 00 02 18 ff ff cd 56 41 4c 49 44 37 cb c2 03 38 ff ff c9 4e 36 36 cd 20 20 20 20 4e cf 45 4e 41 42 4c 45 44 3a ff c9 4e 3a cf 44 45 46 41 55 4c 54 39 3a 39 ff 39 39 3a
So row 1 for tab 0 is row 0 of tab 0 plus one more column. Very luck I found that my guess works correctly.

Comments (1)
plz send how to create a table etc
Posted by syedathiq | April 27, 2008 5:54 PM