Content of the PGA【每日一译】--2012-10-10

来源:互联网 发布:openwrt 修改mac 编辑:程序博客网 时间:2024/05/22 16:00

The content of the PGA memory varies, depending on whether the instance is running
the shared server option. But generally speaking, the PGA memory can be classified as

follows.

PGA的内存的变化目录,取决于实例是否运行在共享服务选项。但是通常来说,PGA内存

可以被分为以下:

Private SQL Area
A private SQL area contains data such as bind information and runtime memory
structures. Each session that issues a SQL statement has a private SQL area. Each user
that submits the same SQL statement has his or her own private SQL area that uses a
single shared SQL area. Thus, many private SQL areas can be associated with the same

shared SQL area.

私有SQL区域

一个私有的SQL区域包含数据,像绑定变量和运行时期的内存结构。每个会话在输入SQL

语句时候拥有一个私有的SQL区域。任何一个用户提交同样的SQL语句拥有他们自己的私有SQL

区域(使用的一个单独的共享SQL区域),并且非常多的私有SQL区域可以关联到同样的共享

SQL区域

The private SQL area of a cursor is itself divided into two areas whose lifetimes are

different:

游标的私有SQL区域被分成2部份他们的生命周期是不同的:

■ The persistent area, which contains, for example, bind information. It is freed only

when the cursor is closed.

持续区域,包含绑定变量,它只有在游标被关闭时才被释放。

■ The run-time area, which is freed when the execution is terminated.
Oracle creates the runtime area as the first step of an execute request. For INSERT,
UPDATE, and DELETE statements, Oracle frees the runtime area after the statement has
been run. For queries, Oracle frees the runtime area only after all rows are fetched or

the query is canceled.

运行时期区域,它在执行被中断时释放。

ORACLE创建运行时期区域作为执行要求的第一步。对于INSERT,UPDATE,DELETE语句

ORACLE释放运行区域在语句已经被执行后。对于查询,ORACLE释放运行期区域仅在所有的

行都被选取或者查询被取消。

The location of a private SQL area depends on the type of connection established for a
session. If a session is connected through a dedicated server, private SQL areas are
located in the server process’s PGA. However, if a session is connected through a
shared server, part of the private SQL area is kept in the SGA.
Cursors and SQL Areas The application developer of an Oracle precompiler program or
OCI program can explicitly open cursors, or handles to specific private SQL areas, and
use them as a named resource throughout the execution of the program. Recursive
cursors that Oracle issues implicitly for some SQL statements also use shared SQL

areas.

一个私有SQL区域的位置取决于一个用户的连接类型的创建,如果一个用户的连接通过

DEDICATED服务,私有SQL区域将位于服务进程的PGA。但是如果一个会话的连接是

通过SHARED服务,那么私有SQL区域将部份保存在SGA中。

游标和SQL区域是ORACLE预编译或ORACLE调用接口程序的应用开发者可以显式打开

游标或处理指定的私有SQL区域,并且使用他们作为一种可命名的资源通过程序的执行。

递归调用游标是ORACLE隐式输入对于一些SQL语句也是使用共享SQL区域。

The management of private SQL areas is the responsibility of the user process. The
allocation and deallocation of private SQL areas depends largely on which application
tool you are using, although the number of private SQL areas that a user process can
allocate is always limited by the initialization parameter OPEN_CURSORS. The default

value of this parameter is 50.

私有SQL区域的管理是由用户进程负责。对于私有SQL区域的分配和回收大部份取决于你

正在使用的应用工具,但私有SQL区域的数量对于一个用户进程可分配的一直是受限于

初始化参数OPEN_CURSORS。默认值是50.

A private SQL area continues to exist until the corresponding cursor is closed or the
statement handle is freed. Although Oracle frees the runtime area after the statement
completes, the persistent area remains waiting. Application developers close all open
cursors that will not be used again to free the persistent area and to minimize the

amount of memory required for users of the application.

一个私有SQL区域继续存在直到对应的游标关闭或者处理的语句被释放。而ORACLE释放

运行期区域在语句完成后,持续续区域保留等待。应用的开发者们关闭所有打开的游标

那些将不再被使用的游标而释放持续区域并且最小化内存要求的数量对于应用的用户来说。

Session Memory
Session memory is the memory allocated to hold a session’s variables (logon
information) and other information related to the session. For a shared server, the

session memory is shared and not private.

会话内存

会话内存是内存分配去保留一个用户的变量(登录信息)并且其它与会话相关的信息。对

于一个共享服务,会话内存是共享的而不是私有的。