session_cached_cursors,cursor_space_for_time,gets,pin
set linesize 100
set pagesize 0
set verify off
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA' ;
------------------------------------ ----------- ------------------------------
cursor_space_for_time boolean FALSE
session_cached_cursors integer 0
--------------- ---------- ---------- ---------- ----------
SQL AREA 2942908 2939105 75218597 75211231
SQL AREA 2942909 2939106 75218600 75211234
SQL AREA 2942910 2939107 75218603 75211237
SQL AREA 2942911 2939108 75218606 75211240
SQL AREA 2942912 2939109 75218609 75211243
SQL AREA 2942913 2939110 75218612 75211246
SQL AREA 2942914 2939111 75218615 75211249
SQL AREA 2942915 2939112 75218618 75211252
SQL AREA 2942916 2939113 75218621 75211255
SQL AREA 2942917 2939114 75218624 75211258
SQL 9I>@$HOME/1.sql
SQL AREA 2942935 2939123 75218728 75211344
SQL AREA 2942935 2939123 75218730 75211346
SQL AREA 2942935 2939123 75218732 75211348
SQL AREA 2942935 2939123 75218734 75211350
SQL AREA 2942935 2939123 75218736 75211352
SQL AREA 2942935 2939123 75218738 75211354
SQL AREA 2942935 2939123 75218740 75211356
SQL AREA 2942935 2939123 75218742 75211358
SQL AREA 2942935 2939123 75218744 75211360
SQL AREA 2942935 2939123 75218746 75211362
------------------------------------ ----------- ------------------------------
cursor_space_for_time boolean TRUE
session_cached_cursors integer 100
--------------- ---------- ---------- ---------- ----------
SQL AREA 932 508 3561 3159
SQL AREA 933 509 3563 3161
SQL AREA 934 510 3565 3163
SQL AREA 934 510 3566 3164
SQL AREA 934 510 3567 3165
SQL AREA 934 510 3568 3166
SQL AREA 934 510 3569 3167
SQL AREA 934 510 3570 3168
SQL AREA 934 510 3571 3169
SQL AREA 934 510 3572 3170
cursor_space_for_time boolean FALSE
session_cached_cursors integer 0
SQL AREA 3328 98 23112 21363
SQL AREA 3328 98 23113 21364
SQL AREA 3328 98 23114 21365
SQL AREA 3328 98 23115 21366
SQL AREA 3328 98 23116 21367
SQL AREA 3328 98 23117 21368
SQL AREA 3328 98 23118 21369
SQL AREA 3328 98 23119 21370
SQL AREA 3328 98 23120 21371
SQL AREA 3328 98 23121 21372
SQL 10G>@$HOME/1.sql
SQL AREA 3513 98 28456 26335
SQL AREA 3513 98 28457 26336
SQL AREA 3513 98 28458 26337
SQL AREA 3513 98 28459 26338
SQL AREA 3513 98 28460 26339
SQL AREA 3513 98 28461 26340
SQL AREA 3513 98 28462 26341
SQL AREA 3513 98 28463 26342
SQL AREA 3513 98 28464 26343
SQL AREA 3513 98 28465 26344
------------------------------------ ----------- ------------------------------
cursor_space_for_time boolean TRUE
session_cached_cursors integer 100
SQL 10G>@$HOME/1.sql
--------------- ---------- ---------- ---------- ----------
SQL AREA 1038 24 4404 3488
SQL AREA 1038 24 4405 3489
SQL AREA 1038 24 4406 3490
SQL AREA 1038 24 4407 3491
SQL AREA 1038 24 4408 3492
SQL AREA 1038 24 4409 3493
SQL AREA 1038 24 4410 3494
SQL AREA 1038 24 4411 3495
SQL AREA 1038 24 4412 3496
SQL AREA 1038 24 4413 3497
2 authid current_user
3 as
4 l_ns varchar2(4000);
5 l_gets number;
6 l_gethits number;
7 l_pins number;
8 l_pinhits number;
9 l_sgets number;
10 l_sgethits number;
11 l_spins number;
12 l_spinhits number;
13 begin
14 for i in 1 .. 1000
15 loop
16 execute immediate
17 'select namespace, gets, gethits, pins, pinhits
18 from v$librarycache
19 where namespace = ''SQL AREA'' '
20 into l_ns, l_gets, l_gethits, l_pins, l_pinhits;
21
22 if ( i in (1,1000) )
23 then
24 if ( i = 1 )
25 then
26 l_sgets := l_gets; l_sgethits := l_gethits;
27 l_spins := l_pins; l_spinhits := l_pinhits;
28 end if;
29 dbms_output.put_line
30 ( l_ns || to_char(l_gets,'999,999') ||
31 to_char(l_gethits,'999,999') ||
32 to_char(l_pins,'999,999') ||
33 to_char(l_pinhits,'999,999') );
34 if ( i = 1000 )
35 then
36 dbms_output.put_line
37 ( l_ns || to_char(l_gets-l_sgets,'999,999') ||
38 to_char(l_gethits-l_sgethits,'999,999') ||
39 to_char(l_pins-l_spins,'999,999') ||
40 to_char(l_pinhits-l_spinhits,'999,999') );
41 end if;
42 end if;
43 end loop;
44 end;
45 /
Procedure created.
System altered.
sys@ORA10G> alter system set cursor_space_for_time=TRUE scope=spfile;
System altered.
sys@ORA10G> startup force
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 777956 bytes
Variable Size 145760540 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Database mounted.
Database opened.
sys@ORA10G> @connect /
sys@ORA10G> set termout off
ops$tkyte@ORA10G> @login
ops$tkyte@ORA10G> set termout off
ops$tkyte@ORA10G> REM GET afiedt.buf NOLIST
ops$tkyte@ORA10G> set termout on
ops$tkyte@ORA10G> exec p
SQL AREA 1,181 373 4,828 4,171
SQL AREA 1,181 373 4,828 4,171
SQL AREA 0 0 0 0
PL/SQL procedure successfully completed.
LIBRARY OBJECT HANDLE: handle=9df283a8 mutex=0x9df2845c(1)
name=select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA'
hash=f1deb637acf7a42dd55d86a8ae3baec7 timestamp=08-30-2005 17:07:35
namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/MED/KST/DBN/MTX/[500100d4]
kkkk-dddd-llll=0001-0001-0001 lock=N pin=0 latch#=7 hpc=0002 hlc=0002
LIBRARY OBJECT HANDLE: handle=9df283a8 mutex=0x9df2845c(1)
name=select namespace, gets, gethits, pins, pinhits from v$librarycache where namespace = 'SQL AREA'
hash=f1deb637acf7a42dd55d86a8ae3baec7 timestamp=08-30-2005 17:07:35
namespace=CRSR flags=RON/KGHP/TIM/KEP/PN0/MED/KST/DBN/MTX/[500100d4]
kkkk-dddd-llll=0001-0001-0001 lock=0 pin=0 latch#=7 hpc=0002 hlc=0002
http://wzwanghai.spaces.live.com/blog/cns!56626E237AFBD116!187.entry