查询当前数据库设定的值:
SQL> show parameter open_cursors
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
open_cursors integer 300
修改该参数:SQL> alter system set open_cursors =1000;System altered
该参数为动态参数,修改后立即生效。
参数open_cursors应该设置多大
通过以下语句查询:
SQL> SELECT MAX(A.VALUE) AS HIGHEST_OPEN_CUR, P.VALUE AS MAX_OPEN_CUR2
FROM V$SESSTAT A, V$STATNAME B, V$PARAMETER P3
WHERE A.STATISTIC# = B.STATISTIC#4
AND B.NAME = 'opened cursors current'5
AND P.NAME = 'open_cursors'6
GROUP BY P.VALUE;
HIGHEST_OPEN_CUR MAX_OPEN_CUR
---------------- --------------------------------------------------------------------------------
43 300
字段含义:
HIGHEST_OPEN_CUR 是实际打开的 cursors 的最大值;
MAXOPEN CUR 是参数 Open_cursors 的设定值。