执行计划中的参数解释

执行计划中的各个参数解释:

一、Recursive calls (递归调用)

1、参考:Oracle Database Reference, 10g Release 2 (10.2).pdf第916页

      Number of recursive calls generated at both the user and system level. Oracle maintains tables used for internal processing. When Oracle needs to make a change to these tables, it internally generates an internal SQL statement, which in turn generates a recursive call。

    在用户和在系统级别,都会生成recursive calls,Oracle维护了一些表用于内部的处理(数据字典)。当Oracle需要对这些表进行修改的时候,在Oracle内部生成了一些SQL语句,将会产生 recursive call

2、参考:Oracle Database Performance Tuning Guide, 11g Release 1 (11.1).pdf第470页

      Sometimes, in order 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, then 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, then TKPROF produces statistics for the recursive SQL statements and marks them clearly as recursive SQL statements in the output file. You can suppress the listing of Oracle internal recursive calls (for example, space management) in the output file by setting the SYS command-line parameter to NO. 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, consider the statistics for that statement as well as those for recursive calls caused by that statement

      为了执行一个用户发出的SQL语句,Oracle必须发出一些额外的SQL语句,这些语句称为recursive calls,例如,当你向一个表插入一行数据的时候,这个表没有多于的空间来存储这一行数据,Oracle就会产生 recursive calls来动态的分配存储空间,Recursive calls在数据字典信息数据字典缓存不可用的情况下并且必须从磁盘中重新读取的情况下也会生成。

    如果在发送递归调用的时候,SQL跟踪生效的话,那么TKPROF将会对递归SQL生成统计信息,并且将它们输出到一个文件中,递归调用的语句包含在这些递归语句中,而不是引起这些递归调用的语句中,所以当统计SQL语句执行过程中消耗的资源时,也需要考虑在SQL语句执行中引起的递归调用所消耗的资源。

3、参考:http://www.cnblogs.com/chinhr/archive/2009/03/14/1412100.html

     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.

   简单的说,递归调用是自己的SQL调用的代表,当你需要解析SQL的时候,你需要调用其他的查询去获取数据字典的信息,这些就是递归调用,空间管理,安全检查,调用PL/SQL和SQL,这些都是递归调用。

4、 Beginning Oracle Database 11g Administration: From Novice to Professional-394页

        Recursive calls result from all the work that is done behind the scenes by Oracle before it can begin executing your query. When a query is submitted for execution, Oracle first checks its syntax. It then checks the semantics—that is, it de- references synonyms and views and identifies the underlying tables. It then computes the signature (a.k.a. hash value) of the query and checks its cache of query execution
plans for a reusable query plan that corresponds to that signature. If a query plan is not found, Oracle has to construct one; this results in recursive calls. The number of recursive calls required can be large if the information Oracle needs to construct the query plan is not available in the dictionary cache and has to be retrieved from the database or if there are no statistics about tables mentioned in the query and data blocks have to be sampled to generate statistics dynamically.

       递归调用是在Oracle执行查询之后开始做的。当一个查询开始执行的时候,Oracle首先检查它的语义,随后检查同义词和视图中引用到的表,计算查询语句的签名(hash值),并查询缓存中是否存在当前签名的执行计划,或者查询语句的执行计划没有发现,那么它将会创建一个,这就是递归调用,当需要创建的执行计划的一些信息在数据字典缓存中不存在,需要重数据库中读取,或者查询使用的表没有统计信息,递归调用的数量会非常的大,这时候,会进行动态的取样来生成统计信息。

二:DB block gets

     1、DB block gets is the number of times Oracle needs the latest version of a data block. Oracle does not need the latest version of a data block when the data is simply being read by the user. Instead, Oracle needs the version of the data block that was current when the query started. The latest version of a data block is typically required when the intention is to modify the data.

      DB block gets是Oracle需要获取最新版本数据所需要访问的数据块,当用户读取数据时,Oracle需要的不是最新版本的数据块的信息,而是当查询开始的时候,那个版本的数据块信息,当Oracle修改数据的时候,Oracle需要最数据块最新版本的信息。

    2、Number of times a CURRENT block was requested.  Current mode blocks are retrieved as they exist right now, not in a consistent read fashion. Normally, blocks retrieved for a query are retrieved as they existed when the query began. Current mode blocks are retrieved as they exist right now, not from a previous point in time.  During a SELECT, you might see current mode retrievals due to reading the data dictionary to find the extent information for a table to do a full scan (because you need the "right now" information, not the consistent read). During a modification, you will access the blocks in current mode in order to write to them. 
(DB Block Gets:请求的数据块在buffer能满足的个数)

    在某个时间点需要访问的数据块的数量,当前模式的数据块是从现在存在的块进行检索,而不是一致读的模式,通常,一个查询需要获取的数据块是当查询开始的时候计算,而当前模式从从现在开始的时间读取,而不是从过去的某个时间点开始读取,在一个查询中,你需要访问数据字典进行一个全表扫描获取数据字典的段信息。在修改数据的过程中,需要访问当前模式的数据来修改写入它。

DB block gets分为以下两种情况:

db block gets direct:Number of times a CURRENT block was requested bypassing the buffer cache (for example, a direct load operation). This is a subset of "db block gets" statistics value.

db block gets from cache:Number of times a CURRENT block was requested from the buffer cache. This is a subset of "db block gets" statistics value.

三:Consistent gets (a.k.a:also know as):Beginning Oracle Database 11g Administration: From Novice to Professional-412页

      Consistent gets, a.k.a. logical reads, is the number of operations to retrieve a consistent version of a data block that were performed by Oracle while constructing query plans and while executing queries. Remember that all data blocks read during the execution of any query are the versions that were current when the query started; this is called read consistency. One of the principal objectives of query tuning is to reduce the number of consistent get operations that are required.

     一致读,也叫逻辑读,是Oracle在执行查询的时候,构建查询计划访问数据块一致版本的操作,记住:Oracle获取的所以数据块都是查询开始时候的版本,这叫做读一致性,优化查询的一个原则是减少一致读的操作。

      Consistent Gets. Number of times a consistent read was requested for a block.  This is how many blocks you processed in "consistent read" mode. This will include counts of blocks read from the rollback segment in order to roll back a block.  This is the mode you read blocks in with a SELECT, for example.  Also, when you do a searched UPDATE/DELETE, you read the blocks in consistent read mode and then get the block in current mode to actually do the modification。

    一致读,Oracle一致读请求的块的数量,也就是在进行一致读模式的时候,需要处理的数据块,则需要从回滚段读取回滚的数据块。

      Number of times a user process has applied rollback entries to perform a consistent read on the block Work loads that produce a great deal of consistent changes can consume a great deal of resources. The value of this statistic should be small in relation to the "consistent gets" statistic.

     Oracle执行一致读的时候,处理的数据块的个数。

四:Physical reads

       Physical reads is the number of operations to read data blocks from the disks that were performed by Oracle because the blocks were not found in Oracle’s cache when they were required. The limit on the number of physical reads is therefore the number of consistent gets.

   物理读是指由于数据块在Oracle的缓存中未被发现,而需要从磁盘中读取的数据块的个数,物理读的个数是由一致读来限制的。

五:Redo size(重做的数量)

     Redo size is the amount of information Oracle writes to the journals that track changes to the database. This metric applies only when the data is changed in some way.

六:SQL*Net from client、SQL*Net to client

     Bytes sent via SQL*Net to client, bytes received via SQL*Net from client, and SQL*Net roundtrips to/from client are fairly self- explanatory; they track the number and size of messages sent to and from Oracle and the user

    主要是指Oracle的网络向客户端发送的数据流量的大小

七:Sorts (memory)、sorts (disk) 

     Sorts (memory) and sorts (disk) track the number of sorting operations performed by Oracle during the course of our query. Sorting operations are performed in memory if possible; they spill onto the disks if the data does not fit into Oracle’s memory buffers. It is desirable for sorting to be performed in memory because reading and writing data to and from the disks are expensive operations. 

     最好在内存中进行排序和,在磁盘中进行数据的读和写是非常昂贵的操作。

下面的内容是摘取自博客:http://www.cnblogs.com/chinhr/archive/2009/03/14/1412100.htm

 和Oracle Database Performance Tuning Guide, 11g Release 1 (11.1)的131页:

      

    Physical Reads通常是我们最关心的,如果这个值很高,说明要从磁盘请求大量的数据到Buffer Cache里,通常意味着系统里存在大量全表扫描的SQL语句,这会影响到数据库的性能,因此尽量避免语句做全表扫描,对于全表扫描的SQL语句,建议增 加相关的索引,优化SQL语句来解决。

关于physical reads ,db block gets 和consistent gets这三个参数之间有一个换算公式:

数据缓冲区的使用命中率=1 - ( physical reads / (db block gets + consistent gets) )。

在SQL语句里体现如下:

用以下语句可以查看数据缓冲区的命中率:

SQL>SELECT name, value FROM v$sysstat WHERE name IN ('db block gets', 'consistent gets','physical reads');

查询出来的结果Buffer Cache的命中率应该在90%以上,否则需要增加数据缓冲区的大小。

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

db block gets:Number of times a CURRENT block was requested.
consistent gets:Number of times a consistent read was requested for a block.
physical reads:Total number of data blocks read from disk. This number equals the value of "physical reads direct" plus all reads into buffer cache.
---------------------------------------------------------------
针对以上3个概念进行的说明解释及关系如下:
1、DB Block Gets(当前请求的块数目)
当前模式块意思就是在操作中正好提取的块数目,而不是在一致性读的情况下而产生的块数。正常的情况下,一个查询提取的块是在查询开始的那个时间点上存在的数据块,当前块是在这个时刻存在的数据块,而不是在这个时间点之前或者之后的数据块数目。
2、Consistent Gets(数据请求总数在回滚段Buffer中的数据一致性读所需要的数据块)
这里的概念是在处理你这个操作的时候需要在一致性读状态上处理多少个块,这些块产生的主要原因是因为由于在你查询的过程中,由于其他会话对数据块进行操 作,而对所要查询的块有了修改,但是由于我们的查询是在这些修改之前调用的,所以需要对回滚段中的数据块的前映像进行查询,以保证数据的一致性。这样就产 生了一致性读。
3、Physical Reads(物理读)
就是从磁盘上读取数据块的数量,其产生的主要原因是:
1、 在数据库高速缓存中不存在这些块
2、 全表扫描
3、 磁盘排序
它们三者之间的关系大致可概括为:
逻辑读指的是Oracle从内存读到的数据块数量。一般来说是'consistent gets' + 'db block gets'。当在内存中找不到所需的数据块的话就需要从磁盘中获取,于是就产生了'phsical reads'。

 

 

转载于:https://www.cnblogs.com/caroline/archive/2012/12/13/2815646.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/410649.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

java jsonobject_Java实现QQ登录

准备工作1. 云服务器2. 备案的域名3. 本地调试需要修改hosts文件,将域名映射到127.0.0.1一、申请QQ互联,并成为开发者QQ互联:QQ互联官网首页登录后,点击头像,进入认证页面,填写信息,等待审核。审…

周至四中计算机老师,周至县第四中学顺利承办周至县 “教育信息化技术与教学课堂深度融合交流研讨会”...

原标题:周至县第四中学顺利承办周至县 “教育信息化技术与教学课堂深度融合交流研讨会”5月22日,周至县 “教育信息化技术与教学课堂深度融合交流研讨会”在我校举行,周至县教科局党委书记、局长张武祥、副局长尚雷、教研室书记杨正良、电教中…

常规dll 的接口函数定义+客户端程序接口函数导入

--> blog 常规dll 的接口函数定义extern "C" __declspec(dllexport) int addcart_Click(LPCTSTR lpszInput, LPTSTR lpOutput){常规dll 的接口函数实现extern "C" __declspec(dllimport) int addcart_Click(LPCTSTR lpszInput, LPTSTR lpOutput){转载于…

bin文件怎么转换成文本文档_Python脚本4:根据txt文本,批量创建文件夹

背景:深度学习图像分类的时候,有许多的标签类。1000个标签就需要创建1000个文件夹,文件夹里面放入对应的图像。不可能一个一个右击创建文件夹,所以有了今天的脚本。根据txt文本每一行的类别,创建文件名为类别的文件夹。…

如何停止运行在服务器的项目,怎么启动和停止服务器

弹性云服务器 ECS弹性云服务器(Elastic Cloud Server)是一种可随时自助获取、可弹性伸缩的云服务器,帮助用户打造可靠、安全、灵活、高效的应用环境,确保服务持久稳定运行,提升运维效率三年低至5折,多种配置可选了解详情用户数据注…

安装应用程序时,提示以前的某个程序安装挂起的解决方法

在安装应用程序的时候出现这个问题,用下面的办法就可以解决。 打开注册表编辑器(开始->运行->regedit),在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager中找到PendingFileRenameOperat…

Pro ASP.NET 4 CMS

Pro ASP.NET 4 CMS转载于:https://www.cnblogs.com/gavinhughhu/archive/2010/07/15/1777714.html

电脑home键在哪_电脑键盘各键的名称及使用方法

电脑键盘各键的名称及使用方法如下:1. Tab键:表格键,是baiTable的缩写,中文意思是表格。在电脑中的应用主要是在文字处理软件里(如Word)起到等距离移动的作用。2、Esc键:退出键,是Escape的缩写,…

ajax加载vue数据,详解使用Vue.Js结合Jquery Ajax加载数据的两种方式

整理文档,搜刮出一个使用vue.js结合jquery ajax加载数据的两种方式的代码,稍微整理精简一下做下分享。废话不多说,直接上代码html代码demo{{message }}测试jquery加载数据{{data.name}}{{data.url}}{{data.country}}js代码/*** created by se…

程序员如何跟领导提离职_员工辞职不交接工作被领导怒怼:我不批离职,跟你耗着,结果蒙了...

阅读本文前,请您先点击上面的“蓝色字体”,再点击“关注”,这样您就可以继续免费收到文章了。每天都会有分享,都是免费订阅,请您放心关注。注:本文转载自网络,不代表本平台立场,仅供…

Silverlight 5 Beta新特性[4]文本缩进控制

持续带来Silverlight 5 Beta新特性的更新.在Silverlight 5 Beta版本对文本的处理能力做了真正的改进.其中从官方Silverlight 5 Beta Futurez中提到两个主要改善地方 翻译整理如下: Silverlight 5 Beta Text: …

编译器的2点优化

优化1 对于byte/short/char三种类型来说,如果右侧赋值的数值没有超过范围,那么javac编译器将会自动隐含地为我们补上一个(byte)(short)(char)。 如果没有超过左侧的范围,编译器补上强转。如果右侧超过了左侧范围,那么直接编译器报…

zoj 1115 Digital Roots

求各数位之和; 运用弃九法可以很快解出,但一开始没想到出入的会是字符串,WA了几次, AC代码如下 #include"iostream" #include"string" using namespace std; int main() {string str;while(cin>>str,st…

erp系统服务器都是维护些什么意思,erp系统维护服务器维护管理文档.doc

erp系统维护服务器维护管理文档ERP系统机箱及服务器管理维护文档page 4ERP系统机箱及服务器管理维护文档作者:数据技术组创建日期:2013-05-08修改日期:版本:1.0目录toc \o "1-3" 目录 PAGEREF _Toc295915832 \h 2HYPERLINK \l "编写说明" 编写说明 PAGEREF…

excel冻结窗口_excel成绩表怎么固定表头或者某一行?

当浏览成绩表时,很多人都会有这种困扰,就是好不容易找到自己的名字后,却又要往上翻看一下这个成绩对应的科目是什么,才能知道自己的各科成绩分别是多少。怎样才能固定表头或者某一行,不用来回浏览就可以轻松看到自己的…

常用的服务器系统,常用的服务器操作系统

常用的服务器操作系统 内容精选换一换云耀云服务器(Hyper Elastic Cloud Server,HECS)是可以快速搭建简单应用的新一代云服务器,具备独立、完整的操作系统和网络功能。提供快速应用部署和简易的管理能力,适用于网站搭建、开发环境等低负载应用…

Unity C#笔记 协程详解(转)

目录 什么是协程多线程协程 协程的使用场景协程使用示例Invoke的缺陷协程语法 开启协程终止协程挂起协程的执行原理什么是协程 在Unity中,协程(Coroutines)的形式是我最喜欢的功能之一,我都会使用它来控制需要定时的。 协同程序&a…

.NET编程-----------------------Web.config配置文件详解

<?xml version"1.0"?> <!--注意: 除了手动编辑此文件以外&#xff0c;您还可以使用 Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的“网站”->“Asp.Net 配置”选项。 设置和注释的完整列表在 machine.config.comments 中&#xff0c…

差异表达基因热图怎么看_多变的热图1(新手专用)

热图&#xff08;heatmap&#xff09;用不同的颜色和颜色的深浅来直观的展示数据之间的差异。在测序类的文章里&#xff0c;几乎必有一幅热图用来展示差异表达基因。很多工具都可以完成热图的制作&#xff0c;今天这篇文章主要介绍利用R语言的 pheatmap包制作热图的简单小例子。…

[html] 在两个iframe之间传递参数的方法有哪些

[html] 在两个iframe之间传递参数的方法有哪些 通过postMessage与父级通过&#xff0c;父级传递消息通过websocket通信如果是同一个域名下可用stroage&#xff0c;监听storageChange事件通信通过web worker也可通信个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识…