问题描述及解决办法ORA-01000 maximum open cursors exceededCause: A host language program attempted to open too many cursors. The initialization parameter OPEN_CURSORS determines the maximum number of cursors per user.Action: Modify the program to use fewer cursors. If this error occurs often, shut down Oracle, increase the value of OPEN_CURSORS, and then restart Oracle.
解决方案 »
- 新手,system密码忘了怎么找回
- oracle 导表报错
- oracle LISTENER 问题
- oracle 9i 中用sql 语句创建多个用户(用户名有规律)小弟初学乍练,还望gs详细指点
- 有没有字符串过滤函数,如何把传递过来的一些特殊符号过滤?
- sqlserver的@@IDENTITY在oracle中怎样实现?
- oracle是否不认识join语句?
- 帮忙,一个触发器中跨用户不能调用问题.
- 大家都知道oracle的哪些后门?
- 求助 | jdbc连接oracle报错Connection refused
- 在Function中用if语句怎么总是编译错误啊?
- 为什么这句SQL不正确?我在SQL Server中是这样用的
它并不能准确地证明用了多少游标,它只能显示最近执行SQL语句的情况:
1.检查程序代码,显式关闭游标
2.修改'open_cursors' 参数,尽可能的大.
http://www.cnoug.org/viewthread.php?tid=17870
Author: Kavitha Soundararajan
--------------------------------------------------------------------------------What causes this error?
This occurs when you open too many cursors. --------------------------------------------------------------------------------How to fix it
The initialization parameter OPEN_CURSORS in INITSID.ORA determines the maximum number of cursors per user.
Check the parameter specified by executing the following SQL:
select * from v$parameter
where name = 'open_cursors'
/ If you want more cursors to be opened at the same time, shut the database, change INITSID.ORA and restart the database. The cursors that are counted for this are those explicit cursors that you opened and never closed or the cursors the PL/SQL keeps open. If you use a lot of stored procedures, then you will see lot of cached cursors. From release 8.1, PL/SQL will close these cached cursors on commit. You can find the list of open cursors and the users who opened them by executing the following SQL: select user_name, status, osuser, machine, a.sql_text
from v$session b,
v$open_cursor a
where a.sid = b.sid
/ But the above SQL will tell you about cursors opened at some point of time, but does tell you about currently open cursors. But the above SQL will helps us to track cursor leaks, which would need fixing, to avoid this error in the future. The SQL given below will tell you how many are open truly. select a.value, b.name
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3
/ The closing of the cursor change based on the tool you use: In JDBC, preparedStatement.close() does closes the cursor.
In PRO*C EXEC SQL CLOSE ; does it.
In OCI -- there is an API call to close a statement These statements will make sure you close every explicitly opened cursor. -----------------
ResultSet应该在用完后关闭
Statement也应该在不再需要的时候关闭掉