Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use BBED to understand block structure

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

There are two main types of Oracle data blocks: file header blocks and data blocks. Let's first introduce the data block: the data block is simply divided into the following layers:

BBED > set dba 1mai 58914 DBA 0x0040e622 (4253218 1m 58914) BBED > map File: / u01/app/oracle/oradata/qxptfh01/system01.dbf (1) Block: 58914 Dba:0x0040e622 -KTB Data Block (Table/Cluster) struct kcbh 20 bytes @ 0-Cache Layer-struct ktbbh, 72 bytes @ 20-Transaction Layer-struct kdbh, 14 bytes @ 92-Data Header-struct kdbt [1] 4 bytes @ 106-- Table Directory-sb2 kdbr [3] @ 110-Row Directory-ub1 freespace [8041] @ 116-Free Space-ub1 rowdata [31] @ 8157-Row Data-ub4 tailchk @ 8188-- Tailchk-

The part from Data header to Row Data is called Data Layer.

The first part of the Cache Layer:Block, which is 20 bytes long, has an internal data structure called kcbh, including

The following parts

BBED > p kcbhstruct kcbh, 20 bytes @ 0 ub1 type_kcbh @ 0 0x06-- Block type (table/index,rollback segment,temporary segment, etc.) ub1 frmt_kcbh @ 1 0xa2-- Block format (v6 Jing v7 V8) ub1 spare1_kcbh @ 2 0x00-keep ub1 spare2_kcbh @ 3 0x00-retain ub4 rdba_kcbh @ 4 0x0040e622-block address DBA ub4 bas_kcbh @ 8 0x01a9b470-- scn base ub2 Wrp_kcbh @ 12 0x0000-- scn wrap ub1 seq_kcbh @ 14 0x07-- Serial number of the block Set to 0xff, it is considered a bad block. Ub1 flg_kcbh @ 15 0x06 (KCBHFDLC, KCBHFCKV)-- the flag of the block, that is, the attribute of the block. Ub2 chkval_kcbh @ 16 0x153c-- check value, db_block_checksum=true, to have a value. Ub2 spare3_kcbh @ 18 0x0000-keep

Flg_kcbh:

Define KCBHFNEW 0 × 01 / * new block-zeroed data area * /

# define KCBHFDLC 0x02 / * Delayed Logging Change advance SCN/seq * /

# define KCBHFCKV 0 × 04 / * ChecK Value saved-block xor's to zero * /

# define KCBHFTMP 0 × 08 / * Temporary block * /

This is a value that can be combined, that is to say, when there is a promising 6, it is a combination of 2 and 4.

Type_kcbh:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report