DDL每次运行将必须是难以解决。

SQL 解析过程

Oracle对此SQL将进行几个步骤的处理过程:

1、语法检查(syntax check): 检查此sql的拼写是否语法。

2、语义检查(semantic check): 诸如检查sql语句中的訪问对象是否存在及该用户是否具备对应的权限。

3、对sql语句进行解析(prase): 利用内部算法对sql进行解析,生成解析树(parse tree)及运行计划(execution plan)。

4、运行sql,返回结果(execute and return)

5个运行步骤:

1:语法分析

2:权限与对象检查

3: 在共享池中检查是否有全然同样的之前全然解析好的. 假设存在,直接跳过4和5,执行Sql, 此时算soft parse.

4:选择运行计划

5:产生运行计划

3的解释:

Oracle将会对传递进来的SQL语句使用HASH函数运算得出HASH值,再与共享池中现有语句的HASH值进行比較看是否一一相应。现有数据库中SQL语句的HASH值我们能够通过訪问v$sql、v$sqlarea、v$sqltext等数据字典中的HASH_VALUE列查询得出。

假设SQL语句的HASH值一致,那么ORACLE其实还须要对SQL语句的语义进行再次检測。以决定是否一致。那么为什么Oracle须要再次对语句文本进行检測呢?不是SQL语句的HASH值已经相应上了?其实就算是SQL语句的HASH值已经相应上了,并不能说明这两条SQL语句就已经能够共享了。

Dictionary Cache

The data dictionary is a collection of database tables and views containing reference
information about the database, its structures, and its users. Oracle accesses the data dictionary frequently during SQL statement parsing. This access is essential to the continuing operation of Oracle.

The data dictionary is accessed so often by Oracle that two special locations in memory are designated to hold dictionary data. One area is called the data
dictionary cache, also known as the row
cache because it holds data as rows instead of buffers (which hold entire blocks of data). The other area in memory to hold dictionary
data is the library cache. All Oracle user processes share these two caches for access to data dictionary information.

Parsing

Parsing is one stage in the processing of a SQL statement. When an application issues a SQL
statement, the application makes a parse call to Oracle. During the parse call, Oracle:

  • Checks the statement for syntactic and semantic validity

  • Determines whether the process issuing the statement has privileges to run it

  • Allocates a private SQL area for the statement

Oracle also determines whether there is an existing shared SQL area containing the parsed representation of the statement in the library cache. If so, the user process uses this parsed representation and runs the statement immediately. If not, Oracle generates
the parsed representation of the statement, and the user process allocates a shared SQL area for the statement in the library cache and stores its parsed representation there.

Note the difference between an application making a parse call for a SQL statement and Oracle actually parsing the statement. A parse
call by theapplication associates a SQL statement with a private SQL area. After a statement has been associated with a private SQL area, it can be run repeatedly without your application making a parse
call. A parse operation by Oracle allocates a shared SQL area for a SQL statement. Once a shared SQL area has been allocated for a statement, it can be run repeatedly without being reparsed.

Both parse calls and parsing can be expensive relative to execution, so perform them as seldom as possible.

版权声明:本文博客原创文章。博客,未经同意,不得转载。

Hard Parse&Soft Parse的更多相关文章

  1. PLSQL_性能优化系列06_Oracle Soft Parse / Hard Parse软硬解析

    2014-08-11 Createed By BaoXinjian

  2. AWR报告中Parse CPU to Parse Elapsd%的理解

    AWR报告中Parse CPU to Parse Elapsd%的理解   原文自:http://dbua.iteye.com/blog/827243   Parse CPU to Parse Ela ...

  3. AWR报告-数据库概要信息(一)

    Elapse time为两个Snap时间间隔,相当于取样时间差 DB Time : db time= cpu time + wait time(不包含空闲等待)(非后台进程)  说白了就是db tim ...

  4. 如何读懂 STATSPACK 报告 (转) & Toad 结合

    可与 toad 相结合的内容, 用 这种颜色可以利用 toad(database->monitor->server statistics)查看到下边的很多信息, 比如 wait event ...

  5. AWR分析。(shared_pool,sga_size大小设置)

    Execute to Parse 指标反映了执行解析比 其公式为 1-(parse/execute) , 目标为100% 及接近于只 执行而不解析 在oracle中解析往往是执行的先提工作,但是通过游 ...

  6. Oracle的硬解析和软解析

    提到软解析(soft prase)和硬解析(hard prase),就不能不说一下Oracle对sql的处理过程.当你发出一条sql语句交付Oracle,在执行和获取结果前,Oracle对此sql将进 ...

  7. Oracle AWR报告指标全解析-11011552

    1-5 Top 5 Timed EventsWaits : 该等待事件发生的次数, 对于DB CPU此项不可用Times : 该等待事件消耗的总计时间,单位为秒, 对于DB CPU 而言是前台进程所消 ...

  8. AWR報告詳解

    AWR是Oracle  10g 版本 推出的新特性, 全称叫Automatic Workload Repository-自动负载信息库, AWR 是通过对比两次快照(snapshot)收集到的统计信息 ...

  9. Oracle Tuning (Oracle 性能调整)的一些总结

    Oracle Tuning (Oracle 性能调整)的一些总结 Oracle Tuning (Oracle 性能调整)的一些总结关于Oracle的性能调整,一般包括两个方面,一是指Oracle数据库 ...

随机推荐

  1. 【Linux】lvm基础操作

    新增两块硬盘,来进行实验: [root@jp ~]# fdisk -l Disk /dev/sda: 107.3 GB, 107374182400 bytes 255 heads, 63 sector ...

  2. directx11编程中遇到的错误及解决方法

    (2016-05-10)xnamath.h 报错: 在标识符"XMConvertToRadians"的前面 报错如下: >d:\program files\microsoft ...

  3. 【OpenCV新手教程之十八】OpenCV仿射变换 & SURF特征点描写叙述合辑

    本系列文章由@浅墨_毛星云 出品,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/details/33320997 作者:毛星云(浅墨)  ...

  4. URAL - 1966 - Cycling Roads(并检查集合 + 判刑线相交)

    意甲冠军:n 积分,m 边缘(1 ≤ m < n ≤ 200),问:是否所有的点连接(两个边相交.该 4 点连接). 主题链接:http://acm.timus.ru/problem.aspx? ...

  5. 如何设置ubuntu自己主动的睡眠时间

    我相信很多在学习linux的过程中.总会遇到,不时系统会冬眠自己主动,因此,即使再次输入password.么重要的内容怕别人看 另外假设你常常使用像Putty这样子的远程登录软件的话,假设你的linu ...

  6. KindEditor参数具体解释

    width 编辑器的宽度.能够设置px或%.比textarea输入框样式表宽度优先度高. 数据类型: String 默认值: textarea输入框的宽度 演示样例: K.create('#id',  ...

  7. 基于android 社会的app短信分享 发送回调事件的实现

    摘要 前一段时间.由于项目的需要,采用ShareSDK该共享功能.其中包含 短信股吧.和呼叫系统,以分享要与成功处理服务器交互的消息后,(我不在乎在这里,收到.仅仅关心发出去了).可是ShareSDk ...

  8. 一个demo

    package com.entity; /*2015-7-18*/ public class Rover { private CurrentPosition position; public Rove ...

  9. VOJ 1067 Warcraft III 守望者的烦恼 (矩阵高速功率+dp)

    主题链接 明显的 dp[n] = dp[n-k] + dp[n-k+1] + ... +dp[n-1]; 然后要用矩阵来优化后面的状态转移. 也就是矩阵 0 1 0 0    a     b 0 0 ...

  10. 新RSS reader

    阅读之前采取正确的方法,但是非常不介意,没有收到订阅很大. 走到今天 http://www.feedspot.com 2014/11/8追加:用下来感觉不错. feedspot 的相关快捷键例如以下: ...