[20171107]dbms_shared_pool.pin补充.txt
[20171107]dbms_shared_pool.pin补充.txt
--//上午的测试,做一些补充,主要还是一些理解问题.
1.环境:
SCOTT@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SCOTT@book> create sequence seq2 order;
Sequence created.
SCOTT@book> select * from dba_sequences where sequence_name = 'SEQ2' and sequence_owner=user;
SEQUENCE_OWNER SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C O CACHE_SIZE LAST_NUMBER
------------------------------ ------------------------------ ---------- ---------- ------------ - - ---------- -----------
SCOTT SEQ2 1 1.0000E+28 1 N Y 20 1
2.测试:
--//session 1:
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
142
--//注:执行许多次了.
--//session 2:
SELECT KGLHDADR, KGLHDPAR, KGLHDCLT, KGLNAOWN, KGLNAOBJ, KGLFNOBJ
FROM x$kglob a
WHERE kglobtyd = 'SEQUENCE'
AND kglnaobj = 'SEQ2';
KGLHDADR KGLHDPAR KGLHDCLT KGLNAOWN KGLNAOBJ KGLFNOBJ
---------------- ---------------- ---------- -------- ------------------------------ --------------------
000000007BBBCFF0 000000007BBBCFF0 119696 SCOTT SEQ2 SEQ2
SYS@book> @ &r/sharepool/shp4 000000007BBBCFF0 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007BBBCFF0' or kglhdpar='000000007BBBCFF0' or kglhdadr='000000007BBBCFF0' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007BBBCFF0 000000007BBBCFF0 SEQ2 0 000000007BBBCB08 00 4728 0 0 4728 4728 3497251728 10
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007BBBCFF0 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007BBBCFF0' or kglhdpar='000000007BBBCFF0' or kglhdadr='000000007BBBCFF0' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007BBBCFF0 000000007BBBCFF0 SEQ2 0 00 00 0 0 0 0 0 3497251728 0
--//快下班在这里转不出来,为什么还在共享池中,仅仅堆0信息被清除了.下午才想起来,如果会话不退出,无论如何刷新,都存在的.
--//session 1 ,现在退出.
SYS@book> @ &r/sharepool/shp4 000000007BBBCFF0 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007BBBCFF0' or kglhdpar='000000007BBBCFF0' or kglhdadr='000000007BBBCFF0' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---- ---------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007BBBCFF0 000000007BBBCFF0 SEQ2 0 00 00 0 0 0 0 0 3497251728 0
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007BBBCFF0 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007BBBCFF0' or kglhdpar='000000007BBBCFF0' or kglhdadr='000000007BBBCFF0' or KGLNAHSH= 0
no rows selected
--//可以发现现在已经不再共享池了,自己有点蒙....^_^.
3.再看看keep的情况.
--//session 1:
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
162
--//session 2:
SYS@book> exec dbms_shared_pool.keep('SCOTT.SEQ2','Q');
PL/SQL procedure successfully completed.
SELECT KGLHDADR, KGLHDPAR, KGLHDCLT, KGLNAOWN, KGLNAOBJ, KGLFNOBJ ,KGLHDKMK
FROM x$kglob a
WHERE kglobtyd = 'SEQUENCE'
AND kglnaobj = 'SEQ2';
KGLHDADR KGLHDPAR KGLHDCLT KGLNAOWN KGLNAOBJ KGLFNOBJ KGLHDKMK
---------------- ---------------- ---------- -------- -------- -------------------- ----------
000000007D2CD020 000000007D2CD020 119696 SCOTT SEQ2 SEQ2 1
SYS@book> @ &r/sharepool/shp4 000000007D2CD020 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007D2CD020' or kglhdpar='000000007D2CD020' or kglhdadr='000000007D2CD020' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ----- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007D2CD020 000000007D2CD020 SEQ2 0 000000007D2CCB38 00 4728 0 0 4728 4728 3497251728 10
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007D2CD020 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007D2CD020' or kglhdpar='000000007D2CD020' or kglhdadr='000000007D2CD020' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007D2CD020 000000007D2CD020 SEQ2 0 000000007D2CCB38 00 4728 0 0 4728 4728 3497251728 10
--//即使session 1退出,这个seq2也会保持在共享池中.
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007D2CD020 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007D2CD020' or kglhdpar='000000007D2CD020' or kglhdadr='000000007D2CD020' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007D2CD020 000000007D2CD020 SEQ2 0 000000007D2CCB38 00 4728 0 0 4728 4728 3497251728 10
--//这让想起vage书中讲解,刷新一定要一组相似的程序不再运行,刷新才能剔除许多组件.
4.取消keep.
SYS@book> exec dbms_shared_pool.unkeep('SCOTT.SEQ2','Q');
PL/SQL procedure successfully completed.
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007D2CD020 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007D2CD020' or kglhdpar='000000007D2CD020' or kglhdadr='000000007D2CD020' or KGLNAHSH= 0
no rows selected
SELECT KGLHDADR, KGLHDPAR, KGLHDCLT, KGLNAOWN, KGLNAOBJ, KGLFNOBJ ,KGLHDKMK
FROM x$kglob a
WHERE kglobtyd = 'SEQUENCE'
AND kglnaobj = 'SEQ2';
no rows selected
--//顺便测试,这样是否可以keep.
SYS@book> exec dbms_shared_pool.keep('SCOTT.SEQ2','Q');
PL/SQL procedure successfully completed.
SELECT KGLHDADR, KGLHDPAR, KGLHDCLT, KGLNAOWN, KGLNAOBJ, KGLFNOBJ ,KGLHDKMK
FROM x$kglob a
WHERE kglobtyd = 'SEQUENCE'
AND kglnaobj = 'SEQ2';
KGLHDADR KGLHDPAR KGLHDCLT KGLNAOWN KGLNAOBJ KGLFNOBJ KGLHDKMK
---------------- ---------------- ---------- -------- -------- -------- --------
000000007DBFCD50 000000007DBFCD50 119696 SCOTT SEQ2 SEQ2 1
SYS@book> @ &r/sharepool/shp4 000000007DBFCD50 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007DBFCD50' or kglhdpar='000000007DBFCD50' or kglhdadr='000000007DBFCD50' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ----- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- -------- --------
父游标句柄地址 000000007DBFCD50 000000007DBFCD50 SEQ2 0 000000007CFE7010 00 4728 0 0 4728 4728 3497251728 10
--//另外还有一个不理解的地方,KGLOBT09=10表示什么?在sql语句中这个表示child_number.
[20171107]dbms_shared_pool.pin补充.txt的更多相关文章
- [20171107]dbms_shared_pool.pin.txt
[20171107]dbms_shared_pool.pin.txt --//昨天与别人聊天提到,如果dbms_shared_pool.pin对象,可以改变对应的chunk的类型.我自己也不确定,做一 ...
- [20190312]关于增量检查点的疑问(补充).txt
[20190312]关于增量检查点的疑问(补充).txt --//有人问我以前写一个帖子的问题,关于增量检查点的问题,链接如下:http://blog.itpub.net/267265/viewspa ...
- [20190214]11g Query Result Cache RC Latches补充.txt
[20190214]11g Query Result Cache RC Latches补充.txt --//上午测试链接:http://blog.itpub.net/267265/viewspace- ...
- [20180928]ora-01426(补充).txt
[20180928]ora-01426(补充).txt --//链接:http://www.itpub.net/thread-2105458-1-1.html--//做一点点必要的补充: 1.环境:S ...
- [20170604]12c Top Frequency histogram补充.txt
[20170604]12c Top Frequency histogram补充.txt 1.环境:SCOTT@test01p> @ ver1PORT_STRING ...
- [20170916]sqlplus set array最小2补充.txt
[20170916]sqlplus set array最小2补充.txt --//以前写的贴子,链接http://blog.itpub.net/267265/viewspace-1453652/--/ ...
- 黑马程序员_超全面的JavaWeb视频教程vedio--.ppt,.pptx,.doc,.txt,.docx列表
\JavaWeb视频教程_day1-资料源码\day01-html目录.txt;\JavaWeb视频教程_day1-资料源码\PPT\HTML.ppt;\JavaWeb视频教程_day1-资料源码\资 ...
- Linux内核配置选项
http://blog.csdn.net/wdsfup/article/details/52302142 http://www.manew.com/blog-166674-12962.html Gen ...
- [20190329]探究sql语句相关mutexes补充2.txt
[20190329]探究sql语句相关mutexes补充2.txt --//昨天测试sql语句相关mutexes,看看如果出现多个子光标的情况. 1.环境:SCOTT@book> @ ver1P ...
随机推荐
- Apache Commons Digester 一 (基础内容、核心API)
前言 在许多需要处理XML格式数据的应用环境中, 如果能够以“事件驱动”的方式来处理XML文档,比如,当识别出特定的XML元素时,触发“创建对象”操作事件(或者触发调用对象的方法事件),这对于应用程序 ...
- 图像处理池化层pooling和卷积核
1.池化层的作用 在卷积神经网络中,卷积层之间往往会加上一个池化层.池化层可以非常有效地缩小参数矩阵的尺寸,从而减少最后全连层中的参数数量.使用池化层即可以加快计算速度也有防止过拟合的作用. 2.为什 ...
- spring-boot-2.0.3源码篇 - filter的注册,值得一看
前言 开心一刻 过年女婿来岳父家走亲戚,当时小舅子主就问:姐夫,你什么时候能给我姐幸福,让我姐好好享受生活的美好.你们这辈子不准备买一套大点的房子吗?姐夫说:现在没钱啊!不过我有一个美丽可爱的女儿,等 ...
- spring-boot-2.0.3启动源码篇五 - run方法(四)之prepareContext
前言 此系列是针对springboot的启动,旨在于和大家一起来看看springboot启动的过程中到底做了一些什么事.如果大家对springboot的源码有所研究,可以挑些自己感兴趣或者对自己有帮助 ...
- C# GDI+编程之绘图
在了解绘图之前,我们先讲几个预备知识 一.坐标系 坐标系是图形设计的基础.GDI+使用三个坐标空间:世界.页面和设备,其中,世界坐标是用于建立特殊图形世界模型的坐标系,也是在.NET Framewor ...
- Dubbo 源码分析系列之一环境搭建
环境搭建的步骤有哪些 依赖外部的环境 使用的开发工具 源码的拉取 结构大致介绍 1 依赖的外部环境 安装JDK 安装Git 安装maven 这边我们就不介绍怎么安装这些外部环境了,大家自行从安装这些外 ...
- jsonp请求
发起一个jsonp请求 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type&q ...
- C#.net使用DotNetCharting控件生成报表统计图
在做项目时要对数据进行统计分析,所以必须生成一些报表统计图(如柱形图.饼图.曲线图等),网上强烈推荐了使用DotNetCharting控件来实现,于是自己对DotNetCharting控件进行了简单的 ...
- Redis基础认识及常用命令使用(一)--转载
Redis简介 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合)和zset(有序集 ...
- activeX
对外接口和classid在idl文件中,接口功能实现在ctrl类中实现