一.  Recursive Calls 说明

在执行计划的统计信息里有如下信息:

SYS@anqing2(rac2)> set autot trace statistics

SYS@anqing2(rac2)> select * from ta,tb where ta.id=tb.id and ta.id <10;

9 rows selected.

Statistics

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

5  recursive calls

0  db block gets

2081  consistent gets

0  physical reads

0  redo size

695  bytes sent via SQL*Net to client

400  bytes received via SQL*Net from client

2  SQL*Net roundtrips to/from client

1  sorts (memory)

0  sorts (disk)

9  rows processed

关于执行计划,参考我的Blog:

Oracle Explain Plan

http://blog.csdn.net/tianlesoftware/archive/2010/08/20/5827245.aspx

官网对recursive calls 的解释如下:

Recursive Calls:  Number of recursive calls generated at both the user and system level.

Oracle Database maintains tables used for internal processing. When it needs to change these tables, Oracle Database generates an internal SQL statement, which in turn generates a recursive call. In short, recursive calls are basically SQL performed on behalf of your SQL. So, if you had to parse the query, for example, you might have had to run some other queries to get data dictionary information. These would be recursive calls. Space management, security checks, calling PL/SQL from SQL—all incur recursive SQL calls。

MOS 上的说明

Sometimes to execute a SQL statement issued by a user, Oracle must issue additional statements. Such statements are called 'recursive calls' or 'recursive SQL statements'.  For example, if you insert a row into a table that does not have enough space to hold that row, Oracle makes recursive calls to allocate the space dynamically.

Recursive calls are also generated when data dictionary information is not available in the data dictionary cache and must be retrieved from disk. If recursive calls occur while the SQL trace facility is enabled, TKPROF produces statistics for the recursive SQL statements and clearly marks them as recursive SQL statements in the output file.

Note that the statistics for a recursive SQL statement are included in the listing for that statement, not in the listing for the SQL statement that caused the recursive call. So when you are calculating the total resources required to process a SQL statement, you should consider the statistics for that statement as well as those for recursive calls caused by that statement.

IBM 的一篇文档上说明如下:

http://publib.boulder.ibm.com/tividd/td/ITMD/SC23-4724-00/en_US/HTML/oraclepac510rg59.htm

Monitors the following information:

1.Recursive Calls -- The number of recursive calls since the instance was created

2.User Calls -- The number of user calls since the instance was created

3.Recursive Call Rate (Interval) -- The number of new recursive calls per second

4.Recursive To User Call Ratio -- The number of recursive calls compared to the number of user calls

A user call is an SQL statement that is executed at the request of the user.

A recursive call occurs when one SQL statement requires the execution of a further separate SQL statement. A continued increase in the reported figure indicates poor or decreasing system performance. Some recursive activity is unavoidable.

Recursive calls can be generated by the following activities:

(1)An object requiring an additional extent for storage (dynamic extension)

(2)Misses on the dictionary cache

(3)Firing of database triggers

(4)DDL statements

(5)Execution of SQL statements within stored procedures, packages, functions, and anonymous PL/SQL blocks

(6)Enforcement of referential integrity constraints

If Oracle is making an inordinate number of recursive calls, try to determine which of the previously listed activities is causing most of the recursive calls. Run the application through TKPROF with EXPLAIN PLAN to see what the application is doing.

Also, monitor the number of extents in the database to see if there is noticeable dynamic extension. If the recursive calls are caused by dynamic extension, you can reduce the number of calls by allocating larger extents to the relevant objects. A dictionary cache that is too small can also cause recursive calls.

总结一下:

当执行一条SQL语句时,产生的对其他SQL语句的调用,这些额外的语句称之为''recursive calls''或''recursive SQL statements''.

在IBM 的那片文档里讲了触发Recursive Call的6种情况:  

如:

(1)我们做一条insert 时,没有足够的空间来保存row记录,Oracle 通过Recursive Call 来动态的分配空间。

(2)执行DDL语句时,ORACLE总是隐含的发出一些recursive SQL语句,来修改数据字典信息,以便成功的执行该DDL语句。

(3)当Shared Pool过小,data dictionary cache 也会相应的过小,没有足够的空间存储ORACLE的系统数据字典信息时,会发生Recursive calls,这些Recursive calls会将数据字典信息从硬盘读入内存中。

(4)存储过程、触发器内如果有SQL调用的话,也会产生recursive SQL。

Oracle Shared pool 详解

http://blog.csdn.net/tianlesoftware/archive/2011/06/22/6560956.aspx

在这些情况中,主要是对数据字典的查询,通常发生在第一次执行时,第二次执行一般可显著降低。递归需要消耗大量的资源,如果操作复杂,很容易出现问题!

二.  Recursive Calls 的测试

在上面的说明提到数据字典查询,如果Data dictionary cache 过小,没有足够的空间来存放数据字典信息时,就会发生Recursive Calls,此时ORACLE会从硬盘读取数据字典信息,来完成相关的查询工作。

在这种情况下,可以将recursive calls理解为从磁盘读取数据字典的次数。

SYS@anqing2(rac2)> set autot trace stat

SYS@anqing2(rac2)> select * from dba_objects;

50256 rows selected.

Statistics

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

8  recursive calls

0  db block gets

8826  consistent gets

0  physical reads

0  redo size

2541097  bytes sent via SQL*Net to client

37250  bytes received via SQL*Net from client

3352  SQL*Net roundtrips to/from client

0  sorts (memory)

0  sorts (disk)

50256  rows processed

SYS@anqing2(rac2)> select * from dba_objects;

50256 rows selected.

Statistics

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

0  recursive calls

0  db block gets

8824  consistent gets

0  physical reads

0  redo size

2541097  bytes sent via SQL*Net to client

37250  bytes received via SQL*Net from client

3352  SQL*Net roundtrips to/from client

0  sorts (memory)

0  sorts (disk)

50256  rows processed

在第一次查询dba_objects时,产生了8次recursive Call,第二次查询的时候,因为数据字典的信息信息已经放在cache里,所以第二次的recursive call 为0. 如果第二次也没有完全cache,那么也是会产生recursive call,但次数比第一次少。

查看 data dictionary cache 的命中率:

SYS@anqing2(rac2)> select sum(gets),sum(getmisses),(1-(sum(getmisses)/(sum(gets)+sum(getmisses)))) hitratio from v$rowcache;

SUM(GETS)  SUM(GETMISSES)    HITRATIO

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

2475550     14453    .994195589

查看data dictionary cache 的大小:

SYS@anqing2(rac2)> select sum(sharable_mem) from v$sqlarea;

SUM(SHARABLE_MEM)

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

17399859

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

Blog: http://blog.csdn.net/tianlesoftware

Email: dvd.dba@gmail.com

DBA1 群:62697716(满);   DBA2 群:62697977(满)   DBA3 群:62697850(满)

DBA 超级群:63306533(满);  DBA4 群: 83829929  DBA5群: 142216823

DBA6 群:158654907  聊天 群:40132017   聊天2群:69087192

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

转载于:https://www.cnblogs.com/spring3mvc/archive/2011/06/22/2414597.html

Oracle Recursive Calls 说明相关推荐

  1. 对recursive calls的深刻理解

    这篇文章<这条SQL的索引,你会如何创建?>发出后,不少朋友留言,包括一些前辈,指出了其中存在的问题,需要纠正和说明. 问题1,部分截图中有递归调用,这样算一致性读,不准确? SQL执行计 ...

  2. Oracle 执行计划(Explain Plan)

    执行计划:一条查询语句在ORACLE中的执行过程或访问路径的描述.即就是对一个查询任务,做出一份怎样去完成任务的详细方案. 如果要分析某条SQL的性能问题,通常我们要先看SQL的执行计划,看看SQL的 ...

  3. Oracle SQL优化 总结(大师级别)

    SQL 的优化主要涉及几个方面: (1)    相关的统计信息缺失或者不准确 (2)    索引问题 (3)    SQL 的本身的效率问题,比如使用绑定变量,批量DML 采用bulk等,这个就考验写 ...

  4. Oracle中Hint深入理解(原创)

    http://czmmiao.iteye.com/blog/1478465 Hint概述  基于代价的优化器是很聪明的,在绝大多数情况下它会选择正确的优化器,减轻了DBA的负担.但有时它也聪明反被聪明 ...

  5. oracle取得表中总记录数最快的方法

    查询表中的记录总数的语法就是SELECT COUNT(*) FROM TABLE_NAME.这可能是最经常使用的一类SQL语句. 本文讨论怎样才能最快的得到这个记录数.本文纯粹主要是理论上的讨论,文章 ...

  6. ORACLE执行计划的一些基本概念

    本文介绍了ORACLE执行计划的一些基本概念,供学习应用. 一.相关的概念 Rowid的概念:rowid是一个伪列,既然是伪列,那么这个列就不是用户定义,而是系统自己给加上的.对每个表都有一个rowi ...

  7. Oracle查看SQL执行计划的方式

    Oracle查看SQL执行计划的方式 获取Oracle sql执行计划并查看执行计划,是掌握和判断数据库性能的基本技巧.下面案例介绍了多种查看sql执行计划的方式: 基本有以下几种方式: 1.通过sq ...

  8. Oracle技术之和分区表相关的一点总结(三)

    2.跨分区访问,依然是分区表的性能好,因为数据集中在了2个分区中,还是比访问 t1要少访问数据... SQL> select * from t1 where object_id<4000; ...

  9. mysql补丁如何安装_神技_如何快捷下载Oracle补丁的方法?!

    [引言]如何下载到Oracle系列产品的最新补丁,本文将讲解一种简洁快捷的方法,可谓粗暴直接.大家都知道Oracle官方发布补丁的频度为每三个月,最近一次的补丁集已经在2020年的7月份进行发布,后续 ...

  10. Oracle分页查询语句(六)

    Oracle的分页查询语句基本上可以按照本文给出的格式来进行套用. Oracle分页查询语句(一):http://yangtingkun.itpub.net/post/468/100278 Oracl ...

最新文章

  1. 备忘: VC++ 自动适用编译两种模式库文件 (DLL, LIB)
  2. tensorflow.python.framework.errors_impl.DataLossError:
  3. 20162304 实验三
  4. html判断安装没安装qq,QQ6.1体验版怎么用?腾讯QQ6.1体验版本安装步骤(无须申请体验账号)...
  5. linux 进程 读写锁,linux 下实现高性能读写锁(read/write lock)
  6. 作者:胡卫生(1964-),男,博士,上海交通大学教授、博士生导师,主要研究方向为下一代光接入网、光交换、光网络等。...
  7. npm 下载 依赖包时出错的解决方式
  8. 深度学习 Deep Learning UFLDL 最新Tutorial 学习笔记 4:Debugging: Gradient Checking
  9. PHP------继承、多态
  10. 《图像处理实例》 之 寻找山脊线
  11. Oracle数据库性能优化的艺术pdf
  12. linux查看cpu核数命令,Linux系統下如何查看CPU型號、核心數量、頻率和溫度?
  13. ubuntu win10 双系统 卸载ubuntu
  14. 1688接口,item_search_seller - 搜索店铺列表
  15. js中this指向的三种情况
  16. 被指开除高级研究员,谷歌大神Jeff Dean回应:是她说不答应条件就离职
  17. 令人拍案叫绝的Wasserstein GAN 及代码(WGAN两篇论文的中文详细介绍)
  18. latex如何设置字体并加粗_LaTex中文字体加粗的问题
  19. 【机房重构】C#子窗体关闭父窗体
  20. 四川夏季避暑好去处,十大清凉景点大推荐哦~

热门文章

  1. 阶段3 2.Spring_08.面向切面编程 AOP_10 总结和作业安排
  2. 从数据库查询数据并输出到前台页面
  3. Django(五):视图和路由系统
  4. MQ_ActiveMQ环境部署+C#推送和接收消息
  5. AfxMessageBox详细使用说明
  6. 【求最大公共子串长度】
  7. Mysql insert without auto-increase when duplicate
  8. [leetcode]Insert Interval
  9. SUBSTRING_INDEX
  10. 从头开始学做 canvas 动画引擎