- 最后登录
- 2017-6-23
- 在线时间
- 48 小时
- 威望
- 36
- 金钱
- 272
- 注册时间
- 2012-5-13
- 阅读权限
- 10
- 帖子
- 80
- 精华
- 0
- 积分
- 36
- UID
- 425
|
5#
发表于 2013-4-24 14:41:38
这是我的测试:
SQL> alter system set session_cached_cursors=100 scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2068296 bytes
Variable Size 385876152 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14708736 bytes
Database mounted.
Database opened.
SQL> select st.name,vs.value from v$mystat vs , v$statname st
2 where vs.statistic#=st.statistic#
3 and st.name like '%parse%';
NAME VALUE
---------------------------------------------------------------- ----------
parse time cpu 30
parse time elapsed 32
parse count (total) 1223
parse count (hard) 298
parse count (failures) 0
SQL> /
NAME VALUE
---------------------------------------------------------------- ----------
parse time cpu 30
parse time elapsed 32
parse count (total) 1224
parse count (hard) 298
parse count (failures) 0
SQL> declare
2 v_i int;
3 begin
4 for v_i in 1..10000 loop
5 execute immediate 'select 1 from dual where 1=:1' using v_i;
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
SQL> select st.name,vs.value from v$mystat vs , v$statname st
2 where vs.statistic#=st.statistic#
3 and st.name like '%parse%';
NAME VALUE
---------------------------------------------------------------- ----------
parse time cpu 30
parse time elapsed 32
parse count (total) 1227
parse count (hard) 300
parse count (failures) 0
SQL> alter system set session_cached_cursors=0 scope=spfile;
System altered.
SQL> startup force
ORACLE instance started.
Total System Global Area 1610612736 bytes
Fixed Size 2068296 bytes
Variable Size 385876152 bytes
Database Buffers 1207959552 bytes
Redo Buffers 14708736 bytes
Database mounted.
Database opened.
SQL> show parameter session_cache
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
session_cached_cursors integer 0
SQL> select st.name,vs.value from v$mystat vs , v$statname st
2 where vs.statistic#=st.statistic#
3 and st.name like '%parse%';
NAME VALUE
---------------------------------------------------------------- ----------
parse time cpu 36
parse time elapsed 37
parse count (total) 2533
parse count (hard) 314
parse count (failures) 0
SQL> declare
2 v_i int;
3 begin
4 for v_i in 1..10000 loop
5 execute immediate 'select 1 from dual where 1=:1' using v_i;
6 end loop;
7 end;
8 /
PL/SQL procedure successfully completed.
SQL> select st.name,vs.value from v$mystat vs , v$statname st
2 where vs.statistic#=st.statistic#
3 and st.name like '%parse%';
NAME VALUE
---------------------------------------------------------------- ----------
parse time cpu 37
parse time elapsed 37
parse count (total) 2536
parse count (hard) 316
parse count (failures) 0
请问 我在10205 上 发现 session_cached_cursor 0 parse count 没有明显变化? |
|