ASMM 导致的latch: library cache 和latch: shared pool

核心系统故障及调整报告
核心系统数据库在2012年7月13日下午2点到4点和2012年7月16上午11点出现了高负载,影响了核心系统的正常使用,我随即进行了性能分析。得出报告如下:
2012年7月13日
 Snap Id Snap Time Sessions Cursors/Session
Begin Snap: 28264 13-Jul-12 14:00:26 173 14.3
End Snap: 28265 13-Jul-12 15:00:17 189 15.0
Elapsed:   59.84 (mins)   
DB Time:   798.99 (mins) 

  
Begin Snap: 28265 13-Jul-12 15:00:17 189 15.0
End Snap: 28266 13-Jul-12 16:00:18 187 14.4
Elapsed:   60.01 (mins)   
DB Time:   1,541.16 (mins)   

Top5-event
Top 5 Timed Events
Event Waits Time(s) Avg Wait(ms) % Total Call Time Wait Class
latch: library cache 44,082 11,456 260 12.4 Concurrency
CPU time   5,880   6.4 
latch: shared pool 21,572 5,318 247 5.8 Concurrency
db file scattered read 1,070,575 5,075 5 5.5 User I/O
read by other session 752,209 3,937 5 4.3 User I/O

问题基本确定是当然出现了library cache和shared pool latch。一般来说遇到这两个latch是由于过多的硬解析照成,但是在我们的系统中硬解析并不多,同时看看Latch Miss Sources部分,发现如下:

library cache kglpndl: child: before processing 0 3,236 1,444
library cache kglhdgn: child: 0 2,234 24,921
library cache kglLockCursor 0 1,623 2,956
shared pool kgh: add extent to quiesced list 0 14,022 15
shared pool kghalo 0 3,211 10,250
shared pool kghupr1 0 1,040 6,190

quiesced list是ORACLE ASMM(自动内存分配)相关的组件,猜测是在动态进行SGA分配的时候出现了问题,然后查看动态分配的日志发现:
shared pool SHRINK shared_pool_size 1308622848 2012-7-13 14:15:58
DEFAULT buffer cache GROW db_cache_size 15703474176 2012-7-13 14:15:58
DEFAULT buffer cache SHRINK db_cache_size 15653142528 2012-7-13 14:18:00
shared pool GROW shared_pool_size 1358954496 2012-7-13 14:18:00
shared pool SHRINK shared_pool_size 1291845632 2012-7-13 14:28:42
DEFAULT buffer cache GROW db_cache_size 15720251392 2012-7-13 14:28:42
DEFAULT buffer cache SHRINK db_cache_size 15669919744 2012-7-13 14:30:11
shared pool GROW shared_pool_size 1342177280 2012-7-13 14:30:11
shared pool SHRINK shared_pool_size 1275068416 2012-7-13 14:34:45
DEFAULT buffer cache GROW db_cache_size 15737028608 2012-7-13 14:34:45
DEFAULT buffer cache SHRINK db_cache_size 15686696960 2012-7-13 14:38:48
shared pool GROW shared_pool_size 1325400064 2012-7-13 14:38:48
DEFAULT buffer cache SHRINK db_cache_size 15636365312 2012-7-13 14:41:54
shared pool GROW shared_pool_size 1375731712 2012-7-13 14:41:54
shared pool SHRINK shared_pool_size 1308622848 2012-7-13 14:47:25
DEFAULT buffer cache GROW db_cache_size 15703474176 2012-7-13 14:47:25
shared pool SHRINK shared_pool_size 1258291200 2012-7-13 14:49:28
DEFAULT buffer cache GROW db_cache_size 15753805824 2012-7-13 14:49:28
DEFAULT buffer cache SHRINK db_cache_size 15703474176 2012-7-13 14:53:10
shared pool GROW shared_pool_size 1308622848 2012-7-13 14:53:10
DEFAULT buffer cache SHRINK db_cache_size 15653142528 2012-7-13 14:56:19
shared pool GROW shared_pool_size 1358954496 2012-7-13 14:56:19
shared pool SHRINK shared_pool_size 1291845632 2012-7-13 15:04:23
DEFAULT buffer cache GROW db_cache_size 15720251392 2012-7-13 15:04:23
DEFAULT buffer cache SHRINK db_cache_size 15669919744 2012-7-13 15:06:25
shared pool GROW shared_pool_size 1342177280 2012-7-13 15:06:25
shared pool SHRINK shared_pool_size 1275068416 2012-7-13 15:09:36
DEFAULT buffer cache GROW db_cache_size 15737028608 2012-7-13 15:09:36
DEFAULT buffer cache SHRINK db_cache_size 15686696960 2012-7-13 15:14:34
shared pool GROW shared_pool_size 1325400064 2012-7-13 15:14:34
shared pool SHRINK shared_pool_size 1275068416 2012-7-13 15:17:40
DEFAULT buffer cache GROW db_cache_size 15737028608 2012-7-13 15:17:40
DEFAULT buffer cache SHRINK db_cache_size 15686696960 2012-7-13 15:20:47
shared pool GROW shared_pool_size 1325400064 2012-7-13 15:20:47
shared pool SHRINK shared_pool_size 1275068416 2012-7-13 15:24:27
DEFAULT buffer cache GROW db_cache_size 15737028608 2012-7-13 15:24:27
DEFAULT buffer cache SHRINK db_cache_size 15686696960 2012-7-13 15:27:43
shared pool GROW shared_pool_size 1325400064 2012-7-13 15:27:43
shared pool SHRINK shared_pool_size 1275068416 2012-7-13 15:45:58
DEFAULT buffer cache GROW db_cache_size 15737028608 2012-7-13 15:45:58
DEFAULT buffer cache SHRINK db_cache_size 15686696960 2012-7-13 15:46:59
shared pool GROW shared_pool_size 1325400064 2012-7-13 15:46:59
DEFAULT buffer cache SHRINK db_cache_size 15636365312 2012-7-13 15:50:27
shared pool GROW shared_pool_size 1375731712 2012-7-13 15:50:27
shared pool SHRINK shared_pool_size 1308622848 2012-7-13 16:39:58
DEFAULT buffer cache GROW db_cache_size 15703474176 2012-7-13 16:39:58
shared pool SHRINK shared_pool_size 1258291200 2012-7-13 16:42:28
DEFAULT buffer cache GROW db_cache_size 15753805824 2012-7-13 16:42:28
DEFAULT buffer cache SHRINK db_cache_size 15703474176 2012-7-13 16:46:00
shared pool GROW shared_pool_size 1308622848 2012-7-13 16:46:00
DEFAULT buffer cache SHRINK db_cache_size 15653142528 2012-7-13 16:52:30
shared pool GROW shared_pool_size 1358954496 2012-7-13 16:52:30
发现在问题期间SGA不断的动态分配,为了让shared_pool_size不因为动态分配而导致出现问题,我手动执行了如下语句:
alter system set shared_pool_size=1800m scope=both;
手动设置一个较大的最小值1800m,避免频繁的动态分配。设置后观察效果。

关于ASMM 这个文章可以参考,非常好的文章
http://www.oracledatabase12g.com/archives/tag/memory-broker
这是我提的问题
http://www.itpub.net/thread-1636268-1-1.html

 

时间: 2024-07-30 06:19:21

ASMM 导致的latch: library cache 和latch: shared pool的相关文章

shared pool latch/ library cache latch /lock pin介绍

latch:library cache --desc v$librarycache; latch:library cache用于保护hash bucket. library cache lock保护HANDLE. library cache pin保护library cache object--LCO. 从10G开始,library cache lock和library cache pin被MUTEX部分取代.暂时不讨论MUTEX. latch:library cache的数量: SYS@ by

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

原文链接:https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=23w4l35u5_4&id=1523934.1用途   提出问题,得到帮助并分享您的心得   排错步骤   什么是shared pool?   专用术语   Literal SQL   Hard Parse(硬解析)   Soft Parse(软解析)   完全相同的语句?   Sharable SQL   语句的版本   Library Cac

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

Flushing(清空) SHARED POOL        在使用大量literal SQL的系统中,shared pool随时间推移会产生大量碎片进而导致并发能力的下降.Flushing shared pool能够使得很多小块碎片合并,所以经常能够在一段时间内恢复系统的性能.清空之后可能也会产生短暂的性能下降(补充:因为需要做第一次的硬解析),因为这个操作同时也会把没造成shared pool碎片的共享SQL也清除了.清空shared pool的命令是: ALTER SYSTEM FLUS

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

什么是Shared Pool?        Oracle的实例主要包括共享内存(主要是SGA,还有PGA)和Background Processes,其中SGA中又包括了Shared Pool.Buffer Cache.Redo Log Buffer以及其它一些内存区.        Oracle在SGA的一个特定区域中保留SQL语句.Package是.对象信息以及其它一些内容,这就是Shared Pool.这个共享内存区域是由一个复杂的cache和heap manager 构成的.它需要解决

latch: row cache objects 和cursor: pin S wait on X共同出现

 Snap Id Snap Time Sessions Cursors/Session Begin Snap: 5980 11-Nov-13 16:00:37 1403  39.6 End Snap: 5981 11-Nov-13 16:31:29 1422  42.8 Elapsed:    30.86 (mins)    DB Time:    3,660.60 (mins)    Per Second Per Transaction Redo size:  1,185,514.75  6,

oracle数据库library cache lock引发的一个问题解决办法

美女同事说某个客户有个问题,系统出现了大量的library cache lock. 导致业务严重受阻,具体表现是所有访问某个表的SQL语句都会挂起. 首先我们来看hanganalyze 的结果: PORADEBUG END ORIGINATING INST:1 SERIAL:0 PID:38076802 ******************************************************************** Found 341 objects waiting fo

Oracle后台专家解决library cache锁争用的终极武器

  11月19日,云汝网络科技合伙人宋日杰(Roger Song)在"DBA+东北群"进行了一场关于"使用Hotcopy缓解 library cache: mutex X 的争用"的线上主题分享.小编特别整理出其中精华内容,供大家学习交流.    嘉宾简介    DBA+原创专家团成员 超过13年IT及Oracle数据库经验 历任中国联通系统工程师.维布络信息科技Oracle ERP管理顾问 2008年加入Oracle全球技术支持(GCS),专注性能分析 2012年

[20170103]关于latch shared pool.txt

[20170103]关于latch shared pool.txt --网友问的问题:http://www.itpub.net/thread-2074374-1-1.html SCOTT@book> select * from V$EVENT_NAME where name='latch: shared pool';     EVENT#   EVENT_ID NAME                 PARAMETER1           PARAMETER2           PARAM

Oracle Kernel : Function kglic & Library Cache Latch

以下是关于KGLIC函数的功能简要说明:  代码如下 复制代码 1. kglic means Kernel Generic Library cache Iterate Chain (AFAIK), it's the function which is executed when you access most X$KGL tables. 2. kglic is the code which goes through the  library cache and row cache to answ