SQL> ALTER SESSION SET SESSION_CACHED_CURSORS = 10;
세션이 변경되었습니다.
SQL> ALTER SYSTEM FLUSH SHARED_POOL;
시스템이 변경되었습니다.
SQL> SELECT empno, ename FROM emp WHERE empno = 7369;
EMPNO ENAME
---------- --------------------
7369 SMITH
SQL> SELECT parse_calls
2 , users_opening
3 , users_executing
4 FROM v$sql
5 WHERE sql_text = 'SELECT empno, ename FROM emp WHERE empno = 7369'
6 ;
PARSE_CALLS USERS_OPENING USERS_EXECUTING
----------- ------------- ---------------
1 0 0
SQL> SELECT empno, ename FROM emp WHERE empno = 7369;
EMPNO ENAME
---------- --------------------
7369 SMITH
SQL> SELECT parse_calls
2 , users_opening
3 , users_executing
4 FROM v$sql
5 WHERE sql_text = 'SELECT empno, ename FROM emp WHERE empno = 7369'
6 ;
PARSE_CALLS USERS_OPENING USERS_EXECUTING
----------- ------------- ---------------
2 0 0
SQL> SELECT empno, ename FROM emp WHERE empno = 7369;
EMPNO ENAME
---------- --------------------
7369 SMITH
SQL> SELECT parse_calls
2 , users_opening
3 , users_executing
4 FROM v$sql
5 WHERE sql_text = 'SELECT empno, ename FROM emp WHERE empno = 7369'
6 ;
PARSE_CALLS USERS_OPENING USERS_EXECUTING
----------- ------------- ---------------
3 1 0
{column}
{column:width=50}{column}
{section}
SQL> CREATE TABLE t (x NUMBER);
테이블이 생성되었습니다.
SQL> SELECT a.name, b.value
2 FROM v$statname a, v$mystat b
3 WHERE a.name IN ('session cursor cache hits','parse count (total)')
4 AND b.statistic# = a.statistic#
5 ;
NAME VALUE
---------------------------- ------
session cursor cache hits 26181
parse count (total) 43509
SQL> ALTER SESSION SET SESSION_CACHED_CURSORS = 0;
세션이 변경되었습니다.
SQL> DECLARE
2 i NUMBER;
3 BEGIN
4 FOR i IN 1 .. 10000
5 LOOP
6 EXECUTE IMMEDIATE 'INSERT INTO t VALUES(' || MOD(i, 100) || ')';
7 END LOOP;
8 END;
9 /
PL/SQL 처리가 정상적으로 완료되었습니다.
SQL> SELECT a.name, b.value
2 FROM v$statname a, v$mystat b
3 WHERE a.name IN ('session cursor cache hits','parse count (total)')
4 AND b.statistic# = a.statistic#
5 ;
NAME VALUE
---------------------------- ------
session cursor cache hits 26181 <=== 그대로
parse count (total) 53521 <=== 10012 증가
SQL> ALTER SESSION SET SESSION_CACHED_CURSORS = 100;
세션이 변경되었습니다.
SQL> DECLARE
2 i NUMBER;
3 BEGIN
4 FOR i IN 1 .. 10000
5 LOOP
6 EXECUTE IMMEDIATE 'INSERT INTO t VALUES(' || MOD(i, 100) || ')';
7 END LOOP;
8 END;
9 /
PL/SQL 처리가 정상적으로 완료되었습니다.
SQL> SELECT a.name, b.value
2 FROM v$statname a, v$mystat b
3 WHERE a.name IN ('session cursor cache hits','parse count (total)')
4 AND b.statistic# = a.statistic#
5 ;
NAME VALUE
---------------------------- ------
session cursor cache hits 35883 <=== 9702 증가
parse count (total) 63530 <=== 10009 증가
{column}
{column:width=50}{column}
{section}