修改你的参数文件中的 open_cursor的值为一个较大的数

解决方案 »

  1.   

    ORA-01000 maximum open cursors exceeded24-July-2001
    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也应该在不再需要的时候关闭掉
      

  2.   

    加大open_cursor只能延缓问题的出现
      

  3.   

    没有关闭Resultset,加大open_cursor只能延缓问题的出现。
      

  4.   

    就是没有关闭ResultSet,打开一个ResultSet就在Oracle里打开一个游标。
      

  5.   

    我们公司也出现了这种问题,解决方案有2种
    1.在init.ora种加大open_cursors这个参数的值,然后重新启动数据库。
    2.修改前台程式,记得一定要在程序里设置操作完成后关掉游标。
      

  6.   

    两方面:
    1, 修改源程序;
    2,更改配置文件中的(我是oracle817版)open_cursors的最大数(需重启数据库)。
      

  7.   

    oracle中控制游标数量由init*.ora决定,文件中有open_cursors控制游标的数量。
    一般来说找init*.ora的命名规则是init+sid.ora