首页 > 数据库 > 关于SESSION_CACHED_CURSORS

关于SESSION_CACHED_CURSORS

2007年12月30日 2,670 views 发表评论 阅读评论

这个参数 ,oracle 10g无意中看了下,已经默认是是20了.不过在8i中还是需要手动设置.

摘录下oracle 9i的解释:

oracle 9.2.0.8 doc
——————————
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. This parameter also constrains the size of the PL/SQL cursor cache which PL/SQL uses to avoid having to reparse as statements are reexecuted by a user.

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.

SESSION_CACHED_CURSORS lets you specify the number of session cursors to cache. Repeated parse calls of the same SQL statement cause the session cursor for that statement to be moved into the session cursor cache. Subsequent parse calls will find the cursor in the cache and do not need to reopen the cursor. Oracle uses a least recently used algorithm to remove entries in the session cursor cache to make room for new entries when needed.

———————————–

由下文,存储的只是一个指针. 经我测试,是连续3次才会放入cache的.注意是连续3次哦.

To get placed in the session cache the same statement has to be parsed 3 times within the same cursor – a pointer to the shared cursor is then added to your session cache. If all session cache cursors are in use then the least recently used entry is discarded.
这篇帖子说可能的碎片问题.不过这应该不成为生产问题.
http://www.adp-gmbh.ch/ora/concepts/cursors.html#cached_cursors

The initialization parameter session_cached_cursors specifies how many cursors are held open for a session. Such cached cursors are stored in the session cursor cache.
If a new cursor needs to me moved into the session cursor cache, the cursor that hasn’t been used for the longest time will be removed from the session cursor cache.
The higher the value of session_cached_cursors is set to a high value, the more the shared pool might become fragmented.
 » 转载保留版权:老陈 » 《关于SESSION_CACHED_CURSORS》
 » 如果喜欢可以: 点此订阅本站
分类: 数据库 标签: ,
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.