暂无图片
oracle这个用户下有六千多张表 ,在获取表名时候 报错:ORA-01000:超出打开游标的最大数
我来答
分享
铛铛
2021-12-15
oracle这个用户下有六千多张表 ,在获取表名时候 报错:ORA-01000:超出打开游标的最大数

QQ图片20211215164911.jpg

我来答
添加附件
收藏
分享
问题补充
3条回答
默认
最新
摸摸鱼

Typically, in Java, when an object goes out of scope, it is automatically garbage collected, but the Java specification does not place any specific requirements on the JVM regarding when (or even if) this will occur for any particular object. Therefore, do not rely on finalizers to close your cursors.

Explicitly close all cursors by either using ResultSet.close(), Statement.close(), and/or PreparedStatement.close() when you no longer need the cursor. This ensures that the corresponding server-side cursors are closed, preventing the ORA-1000 error. Be sure to close these JDBC objects within the scope that they were created. Closing these objects in a finally{} block is recommended, however, DO NOT rely upon a finalize() method because a finalize() method is never guaranteed to run by the JVM!

A common error occurs when CallableStatement is used to call a PL/SQL procedure that returns a REF CURSOR. If you do not close the corresponding ResultSet object, a cursor will be left open on the server.

You can query the SQL_TEXT column in V$OPEN_CURSOR view from the schema to determine which cursors are not being closed. For example:

SQL> select sql_text from v$open_cursor;
暂无图片 评论
暂无图片 有用 1
暂无图片
cqiwen

把kettle中获取用户所有表的相关sql发出来看下。或者增加JAVA的内存配置。

PENTAHO_DI_JAVA_OPTIONS="-Xms2048m" "-Xmx2048m" "-XX:MaxPermSize=256m"
暂无图片 评论
暂无图片 有用 1
DarkAthena

应用那边的代码有问题,打开游标过多,如果只是获取表名的话,根本不用开那么多游标

暂无图片 评论
暂无图片 有用 1
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏