Skip to main content

Oracle ORA-01000 maximum open cursors exceeded

Several days ago, I wrote a piece of program in C#/.Net to import some records into oracle database. It is windows version 10g XE. When the program is running, I got a run-time error which is ORA-01000 maximum open cursors exceeded.

Here is the Oracle docs about ORA-01000:

ORA-01000 maximum open cursors exceeded

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

Action: 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.


In order to solve this problem, I increased my OPEN_CURSORS by using:

ALTER SYSTEM SET open_cursors = 5000 SCOPE=BOTH;

You can use SQL/PL client and "connect" command to login the database system by using "system" user to change the open_cursors.

If you are using .NET, DBA, and Java programming, please remember to close all the readers or recordsets.
Otherwise, the un-used readers will bite all of your cursors.



Comments

Popular posts from this blog

Comparison == vs equals() in Java

In java, we have two operations (" == " and " equals() ") to check the equivalence of String s. It is important to understand that the difference between them.    == The == operator compares the two objects and checks to see if two objects are exactly the same object (refer to the same instance). .equals() The equals() method compares the characters in the two different objects. Two strings may be different objects , but can contains the same values (exactly the same characters). public class Main {     public static void main(String[] args) {         String s1 = "Shangshu";         String s2 = new String(s1);         System.out.println(s1 + " == " + s2 + " is " + (s1 == s2));         System.out.println(s1 + ".equals(" + s2 + ") is " + (s1.equals(s2)));     } } The output of the above code is:...

(zz) 我为旅行狂---Grand Canyon惊鸿之撇(2010年5月6日--9日)

对于黄石 , 大峡谷 , 还有大瀑布的狂热执着 , 我们终于在上周末实现了三分之一的圆梦计划 . 其中要鼎立感谢我家本田 20 小时不遗余力地勤劳工作 . 这其中要对家庭成员熊宝未能加入深表遗憾 . 这其中要对在母亲节作出卓越贡献的老妈送上经久不息的热烈掌声。 大峡谷国家公园在美国西部亚利桑那州,以横贯其中的科罗拉多河在亿万年间切割出的大峡谷而闻名世界 , 大峡谷总长 446 公里,最宽处近 30 公里,最深处 1600 米。河水切出的岩石断壁纵跨地球形成过程中逾 10 亿年的历史 . 这条著名的峡谷由安静流淌在谷底的科罗拉多河用 600 万年的光阴一点点切割而成 . 河水层层切割出的岩石断面展现了从 20 亿年前至今的地球形成史 ... 这些数字 , 不免让人觉得生硬 . 真正的感受,数字又确实无法衡量 . 只有你亲身站在绝壁边,放眼这浩瀚的旷世奇景 , 才能从心底里发出对造物的由衷赞叹 .                                                                         大峡谷不只是一道深深的山谷,宽阔的峡谷中,层层叠叠还有许多陡峭的山体和峭壁,形态千变万化。这一带山体呈红褐色 , 纵横数十里的视线被大气朦胧着,恍然如视沙漠中的海市蜃楼。这就是大峡谷最著名的风光之一沙漠全景 (Desert View) 。我们于峡谷的南缘驻车 , 开始徒步地探寻这一派奇观绝景 ,5 月的时节对于峡谷来讲还是分外温柔的 , 可惜色彩略显单薄 . 远远地向峡谷对面北缘眺去 , 依稀见得松绿的植被开始悄然萌动 . 北缘也是有游人的吧 , 像我们一样感叹着自然的力量 , 膜拜着这绝对浑然天成的奥妙 . 去谷底只有两个办法,走路或者骑骡子。骑骡入谷,是大峡谷上百年来长盛不衰、最具风景的一项活动。不过,在骡背上摇晃着,随着骡队前进,在山崖边毫无规则而又及其狭窄的小道上...