We help IT Professionals succeed at work.

Maximum Open cursors exceeded??

Samisrini
Samisrini asked
on
HI ,
 I am working with Oracle and Java.
I am inserting more than 30,000 records into oracle.
After sometime it is giving me an exception saying

ORA-01000 Maximum open cursors exceeded.

Does anyone has any ideas over this???

How to increase open cursors in Oracle???

Thanks
samisrini
Comment
Watch Question

Commented:
Can you show us the code on inserting?
increase number of cursors in init<DB_NAME>.ora file
i.e. increase value of attribute open_cursors in above file.

Try to use PreparedStatement (if ur not using) instead
of Statement interface

Commented:
 I have met the same problem. I think you have to close your statmenet whenerever they are not used already. And I remember the Oracle configuration fiel allow us to set the number of the connection.. But I forgot the details.

Commented:
hi
Your host language program attempted to open too many cursors. The initialization parameter OPEN_CURSORS determines the maximum number of cursors per user.

Modify the program to use fewer cursors. If this error occurs often, shut down Oracle, increase the value of OPEN_CURSORS, and then restart Oracle.

Regards Sumeet

Commented:
hi
you could set
open_cursors parameter in initdbname.ora file

Regards Sumeet

Commented:
Howdy

If you are using statements, you should close them after executing statement and after that when you have gathered data from resultset, close it too with resultset.close(), because those also seem to leave cursors open to database.

Regards Santeri

This question is LOCKED with a Proposed Answer.  If it helps you, great, accept it and grade it to close.  If not, reject it and comment as to why or what else is needed.

Few additional experts will join this collaboration effort, once a question has been locked.  Just want to confirm this to you.  If more than one expert helps you, you can always split points or award additional help in a new question, within the same topic area.  If you need help from us, post a zero point question here, and include the link:

EXPERT INPUT ON OUTCOME ALWAYS WELCOME.

http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

Moondancer
Community Support Moderator @ Experts Exchange
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange

Explore More ContentExplore courses, solutions, and other research materials related to this topic.