问题描述
在执行数据库操作时,产生如下错误信息:
Nested exception is: java.sql.SQLException: ORA-01000: 超出打开游标的最大数
处理方法
通过报错信息很明显看出,是因为参数open_cursors设置值过小,所以应该适当调大open_cursors设置值。
操作步骤如下:
$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Apr 26 08:05:20 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter open_cursors; //查看当前值
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
open_cursors integer 750
SQL> alter system set open_cursors=1000 scope=both; //根据实际情况修改参数值,此处修改为1000
System altered.
SQL> show parameter open_cursors;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
open_cursors integer 1000
经验证,问题解决。