oracle 树状结构一直出现不了_深入解析Oracle ASSM 段头块(PAGETABLE SEGMENT HEADER)结构...
一、概念介紹
????Oracle ASSM(Automatic Segment Space Managed)使用位圖來管理數據庫中的空間,具有管理簡單、高并發等優點,ASSM的整體結構是3層位圖塊+數據塊,即4層的樹狀結構,如下所示,
? Oracle ASSM 中Segment Header內部結構由Cache Header、Header Control及L2 BMB array三層結構組成,Oracle數據塊類型代碼為“type: 0x23=PAGETABLE SEGMENT HEADER”,由于bbed工具不支持查詢Segment Header的物理結構,本節主要使用C語言解析Segment Header物理結構。
二、使用bbed查看PAGETABLE SEGMENT HEADER結構
SQL> create table hsql.orastar_1(c_char char(10),c_vchar varchar2(10));
Table created.
SQL> insert into hsql.orastar_1 values('a','a');
1 row created.
SQL> insert into hsql.orastar_1 values('b','bb');
1 row created.
SQL> commit;
Commit complete.
set linesize 200 pagesize 200
col owner for a10
col segment_name for a10
select owner,segment_name,header_file,header_block,SEGMENT_TYPE from dba_segments where segment_name='ORASTAR_1';
OWNER ? SEGMENT_NA HEADER_FILE HEADER_BLOCK SEGMENT_TYPE
---------- ---------- ----------- ------------ ------------------
HSQL ? ORASTAR_1 5 ?1698 TABLE
BBED: Release 2.0.0.0.0 - Limited Production on Fri Jan 10 18:45:52 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates. ?All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set dba 5,1698
DBA ? ? ? ? ? ? 0x014006a2 (20973218 5,1698)
BBED> map /v ?
File: /oradata/epmsn/hsql01.dbf (5)
Block: 1698 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Dba:0x014006a2
------------------------------------------------------------
BBED-00400: invalid blocktype (35)
BBED>
三、dump結構解析
alter session set tracefile_identifier='orastar_01';
oradebug setmypid
alter system dump datafile 5 block 1698;
oradebug close_trace
oradebug tracefile_name
四、二進制結構解析
五、工具解析
使用C語言結構體解析該數據塊結構,解析后的物理結構如下所示,
結構 | 解釋 |
struct kcbh, 20 bytes ? ? ? ? ? ? ? ? ? @0 | |
? ? ? ?ub1 type_kcbh ? ? ? ? ? ? ? ? ? @0 ? ? ? ? ? ? ? ?0x23 | Block type |
? ? ? ?ub1 frmt_kcbh ? ? ? ? ? ? ? ? ? @1 ? ? ? ? ? ? ? ?0xa2 | Block format a2=oracle 112 |
? ? ? ?ub1 spare1_kcbh ? ? ? ? ? ? ? ? @2 ? ? ? ? ? ? ? ?0x00 | not used |
? ? ? ?ub1 spare2_kcbh ? ? ? ? ? ? ? ? @3 ? ? ? ? ? ? ? ?0x00 | not used |
? ? ? ?ub4 rdba_kcbh ? ? ? ? ? ? ? ? ? @4 ? ? ? ? ? ? ? ?0x01400a0a | RDBA-Relative Data Block Address |
? ? ? ?ub4 bas_kcbh ? ? ? ? ? ? ? ? ? ?@8 ? ? ? ? ? ? ? ?0x0029cbc7 | SCN Base |
? ? ? ?ub2 wrp_kcbh ? ? ? ? ? ? ? ? ? ?@12 ? ? ? ? ? ? ? 0x0000 | SCN Wrap |
? ? ? ?ub1 seq_kcbh ? ? ? ? ? ? ? ? ? ?@14 ? ? ? ? ? ? ? 0x02 | sequence number |
? ? ? ?ub1 flg_kcbh ? ? ? ? ? ? ? ? ? ?@15 ? ? ? ? ? ? ? 0x04 | Flag:0x01 New Block0x02 Delayed Loging Change advanced SCN/seq0x04 Check value saved-block XOR's to zero0x08 Temporary block |
? ? ? ?ub2 chkval_kcbh ? ? ? ? ? ? ? ? @16 ? ? ? ? ? ? ? 0xe395 | Optional block checksum(if DB_BLOCK_CHECKSUM=TRUE) |
? ? ? ?ub2 spare3_kcbh ? ? ? ? ? ? ? ? @18 ? ? ? ? ? ? ? 0x0000 | not used |
struct ech(Extent Control Header) ? ? ? @36 | Extent Control Header |
? ? ? ?ub4 extents_ech ? ? ? ? ? ? ? ? @36 ? ? ? ? ? ? ? 0x00000012 | #extents |
? ? ? ?ub4 blocks_ech ? ? ? ? ? ? ? ? ?@40 ? ? ? ? ? ? ? 0x00000180 | #blocks |
? ? ? ?ub4 offset_ech ? ? ? ? ? ? ? ? ?@44 ? ? ? ? ? ? ? 0x00000a9c | offset |
? ? ? ?ub4 blk_ech ? ? ? ? ? ? ? ? ? ? @52 ? ? ? ? ? ? ? 0x00000080 | blk# |
? ? ? ?ub4 extsize_ech ? ? ? ? ? ? ? ? @56 ? ? ? ? ? ? ? 0x00000080 | ext size |
? ? ? ?ub4 hw_ech ? ? ? ? ? ? ? ? ? ? ?@60 ? ? ? ? ? ? ? 0x01401f80 | Highwater |
? ? ? ?ub4 lhwmext_ech ? ? ? ? ? ? ? ? @92 ? ? ? ? ? ? ? 0x00000010 | ext# of Low HighWater Mark |
? ? ? ?ub4 lhwmblk_ech ? ? ? ? ? ? ? ? @96 ? ? ? ? ? ? ? 0x00000010 | blk# of Low HighWater Mark |
? ? ? ?ub4 lhwmextsize_ech ? ? ? ? ? ? @100 ? ? ? ? ? ? ?0x00000080 | ext size of Low HighWater Mark |
? ? ? ?ub4 lhwm_ech ? ? ? ? ? ? ? ? ? ?@104 ? ? ? ? ? ? ?0x01401e90 | Low HighWater Mark |
? ? ? ?ub4 lhwmbmb1_ech ? ? ? ? ? ? ? ?@124 ? ? ? ? ? ? ?0x01401e80 | Level 1 BMB for Low HWM block |
? ? ? ?ub4 hhwmbmb1_ech ? ? ? ? ? ? ? ?@128 ? ? ? ? ? ? ?0x01401f01 | Level 1 BMB for High HWM block |
? ? ? ?ub4 segtype_ech ? ? ? ? ? ? ? ? @208 ? ? ? ? ? ? ?0x00000001 | Segment Type |
? ? ? ?ub4 blksz_ech ? ? ? ? ? ? ? ? ? @212 ? ? ? ? ? ? ?0x00002000 | blksz |
? ? ? ?ub4 fbsz_echo ? ? ? ? ? ? ? ? ? @216 ? ? ? ? ? ? ?0x00000000 | fbsz |
? ? ? ?ub4 l2asoffset_ech ? ? ? ? ? ? ?@220 ? ? ? ? ? ? ?0x00001434 | L2 Array start offset |
? ? ? ?ub4 firstbmb3_echo ? ? ? ? ? ? ?@224 ? ? ? ? ? ? ?0x00000000 | First Level 3 BMB |
? ? ? ?ub4 l2hfinsert_ech ? ? ? ? ? ? ?@228 ? ? ? ? ? ? ?0x01400a09 | L2 Hint for inserts |
? ? ? ?ub4 nl2_echo ? ? ? ? ? ? ? ? ? ?@232 ? ? ? ? ? ? ?0x00000001 | nl2 |
? ? ? ?ub4 lastBMB1_echo ? ? ? ? ? ? ? @236 ? ? ? ? ? ? ?0x01401f01 | Last Level 1 BMB |
? ? ? ?ub4 lastBMB2_echo ? ? ? ? ? ? ? @240 ? ? ? ? ? ? ?0x01400a09 | Last Level 2 BMB |
? ? ? ?ub4 lastBMB3_echo ? ? ? ? ? ? ? @244 ? ? ? ? ? ? ?0x00000000 | Last Level 3 BMB |
? ? ? ?ub4 mhnext_echo ? ? ? ? ? ? ? ? @260 ? ? ? ? ? ? ?0x00000000 | next of Map Header |
? ? ? ?ub4 mhext_echo ? ? ? ? ? ? ? ? ?@264 ? ? ? ? ? ? ?0x00000012 | #extents of Map Header |
? ? ? ?ub4 mhobj_ech ? ? ? ? ? ? ? ? ? @272 ? ? ? ? ? ? ?0x00015781 | obj# of Map Header |
? ? ? ?ub4 mhflag_ech ? ? ? ? ? ? ? ? ?@276 ? ? ? ? ? ? ?0x10000000 | flag of Map Header |
struct em(Extent Map) ? ? ? ? ? ? ? ? ? @280 | Extent Map |
? ? ? ?ub4 dba_em[0] ? ? ? ? ? ? ? ? ? @280 ? ? ? ? ? ? ?0x01400a08 ? ? ? ? ? ?ub4 len_em[0] ? ? ? ? ? ? ? ? ? @284 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[1] ? ? ? ? ? ? ? ? ? @288 ? ? ? ? ? ? ?0x01400a10 ? ? ? ? ? ?ub4 len_em[1] ? ? ? ? ? ? ? ? ? @292 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[2] ? ? ? ? ? ? ? ? ? @296 ? ? ? ? ? ? ?0x01400a18 ? ? ? ? ? ?ub4 len_em[2] ? ? ? ? ? ? ? ? ? @300 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[3] ? ? ? ? ? ? ? ? ? @304 ? ? ? ? ? ? ?0x01400a20 ? ? ? ? ? ?ub4 len_em[3] ? ? ? ? ? ? ? ? ? @308 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[4] ? ? ? ? ? ? ? ? ? @312 ? ? ? ? ? ? ?0x01400a28 ? ? ? ? ? ?ub4 len_em[4] ? ? ? ? ? ? ? ? ? @316 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[5] ? ? ? ? ? ? ? ? ? @320 ? ? ? ? ? ? ?0x01400a30 ? ? ? ? ? ?ub4 len_em[5] ? ? ? ? ? ? ? ? ? @324 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[6] ? ? ? ? ? ? ? ? ? @328 ? ? ? ? ? ? ?0x01400a38 ? ? ? ? ? ?ub4 len_em[6] ? ? ? ? ? ? ? ? ? @332 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[7] ? ? ? ? ? ? ? ? ? @336 ? ? ? ? ? ? ?0x01400a40 ? ? ? ? ? ?ub4 len_em[7] ? ? ? ? ? ? ? ? ? @340 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[8] ? ? ? ? ? ? ? ? ? @344 ? ? ? ? ? ? ?0x01400a48 ? ? ? ? ? ?ub4 len_em[8] ? ? ? ? ? ? ? ? ? @348 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[9] ? ? ? ? ? ? ? ? ? @352 ? ? ? ? ? ? ?0x01400a50 ? ? ? ? ? ?ub4 len_em[9] ? ? ? ? ? ? ? ? ? @356 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[10] ? ? ? ? ? ? ? ? ?@360 ? ? ? ? ? ? ?0x01400a58 ? ? ? ? ? ?ub4 len_em[10] ? ? ? ? ? ? ? ? ?@364 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[11] ? ? ? ? ? ? ? ? ?@368 ? ? ? ? ? ? ?0x01400a60 ? ? ? ? ? ?ub4 len_em[11] ? ? ? ? ? ? ? ? ?@372 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[12] ? ? ? ? ? ? ? ? ?@376 ? ? ? ? ? ? ?0x01400a68 ? ? ? ? ? ?ub4 len_em[12] ? ? ? ? ? ? ? ? ?@380 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[13] ? ? ? ? ? ? ? ? ?@384 ? ? ? ? ? ? ?0x01400a70 ? ? ? ? ? ?ub4 len_em[13] ? ? ? ? ? ? ? ? ?@388 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[14] ? ? ? ? ? ? ? ? ?@392 ? ? ? ? ? ? ?0x01400a78 ? ? ? ? ? ?ub4 len_em[14] ? ? ? ? ? ? ? ? ?@396 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[15] ? ? ? ? ? ? ? ? ?@400 ? ? ? ? ? ? ?0x01401e00 ? ? ? ? ? ?ub4 len_em[15] ? ? ? ? ? ? ? ? ?@404 ? ? ? ? ? ? ?0x00000008 | |
? ? ? ?ub4 dba_em[16] ? ? ? ? ? ? ? ? ?@408 ? ? ? ? ? ? ?0x01401e80 ? ? ? ? ? ?ub4 len_em[16] ? ? ? ? ? ? ? ? ?@412 ? ? ? ? ? ? ?0x00000080 | |
? ? ? ?ub4 dba_em[17] ? ? ? ? ? ? ? ? ?@416 ? ? ? ? ? ? ?0x01401f00 ? ? ? ? ? ?ub4 len_em[17] ? ? ? ? ? ? ? ? ?@420 ? ? ? ? ? ? ?0x00000080 | |
struct am(Auxillary Map) ? ? ? ? ? ? ? ?@2736 | Auxillary Map |
? ? ? ?ub4 fdba_am[0] ? ? ? ? ? ? ? ? ?@2736 ? ? ? ? ? ? 0x01400a08 ? ? ? ? ? ?ub4 datadba_am[0] ? ? ? ? ? ? ? @2740 ? ? ? ? ? ? 0x01400a0b | |
? ? ? ?ub4 fdba_am[1] ? ? ? ? ? ? ? ? ?@2744 ? ? ? ? ? ? 0x01400a08 ? ? ? ? ? ?ub4 datadba_am[1] ? ? ? ? ? ? ? @2748 ? ? ? ? ? ? 0x01400a10 | |
? ? ? ?ub4 fdba_am[2] ? ? ? ? ? ? ? ? ?@2752 ? ? ? ? ? ? 0x01400a18 ? ? ? ? ? ?ub4 datadba_am[2] ? ? ? ? ? ? ? @2756 ? ? ? ? ? ? 0x01400a19 | |
? ? ? ?ub4 fdba_am[3] ? ? ? ? ? ? ? ? ?@2760 ? ? ? ? ? ? 0x01400a18 ? ? ? ? ? ?ub4 datadba_am[3] ? ? ? ? ? ? ? @2764 ? ? ? ? ? ? 0x01400a20 | |
? ? ? ?ub4 fdba_am[4] ? ? ? ? ? ? ? ? ?@2768 ? ? ? ? ? ? 0x01400a28 ? ? ? ? ? ?ub4 datadba_am[4] ? ? ? ? ? ? ? @2772 ? ? ? ? ? ? 0x01400a29 | |
? ? ? ?ub4 fdba_am[5] ? ? ? ? ? ? ? ? ?@2776 ? ? ? ? ? ? 0x01400a28 ? ? ? ? ? ?ub4 datadba_am[5] ? ? ? ? ? ? ? @2780 ? ? ? ? ? ? 0x01400a30 | |
? ? ? ?ub4 fdba_am[6] ? ? ? ? ? ? ? ? ?@2784 ? ? ? ? ? ? 0x01400a38 ? ? ? ? ? ?ub4 datadba_am[6] ? ? ? ? ? ? ? @2788 ? ? ? ? ? ? 0x01400a39 | |
? ? ? ?ub4 fdba_am[7] ? ? ? ? ? ? ? ? ?@2792 ? ? ? ? ? ? 0x01400a38 ? ? ? ? ? ?ub4 datadba_am[7] ? ? ? ? ? ? ? @2796 ? ? ? ? ? ? 0x01400a40 | |
? ? ? ?ub4 fdba_am[8] ? ? ? ? ? ? ? ? ?@2800 ? ? ? ? ? ? 0x01400a48 ? ? ? ? ? ?ub4 datadba_am[8] ? ? ? ? ? ? ? @2804 ? ? ? ? ? ? 0x01400a49 | |
? ? ? ?ub4 fdba_am[9] ? ? ? ? ? ? ? ? ?@2808 ? ? ? ? ? ? 0x01400a48 ? ? ? ? ? ?ub4 datadba_am[9] ? ? ? ? ? ? ? @2812 ? ? ? ? ? ? 0x01400a50 | |
? ? ? ?ub4 fdba_am[10] ? ? ? ? ? ? ? ? @2816 ? ? ? ? ? ? 0x01400a58 ? ? ? ? ? ?ub4 datadba_am[10] ? ? ? ? ? ? ?@2820 ? ? ? ? ? ? 0x01400a59 | |
? ? ? ?ub4 fdba_am[11] ? ? ? ? ? ? ? ? @2824 ? ? ? ? ? ? 0x01400a58 ? ? ? ? ? ?ub4 datadba_am[11] ? ? ? ? ? ? ?@2828 ? ? ? ? ? ? 0x01400a60 | |
? ? ? ?ub4 fdba_am[12] ? ? ? ? ? ? ? ? @2832 ? ? ? ? ? ? 0x01400a68 ? ? ? ? ? ?ub4 datadba_am[12] ? ? ? ? ? ? ?@2836 ? ? ? ? ? ? 0x01400a69 | |
? ? ? ?ub4 fdba_am[13] ? ? ? ? ? ? ? ? @2840 ? ? ? ? ? ? 0x01400a68 ? ? ? ? ? ?ub4 datadba_am[13] ? ? ? ? ? ? ?@2844 ? ? ? ? ? ? 0x01400a70 | |
? ? ? ?ub4 fdba_am[14] ? ? ? ? ? ? ? ? @2848 ? ? ? ? ? ? 0x01400a78 ? ? ? ? ? ?ub4 datadba_am[14] ? ? ? ? ? ? ?@2852 ? ? ? ? ? ? 0x01400a79 | |
? ? ? ?ub4 fdba_am[15] ? ? ? ? ? ? ? ? @2856 ? ? ? ? ? ? 0x01400a78 ? ? ? ? ? ?ub4 datadba_am[15] ? ? ? ? ? ? ?@2860 ? ? ? ? ? ? 0x01401e00 | |
? ? ? ?ub4 fdba_am[16] ? ? ? ? ? ? ? ? @2864 ? ? ? ? ? ? 0x01401e80 ? ? ? ? ? ?ub4 datadba_am[16] ? ? ? ? ? ? ?@2868 ? ? ? ? ? ? 0x01401e82 | |
? ? ? ?ub4 fdba_am[17] ? ? ? ? ? ? ? ? @2872 ? ? ? ? ? ? 0x01401f00 ? ? ? ? ? ?ub4 datadba_am[17] ? ? ? ? ? ? ?@2876 ? ? ? ? ? ? 0x01401f02 | |
? ? ? ?ub4 slbbdba1_am ? ? ? ? ? ? ? ? @5192 ? ? ? ? ? ? 0x01400a09 | Second Level Bitmap block DBAs |
六、說明
1、以上內容為個人多次測試結果,由于個人原因,如有分析不足之處還請見諒及指正。
2、文章涉及內容,請勿在生產環境模擬。
勤學如春起之苗,不見其增,日有所長;輟學如磨刀之石,不見其損,日有所虧。? --陶淵明
總結
以上是生活随笔為你收集整理的oracle 树状结构一直出现不了_深入解析Oracle ASSM 段头块(PAGETABLE SEGMENT HEADER)结构...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 海南国安海岸是哪个开发商?
- 下一篇: excel 平滑滚动_Excel怎么学