ITPub博客

首页 > > > 2_深入解析Oracle ASSM结构之Level 2 Bitmap Block

2_深入解析Oracle ASSM结构之Level 2 Bitmap Block

作者:orastar 时间:2020-03-03 00:58:32 0 删除 编辑

一、概念介绍


Oracle Level 2 Bitmap Block( 简称L2 ) 中存储Level 1 Bitmap Block(简称L1)的地址,L2内部结构由CacheHeader、Header Control及L1 BMB array三层结构组成,Oracle数据块类型代码为“type: 0x21=SECOND LEVEL BITMAP BLOCK”,和L3相同bbed工具同样不支持查询L2的物理结构,本节主要使用C语言解析L2物理结构。

Header Control 内容:

L2  的HeaderControl结构包含以下内容:

  • 对应父节点L3 BMB地址(简称L3);

  • 对应L1的地址;

  • 空闲空间L1数量;

  • 下一个L2地址;

  • 事务操作类型;

  • 锁操作描述;

L1 BMB array 内容:

  • L1 地址;

  • 每个块最大空闲状态;

  • 关联实例。

 

二、dump 块结构解析



alter session set tracefile_identifier='orastar_bmb2';

oradebug setmypid

alter system dump datafile 5 block 7705;

oradebug close_trace

oradebug tracefile_name

 

Cache Header :

type: 0x21 SECOND LEVEL BITMAP BLOCK 表示该块为L2数据块,

 

 

Header Control :

  • pdba:  表示父节点L3地址;

  • number:  表示L1数量;

  • Objd:  表示对象object_id;

  • nfree: Free 标志为非1的L1数量;

  • ffree: Free 标志为1的L1数量。

 


L1 BMB array :

  • L1 地址

  • 数据块的最大空闲状态:  -  1 : unformatted. -  2 : formatted &freespace between 0 and 25% -  3 : formatted &freespace between 25% and 50% -  4 : formatted &freespace between 50% and 75% -  5 : formatted &freespace between 75% and 100% -  6 : formatted &block is full

  • 关联实例:单实例为1


 

三、二进制结构



Cache Header :


 

Header Control :


 

 

L1 BMB array :


四、数据块解析



由于bbed不支持L2数据块的物理结构解析,报错信息如下所示,

BBED> set dba 5,7705

         DBA             0x01401e19(20979225 5,7705)

 

BBED> map /v

 File:/oradata/epmsn/hsql01.dbf (5)

 Block: 7705                                 Dba:0x01401e19

------------------------------------------------------------

BBED-00400: invalid blocktype (33)

使用C语言结构体解析该数据块结构,解析后的物理结构如下所示,

 

五、说明



  1、以上内容为个人多次测试结果,由于个人原因,如有分析不足之处还请见谅及指正;

  2 、文章涉及内容,请勿 在 生产 环境模拟 。


                     君子谋道不谋食。君子忧道不忧贫。  -- 《论语》

感谢您的阅读,如果您觉得有所收获,也欢迎把文章分享给您的朋友。





来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31442014/viewspace-3125898/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
作者简介:惠星星,现就职于云和恩墨,持有OCP 10g、OCP 11g、OCM 11g证书,并有长达8年电力行业业务维护、数据库维护服务经验,擅长Oracle数据库性能优化、故障处理及Oracle internal研究。

注册时间:2017-03-08

  • 博文量
    171
  • 访问量
    429741