开发者

oracle open cursor

We are using the ORACLE A.S 10g and D.B 10g (10.0.1). We maintain a pool of D.B connection on A.S. Our application is web based. We are properly closing the resultset and statement on java side. But we often receive the error open cursor exceeded. Currently on production we set the limit to 5000. We use following query to check the currently open cursor

select a.sid, a.value, b.name, b.statistic#
from v$sesstat a, v$statname b
where a.statistic# = b.statistic#
and b.name = 'opened cursors current'
and a.sid = 555(any sid number)

The count of ‘open cursor’ is increasing it cannot be reduce until we restart our application server. Because we are using the connection pooling that is why cursors are not closed? Please guide us 开发者_StackOverflow中文版what should we do. What other areas we will look.


to find repeat offenders:

select c.SQL_TEXT, count(*) cnt  
  from v$open_cursor c
  group by c.SQL_TEXT
  order by cnt desc

Ref Cursors that are returned by stored procedures/functions need to be closed too.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜