修改你的参数文件中的 open_cursor的值为一个较大的数
解决方案 »
- 求救一条关于统计的SQL语句
- **问一个基础问题?
- sever 2003无法安装ORACLE 8i--急~~!
- 在oracle中,创建的过程带有编译错误,这是什么原因
- 想问一下oracleparallel工作的原理
- 有没有什么方法或工具可以获取user有密码,或者将一个服务器的user导入到另一个服务器?
- 各位高手,帮帮忙,小弟万分火急.
- 写了个存储过程,老是编译通不过procedure
- 高分求助:Oracle 如何快速入门!
- proxool连接池报ora-12518的问题!紧急!
- 怎么使两个insert语句同时生效才执行
- 在Oracle中,如何用sql将表中存的bmp等文件输出到硬盘上.高手来帮忙!
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也应该在不再需要的时候关闭掉
1.在init.ora种加大open_cursors这个参数的值,然后重新启动数据库。
2.修改前台程式,记得一定要在程序里设置操作完成后关掉游标。
1, 修改源程序;
2,更改配置文件中的(我是oracle817版)open_cursors的最大数(需重启数据库)。
一般来说找init*.ora的命名规则是init+sid.ora