12
返回列表 发新帖
楼主: ccsnmoracle

为什么opened cursors的数量不一样呢

[复制链接]
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
11#
发表于 2014-4-28 22:57 | 只看该作者
To answer ccsnmoracle's messages #7 and 8: All you said makes sense. This "就在client端所在server的内存中" is probably misleading; I would say "就在client端所在process的内存中". Yes, a private SQL area is in UGA (you can say PGA only because shared server config is not commonly used).

A good explanation is in documentation
http://docs.oracle.com/cd/E16655 ... emory.htm#CNCPT1239

and Jonathan Lewis explains different meanings of "cursor" on pp.162-3 in his "Oracle Core Essential Internals for DBAs and Developers".

使用道具 举报

回复
论坛徽章:
9
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:522010广州亚运会纪念徽章:击剑
日期:2010-11-03 11:00:36ITPUB十周年纪念徽章
日期:2011-11-01 16:25:512012新春纪念徽章
日期:2012-01-04 11:56:19奥运会纪念徽章:摔跤
日期:2012-08-21 10:04:04优秀写手
日期:2014-02-15 06:00:132014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08马上加薪
日期:2014-05-19 11:17:08
12#
 楼主| 发表于 2014-4-29 11:37 | 只看该作者
本帖最后由 ccsnmoracle 于 2014-4-29 11:43 编辑
Yong Huang 发表于 2014-4-28 22:57
To answer ccsnmoracle's messages #7 and 8: All you said makes sense. This "就在client端所在server的内 ...


谢谢Yong Huang Sir的解答

<<Oracle Core Essential Internals for DBAs and Developers>>书中的定义我看了,我感觉说的大概也是一回事。(挺难读懂的)
如果从Oracle官方文档上看,cursor的定义也是很简单的。当然我觉得他这里指的是client process中的cursor。
》A cursor is a name or handle to a specific private SQL area.

而private SQL area呢?

A private SQL area holds information about a parsed SQL statement and other session-specific information for processing. When a server process executes SQL or PL/SQL code, the process uses the private SQL area to store bind variable values, query execution state information, and query execution work areas.

Do not confuse a private SQL area, which is in the UGA, with the shared SQL area, which stores execution plans in the SGA. Multiple private SQL areas in the same or different sessions can point to a single execution plan in the SGA. For example, 20 executions of SELECT * FROM employees in one session and 10 executions of the same query in a different session can share the same plan. The private SQL areas for each execution are not shared and may contain different values and data.

private sql area结构中,有指向 sga中,libaray中cursor。这里的cursor就是具体的一个sql文的指向体。


the Oracle instance the term has two (or even three) more commonly used interpretations. In its first
meaning it is (transient) data—holding information about state, a subset of the results, etc.—stored in the
session’s process memory as the statement executes; in its second meaning it is the executable version of
the SQL statement, stored publicly in the library cache.
The potential third interpretation arises because a single statement can end up with many different execution plans (together with details of their working environment) that are grouped together under acommon place-holder in the library cache—as a consequence we tend to speak of a parent cursor (the
place-holder) and its child cursors (the individual execution plans).

简单的来说,1.cursor是在client端执行sql或plsql时必须要获得的一种资源。
                     2.这种资源是一种指针结构。这个指针结构比较复杂,它将pga和sga中的内容联系在一起,最终的目的就是执行sql文,并是结果返回的client端。

使用道具 举报

回复
论坛徽章:
47
蒙奇·D·路飞
日期:2017-03-27 08:04:23马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:11一汽
日期:2013-09-01 20:46:27复活蛋
日期:2013-03-13 07:55:232013年新春福章
日期:2013-02-25 14:51:24ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:322012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:202012新春纪念徽章
日期:2012-02-13 15:13:20
13#
发表于 2014-4-29 23:51 | 只看该作者
Basically, "cursor" can be a concept on the client side, and on the server side. I wish Oracle used different terms from the beginning.

使用道具 举报

回复
论坛徽章:
9
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:522010广州亚运会纪念徽章:击剑
日期:2010-11-03 11:00:36ITPUB十周年纪念徽章
日期:2011-11-01 16:25:512012新春纪念徽章
日期:2012-01-04 11:56:19奥运会纪念徽章:摔跤
日期:2012-08-21 10:04:04优秀写手
日期:2014-02-15 06:00:132014年新春福章
日期:2014-02-18 16:44:08马上有对象
日期:2014-02-18 16:44:08马上加薪
日期:2014-05-19 11:17:08
14#
 楼主| 发表于 2014-4-30 09:59 | 只看该作者
Yong Huang 发表于 2014-4-29 23:51
Basically, "cursor" can be a concept on the client side, and on the server side. I wish Oracle used  ...

学习了!感谢Yong Huang sir!

使用道具 举报

回复

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

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表