超过最大游标数,由于你的程序打开游标时没有及时释放,
ORACLE默认打开游标数是150,修改INIT<sid>.ora文件修改
其最大数。
在这个文件里加入open_cursors=1000从新启动数据库

解决方案 »

  1.   

    to LGQDUCKY(飘) :  请问 INIT<sid>.ora 这个文件在什么地方?
    如果我不通过修改该文件,可以做到吗?
      

  2.   

    Connected to Oracle9i Enterprise Edition Release 9.2.0.1.0 
    Connected as system
    SQL> alter system set open_cursors=1000;System alteredSQL>
      

  3.   

    LGQDUCKY(飘):  版本: 9i
      

  4.   

    to LGQDUCKY(飘):   改成 1000 了,重启一下,还是有这个错误!
      

  5.   

    你在使用游标的时候要把那些使用过的游标关闭掉. 可能是用过的没有关闭.
    close cur_name
      

  6.   

    我用的是 JSP 调用,我跟本就没用到游标啊!
    怎么关啊
      

  7.   

    游标有很多种,如SQL语句会产生隐试游标等
    在加大些呢?如再加1000看下你的应用到底使用了多少游标
      

  8.   

    to LGQDUCKY(飘):
       我没有直接调用游标,这个游标是隐式的。
    我现在的显示的数据只有80多条,显示没问题。
    但我再在这个数据中再查询时,如果要查的数据不多时,也没问题,但是我要是全部查询就会出错。
    如果这样的话,这个系统跟本就运行不起来的。
      

  9.   

    to LGQDUCKY(飘):    我现在已用 alter system set open_cursors=10000;命令把它设为“一万”了
    还是出现那个错误。
      

  10.   


       我对Oracle不太了解,可是当一个表里面有500条以上的记录时,就能明显地看出运行速度慢。
    而且也出现了上面的问题。
      

  11.   

    (转贴自“doYouJ”)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应该在用完后关闭
    preparedStatement、Statement也应该在不再需要的时候关闭掉