oracle ORA-01001: 无效的游标
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2385322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ORA-01001: invalid cursor
提问by Sachin Chourasiya
I am getting an oracle error ORA-01001: invalid cursor
in the production where a number of transactions are processed in bulk. However the same code works fine in development.
我ORA-01001: invalid cursor
在批量处理大量事务的生产中遇到 oracle 错误。然而,相同的代码在开发中运行良好。
I need to know when can one have ORA-01001: invalid cursor
in an update query. I did some googling and found that there are two possibilities of getting this error:
我需要知道何时可以ORA-01001: invalid cursor
在更新查询中使用。我做了一些谷歌搜索,发现有两种可能会出现此错误:
- Numbers of cursors opened becomes greater than MAXCURSOR permitted?
- An attempt to fetch is made without opening a cursor.
- 打开的游标数量变得大于 MAXCURSOR 允许?
- 在不打开游标的情况下尝试获取。
Has anyone faced the same problem I had described above? Please suggest solutions.
有没有人遇到过我上面描述的同样问题?请提出解决方案。
回答by p.marino
Yes, these are the common causes (see also thisif you don't have already).
是的,这些是常见的原因(如果您还没有,请参阅此)。
Considering you are using two different environments (dev/prod) have you verified that the MAXCURSOR parameter is the same (or that Prod MAXCURSOR > Dev MAXCURSOR)?
考虑到您正在使用两种不同的环境 (dev/prod),您是否已验证 MAXCURSOR 参数是否相同(或 Prod MAXCURSOR > Dev MAXCURSOR)?
You should also investigate your batch process and see if the number of data could cause your process to open more cursor in prod. Example: your batch launches a stored procedure for every department code in a departments table, and every instance of this procedure opens N cursors.
您还应该调查您的批处理过程,看看数据的数量是否会导致您的过程在 prod 中打开更多的游标。示例:您的批处理为部门表中的每个部门代码启动一个存储过程,并且该过程的每个实例打开 N 个游标。
If you have - say - 3 dep. codes in dev because it is enough for your tests, and 34 department codes in Prod, you could use 10 times the cursor and get in the same situation...
如果你有 - 说 - 3 dep。dev 中的代码,因为它足以用于您的测试,而 Prod 中的 34 个部门代码,您可以使用 10 倍的光标并获得相同的情况...