v$sqlarea_parse_calls與executions與session_cached_cursors關係

wisdomone1發表於2013-06-18

----測試引數與parse_calls及executions的關係
----修改此引數要重啟資料庫
SQL> show parameter session_cached

NAME                                 TYPE
------------------------------------ --------------------------------
VALUE
------------------------------
session_cached_cursors               integer
200

---測試會話
SQL> show user
USER is "WISDOMONE"

SQL> select /*+ test */ a from t_version;

no rows selected


--管理會話
set linesize 200
col sql_text for a40
select sql_text,version_count,loads,parse_calls,invalidations from v$sqlarea where sql_text like '%select /*+ test */ a from t_version%'

SQL_TEXT                                 VERSION_COUNT      LOADS PARSE_CALLS INVALIDATIONS
---------------------------------------- ------------- ---------- ----------- -------------
select /*+ test */ a from t_version                  1          1           1             0


---測試會話,執行sql 4次
SQL> /

SQL_TEXT                                 VERSION_COUNT      LOADS PARSE_CALLS EXECUTIONS INVALIDATIONS
---------------------------------------- ------------- ---------- ----------- ---------- -------------
select /*+ test */ a from t_version                  1          1           4          4             0

小結:parse_calls與executions相同


---再看下update的的表現

---測試會話
SQL> var x number

SQL> exec :x:=20;

PL/SQL procedure successfully completed.


SQL> update t_version set a=:x;

0 rows updated.


---管理會話
SQL> select sql_text,version_count,loads,parse_calls,executions,invalidations from v$sqlarea where sql_text like '%update t_version set%';

SQL_TEXT                                 VERSION_COUNT      LOADS PARSE_CALLS EXECUTIONS INVALIDATIONS
---------------------------------------- ------------- ---------- ----------- ---------- -------------
update t_version set a=:x                            1          1           1          1             0


---測試會話
SQL> exec :x:=100;

PL/SQL procedure successfully completed.

SQL> update t_version set a=:x;

0 rows updated.

SQL> /

SQL_TEXT                                 VERSION_COUNT      LOADS PARSE_CALLS EXECUTIONS INVALIDATIONS
---------------------------------------- ------------- ---------- ----------- ---------- -------------
update t_version set a=:x                            1          2           2          2             1


小結:update sql與select sql一樣的

      session_cached_cursors與parse_calls及executions無關

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-764171/,如需轉載,請註明出處,否則將追究法律責任。

相關文章