重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 526|回复: 0
打印 上一主题 下一主题

[参数设置] Oracle 参数 OPEN_CURSORS

[复制链接]
跳转到指定楼层
楼主
发表于 2024-1-11 15:24:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Oracle OPEN_CURSORS 参数是控制Oracle的数据库最大的游标数量,如果游标数量超出了 OPEN_CURSORS设定的值,则会出现ORA-01000: 错误消息:游标数过多。
如果 Oracle 用户正在执行联合查询的复杂的操作,OPEN_CURSORS的值会很重要。
正确设置Oracle的OPEN_CURSORS参数需要考虑用户数量,SESSION数量,数据库会话之间共享游标的最小值,以及在应用程序中循环遍历游标所需要的操作。
最好根据实际使用情况来调整 OPEN_CURSORS 的大小,可以使用下面的 SQL 语句来查询当前 Oracle 实例中已用游标最大数量:
SELECT a.value ”Max CURSOR” FROM v$parameter a WHERE a.name = ‘open_cursors’;
可以使用下面的 SQL 语句来设置Oracle OPEN_CURSORS参数:
ALTER SYSTEM SET open_cursors =  SCOPE=MEMORY
如果你想永久的设置 OPEN_CURSORS 参数的值,可以使用下面的 SQL 语句:
ALTER SYSTEM SET open_cursors =  SCOPE=SPFILE

官方英文解释

OPEN_CURSORS specifies the maximum number of open cursors (handles to private SQL areas) a session can have at once. You can use this parameter to prevent a session from opening an excessive number of cursors.               
[td]
Property
Description
Parameter type
Integer
Default value
50
Modifiable
ALTER SYSTEM
Modifiable in a PDB
Yes
Range of values
0 to 65535
Basic
Yes



It is important to set the value of OPEN_CURSORS high enough to prevent your application from running out of open cursors. The number will vary from one application to another. Assuming that a session does not open the number of cursors specified by OPEN_CURSORS, there is no added overhead to setting this value higher than actually needed.                  
See Also:
  • Oracle Database
                                            Performance Tuning Guide for more information on setting this parameter
  • Your operating system-specific Oracle documentation for the range of values


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-4-30 12:45 , Processed in 0.079976 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表