产生library cache latch原因
产生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原因的更多相关文章
- [转载】——故障排除:Shared Pool优化和Library Cache Latch冲突优化 (文档 ID 1523934.1)
原文链接:https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=23w4l35u5_4&id=152393 ...
- [20190319]shared pool latch与library cache latch的简单探究.txt
[20190319]shared pool latch与library cache latch的简单探究.txt --//昨天看Oracle DBA手记3:数据库性能优化与内部原理解析.pdf 电子书 ...
- 【每日一摩斯】-Shared Pool优化和Library Cache Latch冲突优化 (1523934.1)-系列3
减轻Shared Pool负载 Parse一次并执行多次 在OLTP类型的应用中,最好的方法是只让一个语句被解析一次,然后保持这个cursor的打开状态,在需要的时候重复执行它.这样做的 ...
- 共享池之六:shared pool latch/ library cache latch /lock pin 简介
latch:library cache --desc v$librarycache; latch:library cache用于保护hash bucket.library cache lock保护HA ...
- latch:library cache
一:硬解析造成的shared pool latch 争用: 每一个sql被执行之前,先要到library cache中根据hash_value查找parent cursor,这就需要先获得librar ...
- 深入理解shared pool共享池之library cache的library cache lock系列四
本文了解下等待事件library cache lock,进一步理解library cache,之前的文章请见: 深入理解shared pool共享池之library cache的library ca ...
- 如何使用event 10049分析定位library cache lock and library cache pin
Oracle Library Cache 的 lock 与 pin 说明 一. 相关的基本概念 之前整理了一篇blog,讲了Library Cache 的机制,参考: Oracle Library c ...
- Oracle内存详解之 Library cache 库缓冲
Oracle内存详解之 Library cache 库缓冲 2017年11月09日 11:38:39 阅读数:410更多 个人分类: 体系结构 Library cache是Shared pool的一部 ...
- Oracle内存详解之二 Library cache 库缓冲-转载
Library cache是Shared pool的一部分,它几乎是Oracle内存结构中最复杂的一部分,主要存放shared curosr(SQL)和PLSQL对象(function,procedu ...
随机推荐
- CSS 使用小结
1.文字过长显示省略号(....) white-space: nowrap;overflow: hidden;text-overflow: ellipsis; 2.获取当前的ID : <asp ...
- ason 和 Java 对象转化示例
1.工程 2.代码: JsonUtil.java package com.my.json; import java.util.ArrayList; import java.util.List; imp ...
- 【jmete】Bean shell使用(一)
一.什么是Bean Shell BeanShell是一种完全符合Java语法规范的脚本语言,并且又拥有自己的一些语法和方法; BeanShell是一种松散类型的脚本语言(这点和JS类似); BeanS ...
- Discuz!NT 3.9.913 Beta DIY过程
前提: 论坛的源码版本为dnt_3.9.913_sqlserver_beta.zip,以下例子都以这个版本为原型修改 dnt_3.9.913数据字典:下载 目前(2013年10月21日)官网的asp. ...
- 【Andorid开发框架学习】之Mina开发之服务器开发
下午那篇博客我们讲到了Mina的客户端的开发,如果还有没看过的同学可以看一下,我是传送门.现在,我们来学习一下,Mina的服务器的开发. 一.首先看一下,我的服务器的代码图片: 服务器代码我是在My ...
- LeetCode "Binary Tree Vertical Order"
BFS + HashTable class Solution { int maxl, minl; unordered_map<int, vector<int>> hm; pub ...
- 【转】8张图理解Java
一图胜千言,下面图解均来自Program Creek 网站的Java教程,目前它们拥有最多的票选.如果图解没有阐明问题,那么你可以借助它的标题来一窥究竟. 1.字符串不变性 下面这张图展示了这段代码做 ...
- Spring实战3:装配bean的进阶知识
主要内容: Environments and profiles Conditional bean declaration 处理自动装配的歧义 bean的作用域 The Spring Expressio ...
- Xshell远程连接Linux时无法使用小键盘的解决方式
我在用xshell连接远程的centos时,每次使用vi/vim的时候而NumLock明明在开启着,小键盘都不能正确输入数字,其实这是时按小而是出现一个字母然后换行(实际上是命令模式上对应上下左右的键 ...
- 95. Unique Binary Search Trees II
Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ...