修改oracle open_cur,ORACLE 判断OPEN_CURSOR参数设置合理性

SID

----------

9

SQL> select sid from v$mystat where rownum =1;

SID

----------

9

Session Monitor:

SQL> select SID, USER_NAME,SQL_TEXT from v$open_cursor where sid=9;

SID USER_NAME SQL_TEXT

--- ---------- -----------------------------------------------------------

9 SCOTT select sid from v$mystat where rownum =1

SQL> SELECT SID, n.NAME para_name, s.VALUE used

2 FROM SYS.v_$statname n, SYS.v_$sesstat s

3 WHERE n.NAME IN ('opened cursors current', 'session cursor cache count')

4 AND s.statistic# = n.statistic#

5 AND SID = 9;

SID PARA_NAME USED

--- ------------------------------ ----------

9 opened cursors current 1

9 session cursor cache count 0

v$open_cursor dooes not show all open cursors. it shows more than that, the best option to find the

number of open cursors is from v$sysstat.

通过如上的执行结果可以知道,即使同一个游标被打开

3

次,

SESSION_CACHED_CURSOR

的数量仍然为

0

下面,将会在

Session Test

中关闭游标(通过执行一条其他的语句)。

Session Test:

SQL> select * from t where rownum!=7;

no rows selected

Session Monitor:

SQL> SELECT SID, n.NAME para_name, s.VALUE used

2 FROM SYS.v_$statname n, SYS.v_$sesstat s

3 WHERE n.NAME IN ('opened cursors current', 'session cursor cache count')

4 AND s.statistic# = n.statistic#

5 AND SID = 9;

SID PARA_NAME USED

--- ------------------------------ ----------

9 opened cursors current 1

9 session cursor cache count 1

SQL> select SID, USER_NAME,SQL_TEXT from v$open_cursor where sid=9;

SID USER_NAME SQL_TEXT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值