如何正確設置session_cached_cursors參數


轉載自:http://blog.itpub.net/20542911/viewspace-624681

正確設置open_cursors和'session_cached_cursors'  可以減少sql解析,提高系統性能,那么,如何正確設置'session_cached_cursors'  這個參數呢?我們可以把握下面的原則:

1、'session_cached_cursors'  數量要小於open_cursor

2、要考慮共享池的大小

3、使用下面的sql判斷'session_cached_cursors'  的使用情況。如果使用率為100%則增大這個參數值。

select 'session_cached_cursors' parameter,
       lpad(value, 5) value,
       decode(value, 0, '  n/a', to_char(100 * used / value, '990') || '%') usage
  from (select max(s.value) used
          from v$statname n, v$sesstat s
         where n.name = 'session cursor cache count'
           and s.statistic# = n.statistic#),
       (select value from v$parameter where name = 'session_cached_cursors')
union all
select 'open_cursors',
       lpad(value, 5),
       to_char(100 * used / value, '990') || '%'
  from (select max(sum(s.value)) used
          from v$statname n, v$sesstat s
         where n.name in
               ('opened cursors current', 'session cursor cache count')
           and s.statistic# = n.statistic#
         group by s.sid),
       (select value from v$parameter where name = 'open_cursors')

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM