10200(consistent read buffer status)内部诊断事件可以用于探测一致性读CR(consistent read)块的访问情况,虽然cr读的统计信息可以从v$sysstat或AWR/statspack中获取,但是10200 event还是我们研究Consistent Read一致性读的有力工具。该事件可以通过在会话session级别设置ALTER SESSION SET EVENTS 或 DBMS_SYSTEM.SET_EV. Set 来开启,一般调用级别为Level 10。 该事件返回的trace跟踪文件,记录了为了实现一致性读的目的,哪些数据块以及这些块的各历史版本在执行过程中被创建(CR block creation)并检验(CR block inspection),以找出Best CR block满足Consistent一致性。 注意10200 Internal Event主要是被ktrgtc和ktrget(call ktrget to get one block ->calling KTR layer to apply RBS to have consistent read Block;)这2个Oracle内核功能函数触发,这2个内部函数Internal Function的主要作用: ktrget:

  • Initializes a buffer cache CR scan request
  • Calls kcbgtcr for the best resident buffer to start from to build the CR buffer
  • Calls ktrgcm to build the CR buffer by applying undo
  • Returns CR buffer to the requestor

kcbgtcr:

  • If successful, returns the “best” candidate (performed by ktrexf or examination function)
  • Scans the hash bucket for the DBA for buffers that may be used to build a CR buffer
  • If not successful, calls kcbget

10200 event trace example:

[oracle@rh2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 30 21:23:47 2011Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionSQL> select * from global_name;GLOBAL_NAME
--------------------------------------------------------------------------------
www.oracledatabase12g.com & www.askmaclean.comSQL> create table tv(t1 int);Table created.SQL> alter session set events '10200 trace name context forever,level 10';Session altered.SQL> select * from tv;T1
----------110200 traceConsistent read started for block 0 : 0040081aenv: (scn: 0x0000.000cf852 xid: 0x0000.000.00000000 uba: 0x00000000.0000.00  statement num=0parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 8sch: scn: 0x0000.00000000)CR exa ret 2 on: 0x600139d0  scn: 0xffff.ffffffff  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00scn: 0xffff.ffffffff  sfl: 0Consistent read finished for block 0 : 40081aConsistent read started for block 0 : 0040e508env: (scn: 0x0000.000cf852  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00  statement num=0
parent xid: xid: 0x0000.000.00000000  scn: 0x0000.00000000 8sch: scn:0x0000.00000000)
Consistent read finished for block 0 : 40e508

以上trace中各代码的含义如下: Consistent read started for block 0 : 0040081a 0 -> tablespace number 0040081a -> DBA   env: (scn: 0x0000.000cf852 xid: 0x0000.000.00000000 uba: 0x00000000.0000.00 以上为环境/会话信息,这个scn是env_scn ,一般就是数据库的current_scn   SFL :0  -> SFL 为 Snapshot Flag   CR exa ret 2 -> 此处的ret为reture code返回代码,是ktrgtc/ktrget函数的返回码   以下为ktrgtc/ktrget函数部分可能返回代码的含义:

#define KCBRSTOP (8|0) /* return this one now */ #define KCBRSAVE (8|1) /* save this one and continue */ #define KCBRSKIP (0|1) /* skip over this one and continue */ #define KCBRQUIT (0|2) /* chuck all, return nothing and stop */ #define KCBRLAST (0|3) /* quit if read from disk else skip */

10200诊断事件在11g中得到了加强,通过该event我们可以获得更多有用的trace信息了:

SQL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - ProductionSQL> select * from global_name;GLOBAL_NAME
--------------------------------------------------------------------------------
MACLEANSQL> alter session set events '10200 trace name context forever, level 10';Session altered.SQL> select * from tv;T1
----------1SQL> oradebug setmypid;
Statement processed.SQL> oradebug tracefile_name;
/s01/orabase/diag/rdbms/vprod/VPROD1/trace/VPROD1_ora_28365.trctrace contentktrget2(): started for block   objd: 0x000040e1
env [0x2b54cde2a704]: (scn: 0x0000.0026b064  xid: 0x0000.000.00000000  uba: 0x00000000.0000.00
statement num=0  parent xid: 0x0000.000.00000000  st-scn: 0x0000.00000000  hi-scn: 0x0000.00000000
ma-scn: 0x0000.0026b053  flg: 0x00000660)
ktrexf(): returning 9 on:  0xbb132d0  cr-scn: 0xffff.ffffffff  xid: 0x0000.000.00000000
uba: 0x00000000.0000.00  cl-scn: 0xffff.ffffffff  sfl: 0
ktrgcm(): completed for block   objd: 0x000040e1
ktrget3(): completed for  block  objd: 0x000040e1

转载于:https://www.cnblogs.com/macleanoracle/archive/2013/03/19/2968024.html

Oracle Internal Event:10200 Consistent Read诊断事件相关推荐

  1. Oracle Internal Event:10235 Heap Checking诊断事件

    10235 (check memory manager internal structures) event内部诊断事件,当oracle SGA内存堆heap 管理操作发生错误时会触发该检测事件(Fo ...

  2. oracle诊断,Oracle 诊断事件列表

    Oracle 诊断事件列表 (2013-03-26 18:05:26) 标签: oracle 诊断事件 it ORA-10000: controlfile debug event, name 'con ...

  3. oracle限定词,ORACLE诊断事件

    ORACLE诊断事件 Oracle为RDBMS提供了多种的诊断工具,诊断事件 (Event)是其中一种常用.好用的方法,它使DBA可以方便的转储数据库各种结构及跟踪特定事件的发生. 一.Event的通 ...

  4. oracle 10092,Oracle诊断事件列表

    经常有人问,有哪些诊断事件,各是什么含义,怎样使用? 这些问题问得太多太多,没有过多的说明,实际上也不需要太多的说明. 我们可以通过以下代码查询得到Oracle的诊断事件及说明,通过这些,我想就足够了 ...

  5. oracle 性能优化 07_诊断事件

    2019独角兽企业重金招聘Python工程师标准>>> 一.诊断事件     诊断事件无官方技术文档支持,使用存在风险,慎用.使用诊断事件可以获取问题更多的信息,调整系统运行 特性, ...

  6. oracle解析失败事件,ORACLE诊断事件及深入解析10053事件

    [IT168 技术文章] Oracle 为RDBMS 提供了多种的诊断工具,诊断事件(Event)是其中一种常用.好用的方法,它使DBA 可以方便的转储数据库各种结构及跟踪特定事件的发生. 一.Eve ...

  7. Oracle常用诊断事件清单

    Ask Maclean Liu Oracle>正文 Oracle常用诊断事件清单 原创maclean_0072008-06-30 12:17:04评论(0)63人阅读 事件 说明 例子 Even ...

  8. AUTOSAR从入门到精通100讲(三十三)-AutoSar架构中的诊断事件管理

    Dem在AutoSar架构中的角色和位置 Dem(Diagnostic Event Manager)诊断事件管理,属于Autosar BSW(Basic Software)中的系统服务,在整个架构中所 ...

  9. oracle internal_function,Oracle Internal Research内部原理研究

    Database Replay是11g中很酷的特性,对于workload capture的内部工作原理大家理解的不多,这里就介绍一下. 对于Workload Capture需要考虑的因素: 负载捕获文 ...

最新文章

  1. 如何制作网线标签和贴标签
  2. Xamarin IOS – hello word
  3. java 自定义注解获取_Java自定义注解
  4. WebSocket简单使用
  5. Intel 64/x86_64/IA-32/x86处理器 - 指令格式(1) - 概述
  6. python报告水印怎么弄_超简单Python安全批量打水印教程!
  7. AngularJS中的DOM value与view value
  8. 成功绩效评估面谈的八个步骤
  9. 计算机网络管理员高级操作技能考核试卷,计算机网络管理员(高级)操作技能试题样题(2)...
  10. 【5G核心网】PFCP Message PFCP 消息
  11. 跟我学AngularJs:Directive指令用法解读(上)
  12. 训练过程出现trian_dice一直大于1(mask范围0-255转为0-1)
  13. 动物识别——人工智能
  14. 2021牛客寒假算法基础集训营4 F. 魏迟燕的自走棋
  15. adb ps shell 查看进程_adb中ps命令的详解
  16. 总结numpy中的ndarray,非常齐全
  17. iOS越狱插件: Icon Tool 可定位文件目录和备份资料等功能
  18. 4.绝对值不等式(模板)
  19. 万里长征第一步——Hello World
  20. oracle 定时任务删除数据

热门文章

  1. Android开发中调用系统窗口的方法
  2. zoj 3811 untrusted patrol
  3. 关于ecshop中jquery与js冲突解决的方案
  4. Dijkstra 计算两地间的最短距离
  5. conda 安装mysql_centos7安装mysql
  6. java虚拟机常用命令工具
  7. MySQL 高水位update_Oracle delete 高水位线处理问题
  8. 【APICloud系列|22】 videoPlayer模块(视频播放)的实现
  9. 一文精通CSS文本问题,你值得一看
  10. Bash脚本教程之脚本入门