[20171107]dbms_shared_pool.pin.txt
[20171107]dbms_shared_pool.pin.txt
--//昨天与别人聊天提到,如果dbms_shared_pool.pin对象,可以改变对应的chunk的类型.我自己也不确定,做一次测试.
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
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
1
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
2
SCOTT@book> alter system flush shared_pool;
System altered.
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
21
--//可以发现如果我刷新共享池,seq2顺序号出现跳号现象.
2.测试前检查seq2 chunk状态:
select * from x$kglob a where kglobtyd='SEQUENCE' and kglnaobj='SEQ2';
Record View
As of: 2017/11/7 11:22:41
ADDR: 00007F8F5EE5FA90
INDX: 942
INST_ID: 1
KGLHDADR: 000000007B988D28
KGLHDPAR: 000000007B988D28
KGLHDCLT: 119696
KGLNAOWN: SCOTT
KGLNAOBJ: SEQ2
KGLFNOBJ: SEQ2
KGLNADLK:
KGLNAHSH: 3497251728
KGLNAHSV: 8ab86e9923d83e59d93da6ffd073d390
KGLNATIM: 2017/11/7 11:19:42
KGLNAPTM: 2017/11/7 11:01:22
KGLHDNSP: 1
KGLHDNSD: TABLE/PROCEDURE
KGLHDLMD: 1
KGLHDPMD: 0
KGLHDFLG: 10241
KGLHDOBJ: 000000007C9107A0
KGLHDLDC: 5
KGLHDIVC: 0
KGLHDEXC: 0
KGLHDLKC: 2
KGLHDKMK: 0
~~~~~~~~~~~~~~
KGLHDDMK: 1
KGLHDAMK: 0
KGLOBFLG: 4
KGLOBSTA: 1
KGLOBTYP: 6
KGLOBTYD: SEQUENCE
KGLOBHMK: 0
KGLOBHS0: 4728
KGLOBHS1: 0
KGLOBHS2: 0
KGLOBHS3: 0
KGLOBHS4: 0
KGLOBHS5: 0
KGLOBHS6: 0
KGLOBHS7: 0
KGLOBHD0: 000000007BDC2F80
KGLOBHD1: 00
KGLOBHD2: 00
KGLOBHD3: 00
KGLOBHD4: 00
KGLOBHD5: 00
KGLOBHD6: 00
KGLOBHD7: 00
KGLOBPC0: 0
KGLOBPC6: 0
KGLOBTP0: 00
KGLOBT00: 5
KGLOBT01: 0
KGLOBT02: 0
KGLOBT03:
KGLOBT04: 0
KGLOBT05: 0
KGLOBT35: 0
KGLOBT06: 0
KGLOBT07: 0
KGLOBT08: 90561
KGLOBT09: 10
KGLOBT10: 0
KGLOBT11: 1
KGLOBT12: 0
KGLOBT13: 0
KGLOBT14: 0
KGLOBT15: 0
KGLOBT16: 0
KGLOBT17: 0
KGLOBT18: 0
KGLOBT19: 0
KGLOBT20: 0
KGLOBT21: 0
KGLOBT22: 0
KGLOBT23: 9
KGLOBT24: 16
KGLOBT25: 0
KGLOBT26: 0
KGLOBT28: 0
KGLOBT29: 0
KGLOBT30: 0
KGLOBT31: 0
KGLOBT27: 0
KGLOBT32: 0
KGLOBT33: 0
KGLOBWAP: 0
KGLOBWCC: 0
KGLOBWCL: 0
KGLOBWUI: 0
KGLOBWDW: 0
KGLOBT42: 0
KGLOBT43: 0
KGLOBT44: 0
KGLOBT45: 0
KGLOBT46: 0
KGLOBT47: 0
KGLOBT49: 0
KGLOBT50: 0
KGLOBT52: 0
KGLOBT53: 0
KGLOBTL0: 0
KGLOBTL1: 0
KGLOBTS0:
KGLOBTS1:
KGLOBTN0: 22
KGLOBTN1: 1
KGLOBTN2: 1
KGLOBTN3: 9999999999999999999999999999
KGLOBTN4: 20
KGLOBTN5: 41
KGLOBTS2:
KGLOBTS3:
KGLOBTS5:
KGLOBTT0:
KGLOBCCE:
KGLOBCCEH: 0
KGLOBCLA:
KGLOBCLC: 0
KGLOBCCC: 0
KGLOBTS4:
KGLOBCBCA:
KGLOBT48: 0
KGLOBDSO: 0
KGLOBDEX: 0
KGLOBDPX: 0
KGLOBDLD: 0
KGLOBDIV: 0
KGLOBDPS: 0
KGLOBDDR: 0
KGLOBDDW: 0
KGLOBDBF: 0
KGLOBDRO: 0
KGLOBDCP: 0
KGLOBDEL: 0
KGLOBDFT: 0
KGLOBDEF: 0
KGLOBDUI: 0
KGLOBDCL: 0
KGLOBDAP: 0
KGLOBDCC: 0
KGLOBDPL: 0
KGLOBDJV: 0
KGLOBACS: 0
KGLOBTS6:
KGLOBTS7:
KGLOBT54: 0
KGLOBT55: 0
KGLOBT56: 0
KGLOBT57: 0
KGLOBDCO: 0
KGLOBDCI: 0
KGLOBDRR: 0
KGLOBDRB: 0
KGLOBDWR: 0
KGLOBDWB: 0
KGLOBT58: 0
KGLOBDOR: 0
KGLHDMTX: 000000007B988E68
KGLHDMVL: 0
KGLHDMSP: 0
KGLHDMGT: 110
KGLHDDMTX: 000000007B988DD8
KGLHDDVL: 0
KGLHDDSP: 0
KGLHDDGT: 8
KGLHDBID: 119696
KGLHDBMTX: 0000000080FE6278
KGLHDBVL: 0
KGLHDBSP: 0
KGLHDBGT: 20
KGLOBT59: 0
KGLOBDCU: 0
KGLOBPROP:
--//注意: KGLHDADR: 000000007B988D28 KGLHDPAR: 000000007B988D28
SYS@book> @ &r/sharepool/shp4 000000007B988D28 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007B988D28' or kglhdpar='000000007B988D28' or kglhdadr='000000007B988D28' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ----- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007B988D28 000000007B988D28 SEQ2 0 000000007BDC2F80 00 4728 0 0 4728 4728 3497251728 10
--//顺序号仅仅存在堆0(KGLOBHD0).没有堆6.
SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007B988D28', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
old 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('&&1', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
new 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007B988D28', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FFA00570A00 6932 1 1 1 KGLHD 000000007B988CF8 544 recr 80 00
--//注意KSMCHCLS=recr.
select a.* from x$ksmsp a where a.ksmchpar=hextoraw('000000007BDC2F80')
old 1: select a.* from x$ksmsp a where a.ksmchpar=hextoraw('&&1')
new 1: select a.* from x$ksmsp a where a.ksmchpar=hextoraw('000000007BDC2F80')
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FFA005C3158 5052 1 1 1 KGLH0^d073d390 000000007C9106F0 4096 recr 4095 000000007BDC2F80
SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007BDC2F80', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
old 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('&&1', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
new 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007BDC2F80', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FFA0059B0F0 6077 1 1 1 KGLDA 000000007BDC2F18 240 freeabl 0 00
--//仅仅存在2种类型chunk:recr ,freeabl.
3.测试keep pin后seq2状态:
SYS@book> exec dbms_shared_pool.keep('SCOTT.SEQ2','Q');
PL/SQL procedure successfully completed.
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
22
SCOTT@book> alter system flush shared_pool;
System altered.
SCOTT@book> alter system flush shared_pool;
System altered.
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
23
--//可以发现keep后.seq2不会出现跳号情况.也就是刷新共享池seq2的chunk不会清除从共享池.
SYS@book> @ &r/sharepool/shp4 000000007B988D28 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007B988D28' or kglhdpar='000000007B988D28' or kglhdadr='000000007B988D28' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- -------------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007B988D28 000000007B988D28 SEQ2 0 000000007BDC2F80 00 4728 0 0 4728 4728 3497251728 10
--//顺序号仅仅存在堆0(KGLOBHD0).没有堆6.
SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007B988D28', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
old 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('&&1', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
new 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007B988D28', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FFA00571A70 5131 1 1 1 KGLHD 000000007B988CF8 544 recr 80 00
--//注意KSMCHCLS=recr.
old 1: select a.* from x$ksmsp a where a.ksmchpar=hextoraw('&&1')
new 1: select a.* from x$ksmsp a where a.ksmchpar=hextoraw('000000007BDC2F80')
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FFA005B2560 3846 1 1 1 KGLH0^d073d390 000000007C9106F0 4096 recr 4095 000000007BDC2F80
SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007BDC2F80', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
old 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('&&1', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
new 1: SELECT * FROM x$ksmsp WHERE TO_NUMBER ('000000007BDC2F80', 'xxxxxxxxxxxxxxxx') between TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx') and TO_NUMBER(KSMCHPTR, 'xxxxxxxxxxxxxxxx')+KSMCHSIZ
ADDR INDX INST_ID KSMCHIDX KSMCHDUR KSMCHCOM KSMCHPTR KSMCHSIZ KSMCHCLS KSMCHTYP KSMCHPAR
---------------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------- -------- ---------- ----------------
00007FFA005A2610 4548 1 1 1 KGLDA 000000007BDC2F18 240 freeabl 0 00
--//很明显并不是想对方讲的那样chunk的类型发生了变化,还是与原来的一样.
SELECT OWNER
,NAME
,DB_LINK
,NAMESPACE
,TYPE
,SHARABLE_MEM
,LOADS
,EXECUTIONS
,LOCKS
,PINS
,KEPT
FROM V$DB_OBJECT_CACHE
WHERE name = 'SEQ2' AND owner = 'SCOTT';
OWNER NAME DB_LINK NAMESPACE TYPE SHARABLE_MEM LOADS EXECUTIONS LOCKS PINS KEP
------ ----- -------- --------------- -------- ------------ ---------- ---------- ---------- ---------- ---
SCOTT SEQ2 TABLE/PROCEDURE SEQUENCE 4728 5 0 2 0 YES
--//猜测KEEP字段有关.看看底层定义:
SYS@book> select * from V$FIXED_VIEW_DEFINITION where view_name='GV$DB_OBJECT_CACHE' ;
VIEW_NAME VIEW_DEFINITION
------------------------------ ----------------------------------------------------------------------------------------------------
GV$DB_OBJECT_CACHE select inst_id,kglnaown,kglnaobj,kglnadlk,kglhdnsd,kglobtyd, kglobhs0+kglobhs1+kglobhs2+kglobhs3+kgl
obhs4+kglobhs5+kglobhs6, kglhdldc,kglhdexc,kglhdlkc,kglobpc0,decode(kglhdkmk,0,'NO','YES'),kglhdclt,
kglhdivc, kglnahsh, decode(kglhdlmd, 0, 'NONE',
1, 'NULL', 2, 'SHARED', 3, 'EXCLUSIVE',
'UNKOWN'), decode(kglhdpmd, 0, 'NONE',
1, 'NULL', 2, 'SHARED', 3, 'EXCLUSIVE',
'UNKOWN'), decode(kglobsta, 1, 'VALID',
2, 'VALID_AUTH_ERROR', 3, 'VALID_COMPILE_ERROR', 4, 'VALID_UNAUTH',
5, 'INVALID_UNAUTH', 6, 'INVALID', 'UNKOWN'), substr
(to_char(kglnatim,'YYYY-MM-DD/HH24:MI:SS'),1,19), substr(to_char(kglnaptm,'YYYY-MM-DD/HH24:MI:SS'),1
,19), kglobt23, kglobt24, kglobprop, kglnahsv from x$kglob where kglnaobj is not null
--//可以发现内容 DECODE (kglhdkmk, 0, 'NO', 'YES'),也是kglhdkmk=0,没有keep.
select * from x$kglob a where kglobtyd='SEQUENCE' and kglnaobj='SEQ2';
Record View
As of: 2017/11/7 11:46:03
ADDR: 00007F8F5F139D30
INDX: 1582
INST_ID: 1
KGLHDADR: 000000007B988D28
KGLHDPAR: 000000007B988D28
KGLHDCLT: 119696
KGLNAOWN: SCOTT
KGLNAOBJ: SEQ2
KGLFNOBJ: SEQ2
KGLNADLK:
KGLNAHSH: 3497251728
KGLNAHSV: 8ab86e9923d83e59d93da6ffd073d390
KGLNATIM: 2017/11/7 11:19:42
KGLNAPTM: 2017/11/7 11:01:22
KGLHDNSP: 1
KGLHDNSD: TABLE/PROCEDURE
KGLHDLMD: 1
KGLHDPMD: 0
KGLHDFLG: 8398849
KGLHDOBJ: 000000007C9107A0
KGLHDLDC: 5
KGLHDIVC: 0
KGLHDEXC: 0
KGLHDLKC: 2
KGLHDKMK: 1
~~~~~~~~~~~~~~~
KGLHDDMK: 1
KGLHDAMK: 0
KGLOBFLG: 4
KGLOBSTA: 1
KGLOBTYP: 6
KGLOBTYD: SEQUENCE
KGLOBHMK: 1
KGLOBHS0: 4728
KGLOBHS1: 0
KGLOBHS2: 0
KGLOBHS3: 0
KGLOBHS4: 0
KGLOBHS5: 0
KGLOBHS6: 0
KGLOBHS7: 0
KGLOBHD0: 000000007BDC2F80
KGLOBHD1: 00
KGLOBHD2: 00
KGLOBHD3: 00
KGLOBHD4: 00
KGLOBHD5: 00
KGLOBHD6: 00
KGLOBHD7: 00
KGLOBPC0: 0
KGLOBPC6: 0
KGLOBTP0: 00
KGLOBT00: 5
KGLOBT01: 0
KGLOBT02: 0
KGLOBT03:
KGLOBT04: 0
KGLOBT05: 0
KGLOBT35: 0
KGLOBT06: 0
KGLOBT07: 0
KGLOBT08: 90561
KGLOBT09: 10
KGLOBT10: 0
KGLOBT11: 1
KGLOBT12: 0
KGLOBT13: 0
KGLOBT14: 0
KGLOBT15: 0
KGLOBT16: 0
KGLOBT17: 0
KGLOBT18: 0
KGLOBT19: 0
KGLOBT20: 0
KGLOBT21: 0
KGLOBT22: 0
KGLOBT23: 14
KGLOBT24: 27
KGLOBT25: 0
KGLOBT26: 0
KGLOBT28: 0
KGLOBT29: 0
KGLOBT30: 0
KGLOBT31: 0
KGLOBT27: 0
KGLOBT32: 0
KGLOBT33: 0
KGLOBWAP: 0
KGLOBWCC: 0
KGLOBWCL: 0
KGLOBWUI: 0
KGLOBWDW: 0
KGLOBT42: 0
KGLOBT43: 0
KGLOBT44: 0
KGLOBT45: 0
KGLOBT46: 0
KGLOBT47: 0
KGLOBT49: 0
KGLOBT50: 0
KGLOBT52: 0
KGLOBT53: 0
KGLOBTL0: 0
KGLOBTL1: 0
KGLOBTS0:
KGLOBTS1:
KGLOBTN0: 25
KGLOBTN1: 1
KGLOBTN2: 1
KGLOBTN3: 9999999999999999999999999999
KGLOBTN4: 20
KGLOBTN5: 41
KGLOBTS2:
KGLOBTS3:
KGLOBTS5:
KGLOBTT0:
KGLOBCCE:
KGLOBCCEH: 0
KGLOBCLA:
KGLOBCLC: 0
KGLOBCCC: 0
KGLOBTS4:
KGLOBCBCA:
KGLOBT48: 0
KGLOBDSO: 0
KGLOBDEX: 0
KGLOBDPX: 0
KGLOBDLD: 0
KGLOBDIV: 0
KGLOBDPS: 0
KGLOBDDR: 0
KGLOBDDW: 0
KGLOBDBF: 0
KGLOBDRO: 0
KGLOBDCP: 0
KGLOBDEL: 0
KGLOBDFT: 0
KGLOBDEF: 0
KGLOBDUI: 0
KGLOBDCL: 0
KGLOBDAP: 0
KGLOBDCC: 0
KGLOBDPL: 0
KGLOBDJV: 0
KGLOBACS: 0
KGLOBTS6:
KGLOBTS7:
KGLOBT54: 0
KGLOBT55: 0
KGLOBT56: 0
KGLOBT57: 0
KGLOBDCO: 0
KGLOBDCI: 0
KGLOBDRR: 0
KGLOBDRB: 0
KGLOBDWR: 0
KGLOBDWB: 0
KGLOBT58: 0
KGLOBDOR: 0
KGLHDMTX: 000000007B988E68
KGLHDMVL: 0
KGLHDMSP: 0
KGLHDMGT: 188
KGLHDDMTX: 000000007B988DD8
KGLHDDVL: 0
KGLHDDSP: 0
KGLHDDGT: 12
KGLHDBID: 119696
KGLHDBMTX: 0000000080FE6278
KGLHDBVL: 0
KGLHDBSP: 0
KGLHDBGT: 50
KGLOBT59: 0
KGLOBDCU: 0
KGLOBPROP:
--//注意看~下划线内容.
--//取消kepp看看.
SYS@book> exec dbms_shared_pool.unkeep('SCOTT.SEQ2','Q');
PL/SQL procedure successfully completed.
SELECT OWNER
,NAME
,DB_LINK
,NAMESPACE
,TYPE
,SHARABLE_MEM
,LOADS
,EXECUTIONS
,LOCKS
,PINS
,KEPT
FROM V$DB_OBJECT_CACHE
WHERE name = 'SEQ2' AND owner = 'SCOTT';
OWNER NAME DB_LINK NAMESPACE TYPE SHARABLE_MEM LOADS EXECUTIONS LOCKS PINS KEP
------ ---- ------- --------------- -------- ------------ ---------- ---------- ---------- ---------- ---
SCOTT SEQ2 TABLE/PROCEDURE SEQUENCE 4728 5 0 2 0 NO
--//补充:有一点点奇怪seq的NAMESPACE竟然是TABLE/PROCEDUR.也就是你无法再建立seq2的表在schema=scott模式下.
SCOTT@book> create table seq2 ( a number);
create table seq2 ( a number)
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
41
SCOTT@book> alter system flush shared_pool;
System altered.
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
61
--//再次出现跳号.
SCOTT@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007B988D28 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007B988D28' or kglhdpar='000000007B988D28' or kglhdadr='000000007B988D28' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ----- --------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007B988D28 000000007B988D28 SEQ2 0 00 00 0 0 0 0 0 3497251728 0
--//可以仅仅堆0没清楚了.父游标句柄还在.退出scott登录会话依旧存在.
SYS@book> alter system flush shared_pool;
System altered.
SYS@book> @ &r/sharepool/shp4 000000007B988D28 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007B988D28' or kglhdpar='000000007B988D28' or kglhdadr='000000007B988D28' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ----- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007B988D28 000000007B988D28 SEQ2 0 00 00 0 0 0 0 0 3497251728 0
---//scott用户登录后再执行如下,再次出现跳号.
SCOTT@book> select seq2.nextval from dual;
NEXTVAL
----------
81
SYS@book> @ &r/sharepool/shp4 000000007B988D28 0
old 18: WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2
new 18: WHERE kglobt03 = '000000007B988D28' or kglhdpar='000000007B988D28' or kglhdadr='000000007B988D28' or KGLNAHSH= 0
TEXT KGLHDADR KGLHDPAR C40 KGLHDIVC KGLOBHD0 KGLOBHD6 KGLOBHS0 KGLOBHS6 KGLOBT16 N0_6_16 N20 KGLNAHSH KGLOBT03 KGLOBT09
-------------- ---------------- ---------------- ---- -------- ---------------- ---------------- ---------- ---------- ---------- --------- ---------- ---------- ------------- ----------
父游标句柄地址 000000007B988D28 000000007B988D28 SEQ2 0 000000007B8F2078 00 4728 0 0 4728 4728 3497251728 10
总结:
1.exec dbms_shared_pool.keep('SCOTT.SEQ2','Q')后,chunk类型不会变化.
2.keep后,仅仅改动了x$kglob.KGLHDKMK值.
3.一定要自己测试看看,不要听别人讲.就信以为真.
4.顺便贴上shp4的脚本:
column N0_6_16 format 99999999
SELECT DECODE (kglhdadr,
kglhdpar, '父游标句柄地址',
'子游标句柄地址')
text,
kglhdadr,
kglhdpar,
substr(kglnaobj,1,40) c40,
kglhdivc,
kglobhd0,
kglobhd6,
kglobhs0,kglobhs6,kglobt16,
kglobhs0+kglobhs6+kglobt16 N0_6_16,
kglobhs0+kglobhs1+kglobhs2+kglobhs3+kglobhs4+kglobhs5+kglobhs6+kglobt16 N20,
kglnahsh,
kglobt03 ,
kglobt09
FROM x$kglob
WHERE kglobt03 = '&1' or kglhdpar='&1' or kglhdadr='&1' or KGLNAHSH= &2;
[20171107]dbms_shared_pool.pin.txt的更多相关文章
- [20171107]dbms_shared_pool.pin补充.txt
[20171107]dbms_shared_pool.pin补充.txt --//上午的测试,做一些补充,主要还是一些理解问题. 1.环境:SCOTT@book> @ &r/ver1 P ...
- matlab读取内容为二进制的TXT文件
本方法同样适合读取十六进制和二进制以外的其他进制文件,txt使用一个最简单的命令就可以读取 textread 这是一个十分有用,简便的函数(对于fopen fscanf而言)读取二进制txt文件:假如 ...
- Quartus II中FPGA的管脚分配保存方法
一.摘要 将Quartus II中FPGA管脚的分配及保存方法做一个汇总. 二.管脚分配方法 FPGA 的管脚分配,除了在QII软件中,选择“Assignments ->Pin”标签(或者点击按 ...
- 在Quartus II中分配管脚的两种常用方法
在Quartus II中分配管脚的两种常用方法 示范程序 seg7_test.v 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 /* * ...
- 中断服务程序不用interrupt关键字也可实现中断,该关键字是否必须?
2013-06-20 11:13:35 中断服务程序不用interrupt关键字也可实现中断,该关键字是否必须? 使用tools->pin connect,将INT5与pin.txt关联,模拟外 ...
- quartus2中FPGA管脚分配保存方法(转)
一.摘要 将Quartus II中FPGA管脚的分配及保存方法做一个汇总. 二.管脚分配方法 FPGA 的管脚分配,除了在QII软件中,选择“Assignments ->Pin”标签(或者点击按 ...
- 在Quartus使用TCL脚本文件配制管脚 《本人亲测》
方法一:Import Assignments步骤1: 使用记事本或类似软件新建一个txt文件(或csv文件),按如下格式编写管脚分配内容(不同的开发版,其内容也不同,本文以我使用的DIY_DE2开发板 ...
- Linux内核配置选项
http://blog.csdn.net/wdsfup/article/details/52302142 http://www.manew.com/blog-166674-12962.html Gen ...
- (转载)Quartus II中FPGA的管脚分配保存方法(Quartus II)
一.摘要 将Quartus II中FPGA管脚的分配及保存方法做一个汇总. 二.管脚分配方法 FPGA 的管脚分配,除了在QII软件中,选择"Assignments ->Pin&quo ...
随机推荐
- css选择符权重
css选择符权重 目录 css选择符权重 css选择器权重列表 CSS选择符冲突处理 css选择符权重 css选择器权重列表 选择器 权重 内联样式 1000 ID 0100 CLASS 0010 属 ...
- Django--自定义 Command 命令
Django 对于命令的添加有一套规范,你可以为每个app 指定命令.通俗一点讲,比如在使用manage.py文件执行命令的时候,可以自定制自己的命令,来实现命令的扩充. commands的创建 1. ...
- spring cloud(服务消费者(利用feign实现服务消费及负载均衡)——初学三)
Feign是一个声明式的Web Service客户端,我们只需要使用Feign来创建一个接口并用注解来配置它既可完成. 它具备可插拔的注解支持,包括Feign注解和JAX-RS注解.Feign也支持可 ...
- 第一次用python 写的简单爬虫 记录在自己的博客
#python.py from bs4 import BeautifulSoup import urllib.request from MySqlite import MySqlite global ...
- 从零开始学 Web 之 DOM(六)为元素绑定与解绑事件
大家好,这里是「 从零开始学 Web 系列教程 」,并在下列地址同步更新...... +-------------------------------------------------------- ...
- 对python pickle的理解
python 提供了pickle模块,能将对象进行序列化,将对象以文件形式存放在磁盘. 几乎所有的数据类型(列表,字典,集合,类等)都可以用pickle来序列化.但是序列化后的数据可读性很差. pic ...
- 第6章 Selenium2-Java 自动化测试模型
6.1 自动化测试模型介绍 6.1.1 线性测试 :其实就是单纯地来模拟用户完整的操作场景. 优势就是每一个脚本都是完整且独立的: 缺陷测试用例的开发与维护成本很高. 6.1.2 模块化驱动 ...
- Java设计模式学习记录-组合模式
前言 今天要介绍的设计模式是组合模式,组合模式也是结构型设计模式的一种,它主要体现了整体与部分的关系,其典型的应用就是树形结构.组合是一组对象,其中的对象可能包含一个其他对象,也可能包含一组其他对象. ...
- 从零搭建生产环境的ghost2.0博客
当前安装过程是在ghost cli 1.9.2上的,由于ghost更新特别快,我安装我个人博客cmlanche.com的时候还是1.9.1,当时没碰到啥问题,到1.9.2就有一点点不一样了,所以要注意 ...
- [转]Angular4 自制分页控件
本文转自:https://blog.csdn.net/Junyuan_123/article/details/79486276 过年后第一波,自制的分页控件,可能功能没有 PrimeNG 那么好,但是 ...