产生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. mysql ALTER COLUMN MODIFY COLUMN CHANGE COLUMN 区别及用法 (转)

    -- 设置或删除列的默认值.该操作会直接修改.frm文件而不涉及表数据.此操作很快 -- ALTER COLUMN ALTER TABLE  dsp_ad_center.XianDuan ALTER  ...

  2. Splashscreen

    Splashscreen Enables developers to show/hide the application's splash screen. Methods show hide Perm ...

  3. 文字对齐之text-align总结

    一.文字对齐总结: 下面是我实际运用中遇到的问题总结: css代码: 效果(段落文字没有对齐): 去掉html中的<p>标签,css样式同样去掉p标签,效果如下(达到预期效果): 为什么在 ...

  4. SPOJ #440. The Turtle´s Shortest Path

    Coding a Dijkstra is not hard. %70 of my time spent on tackling TLE, as my last post. Dijkstra works ...

  5. node.js的作用、回调、同步异步代码、事件循环

    http://www.nodeclass.com/articles/39274 一.node.js的作用 I/O的意义,(I/O是输入/输出的简写,如:键盘敲入文本,输入,屏幕上看到文本显示输出.鼠标 ...

  6. powerdesigner12.5 设置表字符集和存储引擎

    powerdesigner12.5在做建模的时候发现没有找到哪儿设置表的字符集和存储引擎.于是研究了一番. 在菜单上方选择 Database => Edit Current DBMS   然后选 ...

  7. Linux中文件描述符fd和文件指针flip的理解

    转自:http://www.cnblogs.com/Jezze/archive/2011/12/23/2299861.html 简单归纳:fd只是一个整数,在open时产生.起到一个索引的作用,进程通 ...

  8. Hadoop学习3--安装ssh服务

    题前语:为什么要安装这个东西呢? 是因为我们要在多台机器之间通信,这个服务就相当于支持这种通信的一个桥梁,打个比喻,相当于windows里,通过远程桌面连接到其他机器. 所以,安装这个服务,的目的是: ...

  9. ahk鼠标连击工具

    ;x = 0开始点击,x = 1暂停点击 ^::ck_start() ^::ck_end() ck_start() { x = { Click } } ck_end() { x = else x = ...

  10. [运维-服务器 – 1A] – nginx.conf(转)

    #定义Nginx运行的用户和用户组user www www; #nginx进程数,建议设置为等于CPU总核心数.worker_processes 8; #全局错误日志定义类型,[ debug | in ...