欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle ORA-01000:maximum open cursors exceeded

程序员文章站 2022-05-19 09:10:21
...

Oracle ORA-01000:maximum open cursors exceeded中文错误ldquo;超出打开游标的最大数rdquo;。这个错误通常都是由于在程序代码

Oracle ORA-01000:maximum open cursors exceeded中文错误“超出打开游标的最大数”。
这个错误通常都是由于在程序代码中循环体内放入了statement或preparestatement,而每一个循环结束时并未及时关闭statement或preparestatement。解决方法就是循环体内用完resultset、statement或preparestatement之后,立即执行close()。

同时还应考虑扩大数据库服务器的open_cursors的值,
先得到系统默认的游标最大值,
select value from v$parameter where name = 'open_cursors';
(或show parameter open_cursors)
使用下面语句更改即可:
alter system set open_cursors=5000 scope=both。

Oracle ORA-01000:maximum open cursors exceeded