产生library cache latch原因
The library cache latches protect the cached SQL statements and objects' definitions held
in the library cache within the shared pool. The library cache latch must be acquired
in order to add a new statement to the library cache. During a parse, Oracle searches
the library cache for a matching statement. If one is not found, then Oracle will parse
the SQL statement, obtain the library cache latch and insert the new SQL.

可能导致library cache latch contention
When you have unnecessary versions of a cursor, each time that cursor is executed,
the parse engine has to search through the list of versions to see which is the cursor that you want.
This wastes CPU cycles that you could be using on something else.

High version counts can easily cause high contention for library cache latches.
A process parsing a SQL statement with many versions (children cursors) will need to scan
through all these children while holding on to a library cache latch.
This means that other processes needing the same latch will have to wait and

每一个sql被执行之前,先要到library cache中根据hash_value查找parent cursor,这就需要先获得library cache latch;找到parent cursor后,就会去查找对应的child cursor,当发现无法找到时,就会释放library cache latch,获得share pool latch分配空间给硬解析后的产生的执行计划;
然后再次获得library cache latch进行把执行计划放入share pool,转入library cache pin+lock(null模式)开始执行sql.library cache latch 的个数有限(与CPU_COUNT参数相关),当数据库中出现大量硬解析的时候,某一个sql无法得到library cache latch就会开始spin,达到spin count后还没得到,
就会开始sleep,达到sleep时间后,醒来还再次试图过的library cache latch得不到就在spin再得不到又sleep…依此类推.
综上可知:在sql执行的过程中可以看出在出现High Versions Count和Hard Parse的情况下都有可能出现library cache latch等待.
关于Hard Parse见:shared pool latch 等待事件
关于High Versions Count见:关于High Versions Count总结

转载 http://www.xifenfei.com/3151.html

产生library cache latch原因的更多相关文章

  1. [转载】——故障排除:Shared Pool优化和Library Cache Latch冲突优化 (文档 ID 1523934.1)

    原文链接:https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=23w4l35u5_4&id=152393 ...

  2. [20190319]shared pool latch与library cache latch的简单探究.txt

    [20190319]shared pool latch与library cache latch的简单探究.txt --//昨天看Oracle DBA手记3:数据库性能优化与内部原理解析.pdf 电子书 ...

  3. 【每日一摩斯】-Shared Pool优化和Library Cache Latch冲突优化 (1523934.1)-系列3

    减轻Shared Pool负载 Parse一次并执行多次        在OLTP类型的应用中,最好的方法是只让一个语句被解析一次,然后保持这个cursor的打开状态,在需要的时候重复执行它.这样做的 ...

  4. 共享池之六:shared pool latch/ library cache latch /lock pin 简介

    latch:library cache --desc v$librarycache; latch:library cache用于保护hash bucket.library cache lock保护HA ...

  5. latch:library cache

    一:硬解析造成的shared pool latch 争用: 每一个sql被执行之前,先要到library cache中根据hash_value查找parent cursor,这就需要先获得librar ...

  6. 深入理解shared pool共享池之library cache的library cache lock系列四

    本文了解下等待事件library cache lock,进一步理解library cache,之前的文章请见:  深入理解shared pool共享池之library cache的library ca ...

  7. 如何使用event 10049分析定位library cache lock and library cache pin

    Oracle Library Cache 的 lock 与 pin 说明 一. 相关的基本概念 之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library c ...

  8. Oracle内存详解之 Library cache 库缓冲

    Oracle内存详解之 Library cache 库缓冲 2017年11月09日 11:38:39 阅读数:410更多 个人分类: 体系结构 Library cache是Shared pool的一部 ...

  9. Oracle内存详解之二 Library cache 库缓冲-转载

    Library cache是Shared pool的一部分,它几乎是Oracle内存结构中最复杂的一部分,主要存放shared curosr(SQL)和PLSQL对象(function,procedu ...

随机推荐

  1. System.AccessViolationException,尝试读取或写入受保护的内存。这通常指示其他内存已损坏。

    从事件查看器中发现,IIS不定期崩溃并重启的现象.抓取crash dump文件后,发现能够看到异常,但没有堆栈信息(主要是只会看托管代码的堆栈,非托管的不清楚.),问题表现及dump日志的截图如下: ...

  2. ASP.NET MVC2中Controller向View传递数据的三种方式

    转自:http://www.cnblogs.com/zhuqil/archive/2010/08/03/Passing-Data-from-Controllers-to-View.html 在Asp. ...

  3. 解决Centos6.5虚拟机上网问题

    起初是为了能通过上网的方式简化g++的安装,故有此篇博文,希望能帮助到有需要的人. 虚拟机环境: 1.Linux系统:Centos6.5 64位 2.ifconfig查看虚拟机ip:竟然没有ip! 3 ...

  4. Hibernate入门学习(一)

    一.Hibernate是什么 Hibernate主要用来实现Java对象和数据表之间的映射,除此之外还提供数据查询和获取数据的方法,可以大幅度减少开发时人工使用SQL和JDBC处理数据的时间.Hibe ...

  5. [转]java生成随机数字和字母组合

    摘自 http://blog.csdn.net/xiayaxin/article/details/5355851 import java.util.Random; public String getC ...

  6. js 标签云效果

    下载:http://files.cnblogs.com/zjfree/js_tag_list.rar 效果如下: 源码如下: <html> <head> <meta ht ...

  7. [转] matlab figure最大化

    http://blog.163.com/yinhexiwen@126/blog/static/6404826620122942057214/ % figure 窗口最大化,坐标轴也随着窗口变大而相应变 ...

  8. LintCode "Count of Smaller Number before itself"

    Warning: input could be > 10000... Solution by segment tree: struct Node { Node(), left(nullptr), ...

  9. ajaxForm笔记

    <script src="Scripts/jquery.form.js" type="text/javascript"></script> ...

  10. RPM Fusion on CentOS7

    RPM Fusion RPM Fusion provides software that the Fedora Project or Red Hat doesn't want to ship. Tha ...