初始化引數OPEN_CURSORS的理解加深
今天看到Natalka Roshak寫的一篇關於open_cursors及session_cached_cursors的文章,頓時一目瞭然,參見:,摘錄部分精彩內容如下:
SESSION_CACHED_CURSORS sets the number of cached closed cursors each session can have. You can set SESSION_CACHED_CURSORS to higher than OPEN_CURSORS, lower than OPEN_CURSORS, or anywhere in between. This parameter has no effect on ora-1000's or on the number of cursors a session will have open. Conversely, OPEN_CURSORS has no effect on the number of cursors cached. There's no relationship between the two parameters.
If SESSION_CACHED_CURSORS is not set, it defaults to 0 and no cursors will be cached for your session. (Your cursors will still be cached in the shared pool, but your session will have to find them there.) If it is set, then when a parse request is issued, Oracle checks the library cache to see whether more than 3 parse requests have been issued for that statement. If so, Oracle moves the session cursor associated with that statement into the session cursor cache. Subsequent parse requests for that statement by the same session are then filled from the session cursor cache, thus avoiding even a soft parse. (Technically, a parse can't be completely avoided; a "softer" soft parse is done that's faster and requires less CPU.)
這裡提到的softer soft parse與 這裡8#裡biti_rainy老大提到的軟軟解析就是一個意思了,之前我卡在這裡挺迷糊,現下算是弄明白了。
更加大快人心的句子來了:
I believe a lot of the confusion about open cursors vs. cached cursors comes from the names of the Oracle dynamic performance views used to monitor them. v$open_cursor shows cached cursors, not currently open cursors, by session. If you're wondering how many cursors a session has open, don't look in v$open_cursor. It shows the cursors in the session cursor cache for each session, not cursors that are actually open.
To monitor open cursors, query v$sesstat where name='opened cursors current'. This will give the number of currently opened cursors, by session:
--total cursors open, by session
select a.value, s.username, s.sid, s.serial#
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid
and b.name = 'opened cursors current';
sigh,按這種思路做了幾個實驗,有點闊然開朗的感覺。
比如,用toad連線到一個庫,在Editor裡多開幾個tab(此時session sid均是一致),分別在tab裡執行一些sql,在其中一個tab裡查詢open的cursor數量,發現此時open的cursor數量即等於開啟的tab數量。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14517718/viewspace-1007327/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 加深對 JavaScript This 的理解JavaScript
- 修改open_cursors和session_cached_cursors的引數值Session
- 引數 session_cached_cursors 與 open_cursors詳解Session
- 關於open_cursors和session_cached_cursors的引數值Session
- Visitor模式加深理解模式
- ORACLE初始化引數的配置Oracle
- HttpRuntime的認識與加深理解HTTP
- oracle初始化引數Oracle
- Oracle初始化引數的來源Oracle
- jmeter 引數理解JMeter
- Oracle 並行相關的初始化引數Oracle並行
- 查詢初始化引數的方法(二)
- 查詢初始化引數的方法(一)
- 查詢初始化引數的方法(七)
- 查詢初始化引數的方法(六)
- 查詢初始化引數的方法(五)
- 查詢初始化引數的方法(四)
- 查詢初始化引數的方法(三)
- Oracle幾個初始化引數Oracle
- Oracle RAC初始化引數管理Oracle
- oracle 常見初始化引數Oracle
- 透過重構來加深理解——DDD
- java 執行緒池的初始化引數解釋和引數設定Java執行緒
- 2.6.2.2 初始化引數DB_DOMAINAI
- 2.6.1.1 初始化引數檔案示例
- ORACLE初始化引數:AUDIT_TRAILOracleAI
- Oracle FILESYSTEMIO_OPTIONS初始化引數Oracle
- 初始化引數REMOTE_OS_AUTHENTREM
- 【SQL優化器】初始化引數SQL優化
- linux,mtime引數的理解Linux
- Linux系統初始化*引數初始化(指令碼)Linux指令碼
- 深入理解mysql引數MySql
- 2.7.6.2 設定或修改初始化引數的值
- Oracle建庫必備的核心初始化引數Oracle
- 4.2.1.3 學習如何管理初始化引數
- 0607-引數初始化策略
- webpack 流程解析(2):引數初始化完成Web
- 初始化引數REMOTE_LOGIN_PASSWORDFILEREM