zoukankan      html  css  js  c++  java
  • oracle session_cached_cursors 与 open_cursors参数详解及配置语句

    0.原则

    正确设置open_cursors和'session_cached_cursors'  可以减少sql解析,提高系统性能,那么,如何正确设置'session_cached_cursors'  这个参数呢?我们可以把握下面的原则:

    1、'session_cached_cursors'  数量要小于open_cursor

    2、要考虑共享池的大小

    3、使用下面的sql判断'session_cached_cursors'  的使用情况。如果使用率为100%则增大这个参数值。

    1.查询是否需要修改

    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')

    结果如图: 

     2.修改方法

    alter system set session_cached_cursors = 100;
    alter system set open_cursors = 500;

     ps

     出现ora-02096错误使用以下方法:

     

    alter system set backup_tape_io_slaves = false;

    会报相应的错误, 因为backup_tape_io_slaves属性issys_modifiable的值为deferred;

    alter system set backup_tape_io_slaves = false deferred;

    加上deferred就不会报错了, 但是表示这次修改对当前会话不发生作用, 在以后打开的会话中起作用, 故它有"推迟"影响的效果.

  • 相关阅读:
    functionnullvb6.0 求素数按奇偶显示
    问题判断那些年,我们遇到的傻逼问题
    下载输入python之小说下载器version2.0
    文件配置pro_git 第一章
    问题类像程序员一样思考
    修饰对象再谈const: 用const 修饰函数的返回值
    中国触发盲目推进城镇化极易触发金融危机
    树线段hdu 1754 I Hate It(线段树)
    监听事件Servlet监听器的那些事儿
    使用批处理build vs2005的工程
  • 原文地址:https://www.cnblogs.com/liberty777/p/14415233.html
Copyright © 2011-2022 走看看