zoukankan      html  css  js  c++  java
  • dump 叶子节点

    Dump 叶子节点:
    
    ----- begin tree dump
    branch: 0x1031b23 16980771 (0: nrow: 106, level: 2)
       branch: 0x10556b0 17127088 (-1: nrow: 414, level: 1)
          leaf: 0x1031b24 16980772 (-1: nrow: 363 rrow: 363)
    	  
    0x1031b24 16进制转换为10机制  16980772
    
    对其运用前面所介绍过的dbms_utility里的存储过程获得其文件号和数据块号,并对该数据块进行转储,其内容如下所示。可以
    
    
    select dbms_utility.data_block_address_file(16980772), dbms_utility.data_block_address_block(16980772) from dual;
    
    SQL> select dbms_utility.data_block_address_file(16980772), dbms_utility.data_block_address_block(16980772) from dual;
    
    DBMS_UTILITY.DATA_BLOCK_ADDRESS_FILE(16980772) DBMS_UTILITY.DATA_BLOCK_ADDRESS_BLOCK(16980772)
    ---------------------------------------------- -----------------------------------------------
    					     4						203556
    						 
    select value from v$diag_info where name='Default Trace File';
    
    SQL> alter system dump datafile 4 block 203556;
    
    
    Leaf block dump
    ===============
    header address 140494383000164=0x7fc765caaa64
    kdxcolev 0
    KDXCOLEV Flags = - - -
    kdxcolok 0
    kdxcoopc 0x80: opcode=0: iot flags=--- is converted=Y
    kdxconco 2
    kdxcosdc 0
    kdxconro 363
    kdxcofbo 762=0x2fa
    kdxcofeo 1498=0x5da
    kdxcoavs 736
    kdxlespl 0
    kdxlende 0
    kdxlenxt 16980773=0x1031b25
    kdxleprv 0=0x0
    kdxledsz 0
    kdxlebksz 8032
    row#0[8014] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20  --199
    col 1; len 6; (6):  01 03 ad 6e 00 96
    row#1[7996] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20   --199
    col 1; len 6; (6):  01 03 ad 6e 00 97
    row#2[7978] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 04 11 54 00 92
    row#3[7960] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 04 11 83 00 8c
    row#4[7942] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 04 8c a0 00 7e
    row#5[7924] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 04 8c a0 00 7f
    row#6[7906] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 05 4b 28 00 68
    row#7[7888] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 05 54 bf 00 7a
    row#8[1534] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 05 54 bf 00 7b
    row#9[1552] flag: ------, lock: 0, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 05 54 bf 00 7c
    row#10[1516] flag: ------, lock: 2, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 05 54 bf 00 7d
    row#11[1498] flag: ------, lock: 2, len=18
    col 0; len 8; (8):  31 39 39 20 20 20 20 20
    col 1; len 6; (6):  01 05 54 bf 00 7e
    
    
    
    DECLARE
      n VARCHAR2(2000);
    BEGIN
      DBMS_STATS.convert_raw_value('35', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('30', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('30', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('30', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('31', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('20', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('20', n);
      DBMS_OUTPUT.put_line(n);
      DBMS_STATS.convert_raw_value('20', n);
      DBMS_OUTPUT.put_line(n);
    
    END;
    
    col 0; len 8; (8):  31 39 39 20 20 20 20 20  --199
    
    ol 1是rowid,01 00 0c 8f 00 00是rowid的一部分值,也是16进制的.,先要转换成2进制的,
    
    
    col 1; len 6; (6):  01 03 ad 6e 00 96
    
    00000001  00000011  10101101  01101110  00000000  10010110
    
    16进制转换为2进制先转换为2进制:(注意前面先补足0)
    
    
    然后串起来之后前10位 0000000100 表示文件号,=4 2进制转换为10进制表示4
    
    
    然后是接下来的22位 0000111010110101101110表示块号,2机制转换为10进制 241006
    
    
    最后面的的16位表示行号0000000010010110 2机制转换为10进制   150
    
    
     SQL> select owner, segment_name, segment_type
      2    from dba_extents
      3   where file_id = 4
      4     and 241006 between block_id and block_id + blocks - 1;
      
    OWNER                          SEGMENT_NAME                                                                     SEGMENT_TYPE
    ------------------------------ -------------------------------------------------------------------------------- ------------------
    TEST                           TEST                                                                             TABLE
    
    SQL> 
    
    
    SQL> select rowid,a.* from test a where a.goodid='199';
    ROWID                                                                            GOODID   OBJECT_NAME
    -------------------------------------------------------------------------------- -------- --------------------------------------------------------------------------------
    AAAVvMAAEAAA61uACW                                                               199      aaa
    AAAVvMAAEAAA61uACX                                                               199      aaa
    AAAVvMAAEAABBFUACS                                                               199      aaa
    AAAVvMAAEAABBGDACM                                                               199      aaa
    AAAVvMAAEAABIygAB+                                                               199      aaa
    AAAVvMAAEAABIygAB/                                                               199      aaa
    AAAVvMAAEAABUsoABo                                                               199      aaa
    AAAVvMAAEAABVS/AB6                                                               199      aaa
    AAAVvMAAEAABVS/AB7                                                               199      aaa
    AAAVvMAAEAABVS/AB8                                                               199      aaa
    AAAVvMAAEAABVS/AB9                                                               199      aaa
    AAAVvMAAEAABVS/AB+                                                               199      aaa
    12 rows selected
    
    SQL> 
    
    
    SQL> select
      2         dbms_rowid.rowid_relative_fno('AAAVvMAAEAAA61uACW') fno,
      3         dbms_rowid.rowid_block_number('AAAVvMAAEAAA61uACW') bkno,
      4         dbms_rowid.rowid_row_number('AAAVvMAAEAAA61uACW') rno
      5  from dual
      6  ;
           FNO       BKNO        RNO
    ---------- ---------- ----------
             4     241006        150
  • 相关阅读:
    java基础
    mysql入门
    基础整理
    遍历列表的两种方式
    oracle常用操作
    DIV+CSS网页布局技巧实例1:设置网页整体居中的代码
    html+css 淘宝首页静态页面案例
    WEB前端开发规范文档+CSS命名规范
    day05-苏宁易购导航html
    day04-html
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13348379.html
Copyright © 2011-2022 走看看