等待模拟-library cache shared pool 硬解析

drop table test1;

create table test1

(it int);

insert into test1

values(10);

create table test2

as

select * from test1;

create table test3

as

select * from test1;

create table test4

as

select * from test1;

create table test5

as

select * from test1;

create table test6

as

select * from test1;

create table test7

as

select * from test1;

create table test8

as

select * from test1;

create table test9

as

select * from test1;

create table test10

as

select * from test1;

create table test11

as

select * from test1;

create table test12

as

select * from test1;

create table test13

as

select * from test1;

create table test14

as

select * from test1;

create table test15

as

select * from test1;

create table test16

as

select * from test1;

create table test17

as

select * from test1;

create table test18

as

select * from test1;

create table test19

as

select * from test1;

create table test20

as

select * from test1;

create table test21

as

select * from test1;

引发500000次的硬解析,

为了不引发软解析,创建唯一的SQL语句。

SGA设置为150M

create or replace procedure do_hard_parse(p_idx in number)

 is

   v_value number;

   v_cursor sys_refcursor;

begin

  for idx in 1..500000 loop

    open v_cursor for 'select '||p_idx||' from '||rpad('',idx)||' test'||p_idx||' where rownum=1';

    fetch v_cursor into v_value;

    close v_cursor;

 end loop;

end;

清空shared pool

alter system flush shared_pool;

同时在30个会话执行

var job_no number;

begin 

  for idx in 1..20 loop

      dbms_job.submit(:job_no,'do_hard_parse('||idx||');');

end loop;

commit;

end;

开启一个会话执行

execute do_hard_parse(21);

使用观察

select * from v$session_event a,(select SID from v$mystat where rownum
where a.SID=b.sid order by TIME_WAITED desc;

阅读(1694) | 评论(0) | 转发(0) |

0

上一篇:等待模拟-library cache 软解析

下一篇:等待模拟-cache buffer chain

时间: 2024-07-29 17:15:15

等待模拟-library cache shared pool 硬解析的相关文章

等待模拟-library cache 软解析

create table test (it int); insert into test values(10); commit; create or replace procedure do_soft_parse(p_idx in number)  is      v_value number;     v_cursor sys_refcursor;  begin     execute immediate 'alter session set session_cached_cursor=0';

[20130228]等待事件library cache pin的快速定位与解决.txt

[20130228]等待事件library cache pin的快速定位与解决.txt 前几天管理的服务器出现library cache pin,当时解决有点乱了阵脚,正好下午空闲做一个例子来定位library cache pin事件以及解决方法,另外我也看许多blog,感觉定位太复杂,不合适快速解决问题: 1.环境以及问题再现: SQL> select * from v$version where rownumBANNER------------------------------------

shared pool 深度解析2+

Library cache是Shared pool的一部分,它几乎是Oracle内存结构中最复杂的一部分,主要存放shared curosr(SQL)和PLSQL对象(function,procedure,trigger)的信息,以及这些对象所依赖的table,index,view等对象的信息. Library cache需要解决三个问题: 1.快速定位的问题:Library cache中对象众多,Oracle如何管理这些对象,以便服务进程可以迅速找到他们需要的信息.比如某个服务进程需要迅速定位

shared pool 深度解析1+

原文整理自网络 1. 深入Shared Pool   Oracle数据库作为一个管理数据的产品,必须能够认出用户所提交的管理命令(通常叫做SQL语句),从而进行响应.认出的过程叫做解析SQL语句的过程,响应的过程叫做执行SQL语句的过程.解析是一个相当复杂的过程,它要考虑各种可能的异常情况,比如SQL语句涉及的对象不存在.提交的用户没有权限等.而且,还需要考虑如何执行SQL语句,采用什么方式去获取数据等.解析的最终结果是要产生Oracle自己内部的执行计划,从而指导SQL的执行过程.可以看到,解

shared pool 深度解析3(subpool)+

我们知道,从Oracle 9i开始,Shared Pool可以被分割为多个子缓冲池(SubPool)进行管理,以提高并发性,减少竞争. Shared Pool的每个SubPool可以被看作是一个Mini Shared Pool,拥有自己独立的Free List.内存结构以及LRU List.同时Oracle提供多个Latch对各个子缓冲池进行管理,从而避免单个Latch的竞争(Shared Pool Reserved Area同样进行分割管理).SubPool最多可以有7个,Shared Poo

等待模拟-cache buffer chain

出现CACHE BUFFER CHAIN 后首先查看V$SESSION_WAIT 找到P1raw的值,此P1对应了v$latch_children addr和 x$bh 的HLADDR 然后查看v$latch_children 找到GET最高的LATCH ADDR  select * from v$latch_children where name='cache buffers chains' order by gets desc;  select * from v$latch_children

关于shared pool的深入探讨(五)

关于shared pool的深入探讨(五) 原文链接: http://www.eygle.com/internal/shared_pool-5.htm Oracle使用两种数据结构来进行shared pool的并发控制:lock 和 pin.Lock比pin具有更高的级别. Lock在handle上获得,在pin一个对象之前,必须首先获得该handle的锁定.锁定主要有三种模式: Null,share,Exclusive.在读取访问对象时,通常需要获取Null(空)模式以及share(共享)模式

共享池的调整与优化(Shared pool Tuning)

--======================================= -- 共享池的调整与优化(Shared pool Tuning) --=======================================       共享池(Shared pool)是SGA中最关键的内存片段,共享池主要由库缓存(共享SQL区和PL/SQL区)和数据字典缓存组成.其中库缓存的作用是存 放频繁使用的sql,pl/sql代码以及执行计划.数据字段缓存用于缓存数据字典.在内存空间有限的容量下

《Oracle高性能自动化运维》一一2.3 Library Cache

2.3 Library Cache2.3.1 Library Cache与SQL游标 Library Cache主要用于存放SQL游标,而SQL游标最大化共享是Library Cache优化的重要途径,可以使SQL运行开销最低.性能最优. 1. SQL语句与父游标及子游标 在PL/SQL中,游标(Cursor)是数据集遍历的内存集合.而从广义上讲,游标是SQL语句在Library Cache中的内存载体.SQL语句与游标关系如下: 1)一条SQL语句包含一个父游标(Parent Cursor)和