Oracle Block format

zhaozj2021-02-16  50

Information reference: www.ixora.com.au Special Thank Overtime Big Brother to my selfless help and I have been encouraged to support my netizens who have not got Oracle support, so I can't guarantee the correctness of information, please use technology unlimited casual Reprint

Oracle 8.1.7 8k Block Windows XP Create Table T (N Number); Insert Into T Values ​​(1); --- From DBMS_ROWID, you see the data of Table T on DataFile 4 on the 3th Block of ALTER SYSTEM DUMP DATAFILE 4 BLOCK 3; The following is the information of DUMP files. You can also use the following statement and then use the above DUMP statement to see the BLOCK's 2-encycloped storage format but this memory 2 in the memory and the order of block data in DataFile. Will be a slightly different possibilities, alter session set events '10289 trace name context forever, level 1'; ALTER session set events '10289 trace name context off'; ~~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ below the UDUMP directory information below the Dump file

----------------------- first part

Buffer TSN: 7 RDBA: 0x01000003 (4/3) SCN: 0x0000.000802A5 SEQ: 0x01 flg: 0x02 tail: 0x02a50601frmt: 0x02 chkval: 0x0000 type: 0x06 = Trans Data

--- Buffer TSN: Number of TableSpace corresponding to data files This is just data recorded in the dump file --- BLOCK is the number of Number that does not record TableSpace --- RDBA: 4 Bytes Datafile Block - SCN: 6 bytes System Change Number --- SEQ: 1 Byte A Sequence Number Increment for Each Change To a Block At The Same SCN --- A New SCN IS Allocated If The Sequence Number Wraps. --- The same SCN affects the number of rows in this Block greater than 254 lines will allocate a new SCN for this transaction - as the following operations may cause the same SCN but affect the same block in the same block over 254 lines - - "delete from table_name" - The number of rows (maximum 254) is used from 0x01 to 0xfe --- When this Byte's data is 0xFF, this block is hired ---> ORA-01578 --- Flg: 1 byte 1 = Virgin Block --- 2 = Last Change To the Block Was for a Cleanout Operation --- 4 = Checksum Value IS set --- 8 = Temporary Data - this is a Taking the combination is also a combination of 2, 4 when there is 6, and it is a combination of 2, 4 cases --- tail: 4 bytes This is the data recorded in the last 4 Bytes of the block --- Dump file just Written in front --- frmt: 1 byte Oracle 8 After seeing 0x02 --- ChKVAL: 2 bytes set db_block_checksum = true in the init file --- type: 1 byte This block type Here mainly look at 0x06 This is because this is used to save user data - other types can be referred to http://www.ixora.com.au/notes/cache_block_types.htm

----------------------- Second Part Block Header Dump: 0x01000003 Object ID on Block? Y SEG / OBJ: 0X614A CSC: 0x00.802A3 ITC: 1 FLG: O TYP: 1 - DATA FSL: 0 FNX: 0x0 Ver: 0x01 --- Seg / Obj: 4 bytes This is a 16-based corresponding sys.obj $ .Obj # data dictionary data --- CSC: 6 BYTES The SCN AT Which THE Last Full Cleanout Was Performed on The Block --- ITC: 1 Byte The following ITL transaction bars 8.1.7 Document The above says that you can use initrans when you build a table - limit this value Size (MAX 255 exceeds the meeting ORA-02207), but to consider whether the block is enough --- Table in initrans default is 1, 9.2.0 Initrans Default is 2 --- Yong Huang says something ORA -00060 can set the initrans of the table --- Ixora says when block space is not creating an ITL, it may cause ora-00054 - flg: 2 bytes 0 Indicates That The Block is on a freeelist. Otherwise The Flag IS ---- 9i's ASSM case In this value of E --- Ixora says he occupies 2 bytes but I have a certain entry of the following tests and his results - I observed the situation: --- Object ID on block? Y --- FLG: O --- Ver: 0x01 --- The above 3 is expressed in the same byte - TYP: 1 byte 1 is Table; 2 is index. Oracle is in the OBJ $ table The situation comes - the type of judgment object is not based on this TYP.

That is, if there is a table but change this flag bit in the table, you can query the data, but the dump block is wrong, as below ORA - ORA-00600: internal error code, self Variables: [4555], [0], [], [], [], [], [], [] - 错 误 中 中 对 对 对 数据 对 --- fsl: 1 byte index to The first slot on the itl freeelist. itl tx freeelist slot --- fnx: 4 Bytes Free List in the next address NULL IF this block is not on a freelist --- there is data, for example: fnx: 0x1000029 --- Ver: 1 byte format (Version) This data does not see the relevant documentation introduction from Ixora says to occupy 1byte --- but I have a different below from the following 2 credit --- unused: 4 bytes There is also the free space of 4 bytes but there is no display on the DUMP file above - this unused 4 Bytes is the saying of Ixora - "FSL: 0 fnx: 0x0 Ver : 0x01 "This section of this data has changed ----------------------- Part III ITL XID UBA FLAG LCK SCN / FSC0X01 XID: 0x0003.045.000000 B4 UBA: 0x0080170A.00C7.36 --U- 1 FSC 0x0000.000802A5

--- This is an Oracle used to record transaction information. Only one ITL bar is displayed here. How many ITL bars can be dynamically increased - as long as the space in the block can define the number of initial ITL bars in initrans This storage parameter - how many ITLs here can be seen from the "second part" "ITC:" - this part involves the serial number of Rollback Segment or undo TableSpace --- ipid: 8 BYTES Value You can use Select Xidusn, Xidslot, Xidsqn from V $ Transaction; Isolated --- This Is Comprised of The Rollback Segment Number (2 Bytes) ), and the number --- of Times Use of what transaction table has wrapped (4 bytes). - UBA: 8 bytes the location to this block by this --- Transaction. this - Transaction. this - THIS BY THIS - Transaction. THIS IS Comprised of the DBA of the Rollback Segment Block (4 --- Bytes), The Sequence Number (2 Bytes), And The Record Number for the Change --- In That undo block (1 byte), Plus 1 unused byte. --- Flag 1 nibble ---- = TRA NSAction Is Active, or Committed Pending Cleanout --- C --- = Transaction Has Been Committed and Locks Cleaned Out --- -B-- = This undo Record Contains The undo for this itl entry --- --u- = Transaction Committed (Maybe Long Ago); SCN IS An Upper Bound --- - T =

transaction was still active at block cleanout SCN --- Lck 3 nibbles The number of row-level locks held in the block by this transaction. --- Scn / Fsc 6 bytes If the transaction has been cleaned out, this is the commit SCN OR AN Upper --- Bound theref. Otherwise the Leading Two bytes Contain The Free Space Credit --- for the Transaction - That IS, The Number of Bytes Freed in The Block by the - Transaction --- Reference http: / / www.ixora.com.au/q a/dataBlock.htm#D ------------------------------------------ ============= Tsiz: 0x1fb8hsiz: 0x14pbl: 0x02476c44bdba: 0x01000003FLAG = ---------- NTAB = 1NROW = 1FRRE = -1FSBO = 0x14fseo = 0x1fb2avsp = 0x1f9btosp = 0x1f9b0xe : pti [0] nrow = 1 OFFS = 00x12: Pri [0] OFFS = 0x1fb2

--- Tsiz: HSIZ: PBL: BDBA: In the data files are not stored --- Tsiz: In addition to the above 3 parts and the 4 bytes of the Block tail, the remaining space 0x1fb8 is 8120 bytes 8K block: --- 8192-20 (Transaction header) -24 (a transaction bar) -4 (block tail) = 8120 --- HSIZ: Data block head 20 bytes data block 4 bytes = 24 bytes (0x14) --- PBL: Ptr to buffer Holding the block I am using the special mode DUMP DataFile's block comes out --- this block of dump coming in the Dump file of the same session is all. The same value --- BDBA: and RDBA in the first part - Flag 1 byte n = pctfree hit (clusters), f = don't put on free list --- k = flushable cluster keys. Of course There are other tags: a ...--- ntab 1 Byte This block has several Table data cluster, how many of the data can be greater than 1 - nrow 2 Bytes Block --- Frre 2 bytes first free Row index entry. -1 = you have to add one .-- fsbo 2 bytes free space becom offset - fseo 2 bytes free space end offset --- AVSP 2 BYTES AVAILABLE SPACE IN THE BLOCK --- TOSP 2 bytes Total Available SPAC e When All TXS Commit --- 0xE: NROW 2 BYTES BLOCK This table How many rows of data --- 0xE: OFFS 2 bytes offset can be seen when using Cluster --------- -------------- Part 5 Block_row_dump: Tab 0, Row 0, @ 0x1fb2tl: 6 FB: --H-FL - LB: 0x1 CC: 1col 0: [2] C1 02END_OF_BLOCK_DUMP

--- TL: The length of this record includes 3 bytes of the general situation of Row Head and the length of 1 bytes of data length and the length of the data itself --- FB: 1 byte k = cluster key (Flags May Change Meaning IF this is set to show hash cluster --- c = cluster Table Member --- h = Head piece of row --- d = deleted row --- f = first data piers --- l = last data piers - - p = first column continues from previous pieces --- n = Last Column Continues in Next Piece --- LB: 1 Byte and the above third part of the ITL's LCK corresponds to whether the line is LOCK --- CC : 1 byte means this line has several data --- col 0: [2]: 1 Byte means the length of this line --- C1 02: This is the data in Table "1" can pass the following statement Look at Oracle Really uses the user data indicated by those 16-based data Select Dump (col_name, 16) from table_name; ~~~~~~~~~~~~~~~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~

The following data is the 2 credit corresponding to the DUMP file above I explain the content in the order of the 2 credit data.

------------------------ The first part of the corresponding above DUMP files OFFSET 0 1 2 3 4 5 6 7 8 9 A b C D e f

00006000 06 02 00 00 00 00 00 01 02 00006010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

--- 06: Type: 0x06 = Trans Data (corresponding to the content in the DUMP file) --- 02: fmt: 0x02 --- 00 00: Filler should be in the dump file above the unused does not display this part of this part - - 03 00 00 01: RDBA: 0x01000003 is the only TableSpace is unique when DataFile may not be unique - to see his rules: continuously built 4 DataFile their first block --- 0x 01 00 04 01 --- 0x 01 00 08 01 --- 0x 01 00 0C 01 --- 0x 01 00 00 02 --- Corresponding data is 0x01040001, 0x01080001, 0x010c0001, 0x02000001 --- This can be seen The largest capacity of a DataFile is 0x01040001 ~ 0x0107FFFF for a total of --- 4M (because there is a DataFile head) Block if block is 8K a DataFile is 32G - this is the Oracle's document on Oracle's DataFile (8K The reason for the maximum 32G --- can also see a tableSpace's DataFile can be from 0x0100 to 0xffe 1023 --- DataFile This is also the Oracle document says that a TableSapce can have 1022 DataFile --- Reasons ( In fact TableSpace can have 1023 DataFile I have built) --- This data of this data in Oracle10g Big DataFile is 0x00000001 ~ 0xfffffffff - this is why a Big DataFile's TableSapce has only one dataFile and the maximum value is --- 32T (8K: 4G * 8K = 32t; 32K data block is 128T) --- A5 02 08 00 00 00: SCN: 0x0000.000802A5 Oracle is the 6-digit unhappy is a unsigned Long ---- and unsigned int 3 - 01: SEQ: 0x01 --- 02: FLG: 0x02 --- 00 00 00: Chkval: 0x0000 Set db_block_checksum = true in Init --- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : This part is not displayed in the Dump file above the unused --- The above 20 Bytes data is changed to which the value will definitely happen (not necessarily ora-01578, I also saw ORA-600) - ---------------------- The second part of the corresponding above DUMP file

01 00 00 00 4A 61 00 00 A3 02 08 00 00006020 00 00 00 00 01 00 03 00 00 00 00 00 --- 01: typ: 1 - DATA --- 00: I saw the other had not seen the value of 0x00 Don't know --- 00: Have other values ​​but change this value with the editor does not display changes in the dump file --- 00: Didn't see other value don '

T know --- 4a 61 00 00: SEG / OBJ: 0X614A --- A3 02 08 00 00 00: CSC: 0x00.802A3 --- 00 00: See have other values ​​but change this value with editors in DUMP The file is displayed in the file --- 01: ITC: 1 Number of ITL entries below --- 00: Have other values ​​but change this value in the dump file with the editor changes --- 03 : Flg: o Ver: 0x01 Object ID on block? Y --- From my observation DUMP file FLG Ver Object ID on Block --- the one-byte of this one-byte of them can take advantage of him from below See the situation - 2 Entering Data FLG Ver Object ID on Block?

--- 0x00 - 0x00 n --- 0x01 0 0x00 n --- 0x02 - 0x01 y --- 0x03 0 0x01 y --- 0x04 - 0x02 y --- 0x05 0 0x02 y --- 0x06 - 0x03 Y- - 0x07 0 0x03 y --- 0x08 - 0x04 n --- 0x09 0 0x04 n --- 0x0a - 0x05 y --- 0x0B 0 0x05 y --- 0x0c - 0x06 y --- 0x0D 0 0x06 Y-- - 0x0E - 0x07 Y --- 0x0F 0 0x07 Y --- 0x10 ... Similar to the above cycle has changed on 9i because ASSM appearance - 00 00 00 00 00 00 00 00: fnx : 0x0 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

03 00 45 00 00006030 B4 00 00 00 0A 17 80 00 C7 00 36 00 01 20 00 00 00006040 A5 02 08 00

--- 03 00 45 00 B4 00 00 00 00 00: XID: 0x0003.045.000000B4 --- 0A 17 80 00 C7 00 36 00: UBA: 0x0080170A.00C7.36 --- 01 0: LCK Locked ROW Number Here Use the next Byte's data - 2: Flag 2 correspondence is the 0010 justice and dump file --- 00 00 A5 02 08 00: SCN / FSC

------------------------ The fourth part of the corresponding above DUMP file

00 01 01 00 FF FF 14 00 B2 1F 9B 1F 00006050 9B 1F 00 00 01 00 B2 1F --- 00: FLAG --- 01: Ntab --- 01 00: NROW --- FF: FRE --- 14 00: FSBO --- B2 1F: FSEO --- 9B 1F: AVSP --- 9B 1f: TOSP --- 00 00 00: 0xE: OFFS --- 01 00: 0xE: nrow --- b2 1f: 0x12 : PRI [0] OFFS = 0x1fb2

------------------------ The fifth part of the corresponding above DUMP file

--- This part is omitted in the middle of the above data omitted because of these parts in this list not store data.

00007FF0 00 00 00 00 00 2c 01 01 02 C1 02

- This is the place where the user data is stored in block - 2C: FB: --- 01: LB: Is this line to be left - 01: How many data in this record is seen from here because Use only one byte to record how many columns - So up to 255 columns But a table can be up to 1000 columns If the table is more than 255 columns here, the link occurs according to the length of the record, Links in blocks or direct links directly - this is why Table's design is less than 255 columns --- 02: How much is the length of the data of the first column --- C1 02: Storage Data "1" in block

------------------------ "Tail: 0x02a50601" 01 06 A5 02 --- this is used by the first part of the corresponding above DUMP file below Delivery Block's full mark change this Block's last 4 BYTES data in any affirmation ORA-1578

~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ above is just a simple Oracle Block There are still many other situations such as Cluster, Index, etc., LOB, Long Raw These in Block indicates that there is different embodiments due to the difference in data length.

Sometimes any of the data in the block does not necessarily happen because the following two parameters are not set to truedb_block_checking db_block_checksum These two parameters are true for System TableSpace. So the data in System TableSpace will definitely happen. ORA- 01578 With the continuous upgrade of Oracle Version Oracle's correctness to store data in Block, it is also more difficult to understand the format of Oracle Block through conventional means.

转载请注明原文地址:https://www.9cbs.com/read-23094.html

New Post(0)