深入讨论PGA(实战篇)--优化任务的入口点

本文重点介绍了一些PGA的视图,听完课以后,一定要看懂这篇文章。
PGA作为优化的重要任务之一,通常是捕捉性能问题的一个入口,如果连入口都找不到,那么你的优化将会大费周折。

PGA内存管理
PGA是个包含server process的数据和控制信息的专用内存区域。
例如,当一个游标打开的时候,PGA内存就会新创建一块区域给予服务器进程利用。
这里要注意,当你使用shared server的时候,有一部分PGA内存会保存到SGA中。

在自动模式下,*_AREA_SIZE参数都会被忽略,通过设置PGA_AGGREGATE_TARGET的大小来启动自动管理。
但你创建一个全新的实例的时候,是很难精确的确定PGA_AGGREGATE_TARGET的大小的,但是你可以通过下面的步骤来判断:
1.最初可以设置为SGA的20%大小。注意,在DSS系统中,这个值可能不足。
2.在实例运行的正常负载情况下,收集PGA的统计信息,判断PGA的最大大小是否超出配置。
3.调整PGA_AGGREGATE_TARGET,使用Oracle 的PGA 顾问统计。
下面的章节将详细解释这三个步骤。
PGA_AGGREGATE_TARGET初始化设置
PGA_AGGREGATE_TARGET的值应该基于Oracle实例可利用内存的总量来设置。
这个参数可以被动态的修改。下面将列举一个典型的案例。
假设Oracle实例可分配4GB的物理内存。
剩下的内存分配给操作系统和其它应用程序。
你也许会分配80%的可用内存给Oracle实例,3.2G。
现在必须在内存中划分SGA和PGA区域。

在OLTP系统中,典型PGA内存设置应该是总内存的较小部分(例如20%),剩下80%分配给SGA。
OLTP: PGA_AGGREGATE_TARGET = (total_mem * 80%) * 20%
在DSS系统中,由于会运行一些很大的查询,典型的PGA内存最多分配70%的内存。(在上面的例子中,最多为2.2GB)
DSS: PGA_AGGREGATE_TARGET = (total_mem * 80%) * 50%
在这个例子中,总内存4GB,DSS系统,你可以设置PGA_AGGREGATE_TARGET为1600MB,OLTP则为655MB。
-监控自动PGA内存管理的性能
在开始调整之前,你应该知道如何监控和分析Oracle PGA内存统计。下面几个动态性能视图是为了这个目的:
V$PGASTAT
这个视图给出了一个实例级别的PGA内存使用和自动分配的统计。
SELECT * FROM V$PGASTAT;
NAME VALUE UNIT
-------------------------------------------------------- ---------- ------------
aggregate PGA target parameter:
(Current value of the PGA_AGGREGATE_TARGET initialization parameter. If this parameter is not set, then its value is 0 and automatic management of PGA memory is
disabled.)
aggregate PGA auto target
(Amount of PGA memory the Oracle Database can use for work areas running in automatic mode. This amount is dynamically derived from the value of the
PGA_AGGREGATE_TARGET initialization parameter and the current work area workload, and continuously adjusted by the Oracle Database.
If this value is small compared to the value of PGA_AGGREGATE_TARGET, then a large amount of PGA memory is used by other components of the system (for example, PL/SQL
or Java memory) and little is left for work areas. The DBA must ensure that enough PGA memory is left for work areas running in automatic mode.
)
global memory bound
Maximum size of a work area executed in automatic mode. This value is continuously adjusted by the Oracle Database to reflect the current state of the work area
workload. The global memory bound generally decreases when the number of active work areas is increasing in the system.
If the value of the global bound decreases below 1 MB, then the value of PGA_AGGREGATE_TARGET should be increased.
total PGA allocated
Current amount of PGA memory allocated by the instance. The Oracle Database attempts to keep this number below the value of the PGA_AGGREGATE_TARGET initialization
parameter. However, it is possible for the PGA allocated to exceed that value by a small percentage and for a short period of time when the work area workload is
increasing very rapidly or when PGA_AGGREGATE_TARGET is set to a small value.
total PGA used
Indicates how much PGA memory is currently consumed by work areas. This number can be used to determine how much memory is consumed by other consumers of the PGA
memory (for example, PL/SQL or Java).
over allocation count
This statistic is cumulative since instance startup. Over allocating PGA memory can happen if the value of PGA_AGGREGATE_TARGET is too small. When this happens, the
Oracle Database cannot honor the value of PGA_AGGREGATE_TARGET and extra PGA memory needs to be allocated.
If over allocation occurs, then increase the value of PGA_AGGREGATE_TARGET using the information provided by the V$PGA_TARGET_ADVICE view.
bytes processed
Number of bytes processed by memory intensive SQL operators, cumulated since instance startup.

extra bytes read/written
Number of bytes processed during extra passes of the input data, cumulated since instance startup. When a work area cannot run optimal, one or more of these extra
passes is performed.

cache hit percentage
A metric computed by the Oracle Database to reflect the performance of the PGA memory component, cumulative since instance startup. A value of 100% means that all work
areas executed by the system since instance startup have used an optimal amount of PGA memory.
When a work area cannot run optimal, one or more extra passes is performed over the input data. This will reduce the cache hit percentage in proportion to the size of
the input data and the number of extra passes performed.

上面讲的都是v$pgastat视图的一些列的情况
对于目前pga的具体使用情况,还是非常的重要。

V$PROCESS
This view contains information about the currently active processes. While the LATCHWAIT column indicates what latch a process is waiting for, the LATCHSPIN column
indicates what latch a process is spinning on. On multi-processor machines, Oracle processes will spin on a latch before waiting on it.
ADDR
Address of process state object
PID  
Oracle process identifier
SPID
Operating system process identifier
USERNAME  
Operating system process username. Any two-task user coming across the network has "-T" appended to the username.
SERIAL#
Process serial number
TERMINAL
Operating system terminal identifier
PROGRAM
Program in progress
BACKGROUND  
1 for a background process; NULL for a normal process

LATCHWAIT
Address of latch the process is waiting for; NULL if none

LATCHSPIN
Address of the latch the process is spinning on; NULL if none

PGA_USED_MEM
PGA memory currently used by the process

PGA_ALLOC_MEM
PGA memory currently allocated by the process (including free PGA memory not yet released to the operating system by the server process)
PGA_FREEABLE_MEM
Allocated PGA memory which can be freed
PGA_MAX_MEM
Maximum PGA memory ever allocated by the process

这也是一份非常重要的视图,让我们知道每个进程的一些内存使用情况。

V$PROCESS_MEMORY
这个视图显示了每个Oracle进程使用动态PGA的组成。它包含6种类型的行
java PLSQL OLAP SQL,Freeable由操作系统分配的内存,Other。
displays dynamic PGA memory usage by named component categories for each process.
PID
Oracle process identifier
SERIAL#
Oracle process serial number

CATEGORY
Category name. Categories include "SQL", "PL/SQL", "OLAP" and "JAVA". Special categories are "Freeable" and "Other". Freeable memory has been allocated to the process
by the operating system, but has not been allocated to a category. "Other" memory has been allocated to a category, but not to one of the named categories.
ALLOCATED NUMBER Bytes of PGA memory allocated by the process for the category. For the "Freeable" category, it is the amount of free PGA memory eligible to be
released to the operating system.

USED
Bytes of PGA memory used by the process for the category. For "Freeable", the value is zero. For "Other", the value is NULL for performance reasons.

MAX_ALLOCATED
Maximum bytes of PGA memory ever allocated by the process for the category.
说一个小知识点:
PGA是针对每个进程的,UGA是针对每个会话的。
对于dedicated server模式,UGA放在PGA里面;对于MTS,UGA放在shared pool或者larged pool里面。
我们来研究dedicated server模式。
PGA分为固定部分和可变部分
固定PGA部分(Fixed PGA):这部分包含一些小的固定尺寸的变量,以及指向变化PGA部分的指针。
变化PGA部分(Variable PGA):这部分是按照堆(Heap)来进行组织的,所以这部分也叫做PGA堆。
内存一种非常通用的管理方式就是堆,所谓的堆,就是需要的时候,使用malloc函数申请,使用完成以后,使用free函数进行释放。
UGA是包含与某个特定session相关信息的内存区域,比如session的登录信息以及session私有的SQL区域等。每个UGA也包含以下两个部分。
固定UGA部分(Fixed UGA):这部分包含一些小的固定尺寸的变量,以及指向变化UGA部分的指针。
变化UGA部分(Variable UGA):这部分也是按照堆来进行组织的,可以从X$KSMUP视图中看到有关UGA堆的分布情况。
UGA堆的分布与open_cursors、open_links等参数有关系。所谓的游标(cursor)就是放在这里的,游标指向shared pool里的包含SQL文本以及执行计划等的对象。
UGA堆中所包含的内存结构介绍如下:
私有SQL区域(Private SQL Area):这部分区域包含绑定变量信息以及运行时的内存结构等数据。这个区域只是针对SQL语句,不包含PL/SQL和JAVA等。
每一个发出SQL语句的session都有自己的私有SQL区域。这部分区域又可分成以下两部分。
永久内存区域:这里存放了相同SQL语句多次执行时都需要的一些游标信息,比如绑定变量信息、数据类型转换信息等。这部分内存只有在游标被关闭时才会被释放。
运行时区域:在处理SQL语句时的第一步就是要创建运行时区域,这里存放了当SQL语句运行时所使用的一些信息。
对于DML(INSERT、UPDATE、DELETE)语句来说,SQL语句执行完毕就释放该区域;
而对于查询语句(SELECT)来说,则是在所有数据行都被获取并传递给用户以后被释放,或者该查询被取消以后也会被释放。
Session相关的信息:这部分信息包括以下几部分。
正在使用的包(package)的状态信息。
使用alter session这样的命令所启用的跟踪信息,或者所修改的session级别的优化器参数(optimizer_mode)、排序参数(sort_area_size等)、修改的NLS参数等。
所打开的db links。可使用的角色(roles)等。
工作区(Work area):这块区域主要用来存放执行SQL的过程中所产生的中间数据,比如排序时,需要在这里存放排序过程中的中间数据。这部分占据了PGA中的大部分空间。
其大小依赖于所要处理的SQL语句的复杂程度而定。如果SQL语句包含诸如group by、hash-join等这样的操作,则会需要很大的SQL工作区域。
实际上,我们调整PGA也就是调整这块区域。
我们关系PGA空间,经常注意的就是PGA中的SQL工作区:V$SQL_WORKAREA。
displays information about work areas used by SQL cursors.
Each SQL statement stored in the shared pool has one or more child cursors that are listed in the V$SQL view.
V$SQL_WORKAREA lists all work areas needed by these child cursors;
V$SQL_WORKAREA can be joined with V$SQLAREA on (ADDRESS, HASH_VALUE) and with V$SQL on (ADDRESS, HASH_VALUE, CHILD_NUMBER).
You can use this view to find out answers to the following questions:
What are the top 10 work areas that require the most cache area?
For work areas allocated in AUTO mode, what percentage of work areas are running using maximum memory?
ADDRESS
Address of the parent cursor handle

HASH_VALUE
Hash value of the parent statement in the library cache.
Two columns PARENT_HANDLE and HASH_VALUE can be used to join with V$SQLAREA to locate the parent cursor.
SQL_ID
SQL identifier of the parent statement in the library cache

CHILD_NUMBER
Number of the child cursor that uses this work area.
The columns PARENT_HANDLE, HASH_VALUE, and CHILD_NUMBER can be used to join with V$SQL to locate the child cursor using this area.
WORKAREA_ADDRESS
Address of the work area handle. This is the primary key for the view.

OPERATION_TYPE
Type of operation using the work area (SORT, HASH JOIN, GROUP BY, BUFFERING, BITMAP MERGE, or BITMAP CREATE)

OPERATION_ID
A unique number used to identify the operation in the execution plan.
This identifier can be joined to V$SQL_PLAN to locate the operation that uses this work area.

POLICY
Sizing policy for this work area (MANUAL or AUTO)
ESTIMATED_OPTIMAL_SIZE
Estimated size (in KB) required by this work area to execute the operation completely in memory (optimal execution).
Derived from either optimizer statistics or previous executions.

ESTIMATED_ONEPASS_SIZE
Estimated size (in KB) required by this work area to execute the operation in a single pass.
Derived from either optimizer statistics or previous executions.
LAST_MEMORY_USED
Memory (in KB) used by this work area during the last execution of the cursor

LAST_EXECUTION
Indicates whether this work area runs using OPTIMAL, ONE PASS, or ONE PASS memory requirement (or MULTI-PASS), during the last execution of the cursor

LAST_DEGREE
Degree of parallelism used during the last execution of this operation

TOTAL_EXECUTIONS
Number of times this work area was active

OPTIMAL_EXECUTIONS
Number of times this work area ran in optimal mode

ONEPASS_EXECUTIONS
Number of times this work area ran in one-pass mode

MULTIPASSES_EXECUTIONS
Number of times this work area ran below the one-pass memory requirement

ACTIVE_TIME
Average time this work area is active (in hundredths of a second)

MAX_TEMPSEG_SIZE
Maximum temporary segment size (in bytes) created by an instantiation of this work area.
This column is null if this work area has never spilled to disk.

LAST_TEMPSEG_SIZE
Temporary segment size (in bytes) created in the last instantiation of this work area.
This column is null if the last instantiation of this work area did not spill to disk.
下面这个sql将查询出在工作区中使用cache最多的前10条SQL
SELECT *
FROM
( SELECT workarea_address, operation_type, policy, estimated_optimal_size
FROM V$SQL_WORKAREA
ORDER BY estimated_optimal_size )
WHERE ROWNUM <= 10;
下面的SQL监视正在执行的游标的情况
col sql_text format A80 wrap
SELECT sql_text, sum(ONEPASS_EXECUTIONS) onepass_cnt,
sum(MULTIPASSES_EXECUTIONS) mpass_cnt
FROM V$SQL s, V$SQL_WORKAREA wa
WHERE s.address = wa.address
GROUP BY sql_text
HAVING sum(ONEPASS_EXECUTIONS+MULTIPASSES_EXECUTIONS)>0;
col "O/1/M" format a10
col name format a20
SELECT operation, options, object_name name,
trunc(bytes/1024/1024) "input(MB)",
trunc(last_memory_used/1024) last_mem,
trunc(estimated_optimal_size/1024) optimal_mem,
trunc(estimated_onepass_size/1024) onepass_mem,
decode(optimal_executions, null, null,
optimal_executions||'/'||onepass_executions||'/'||
multipasses_executions) "O/1/M"
FROM V$SQL_PLAN p, V$SQL_WORKAREA w
WHERE p.address=w.address(+)
AND p.hash_value=w.hash_value(+)
AND p.id=w.operation_id(+)
AND p.address='88BB460C'
AND p.hash_value=3738161960;
SELECT address, hash_value
FROM V$SQL
WHERE sql_text LIKE '%my_pattern%';
V$SQL_WORKAREA_ACTIVE:这个视图反映了当前每个工作区即时的信息。
contains an instantaneous view of the work areas currently allocated by the system.
You can join this view against V$SQL_WORKAREA on WORKAREA_ADDRESS to access the definition of that work area.
If a work area spills to disk, then this view contains information for the temporary segment created on behalf of this work area.
The last three columns are included to enable joining V$SQL_WORKAREA_ACTIVE with V$TEMPSEG_USAGE to retrieve more information on this temporary segment.
You can use this view to answer the following:
What are the top 10 largest work areas currently allocated in my system?
What percentage of memory is over-allocated (EXPECTED_SIZE < ACTUAL_MEM_USED) and under-allocated (EXPECTED_SIZE > ACTUAL_MEM_USED)?
What are the active work areas using more memory than what is expected by the memory manager?
What are the active work areas that have spilled to disk?
SQL_HASH_VALUE
Hash value of the SQL statement that is currently being executed

SQL_ID
SQL identifier of the SQL statement that is currently being executed

WORKAREA_ADDRESS
Address of the work area handle. This is the primary key for the view.

OPERATION_TYPE
Type of operation using the work area (SORT, HASH JOIN, GROUP BY, BUFFERING, BITMAP MERGE, or BITMAP CREATE)

OPERATION_ID
A unique number used to identify the operation in the execution plan.
This identifier can be joined to V$SQL_PLAN to locate the operation that uses this work area.
POLICY
Sizing policy for this work area (MANUAL or AUTO)

SID
Session identifier
QCINST_ID
Query coordinator instance identifier. Along with QCSID, enables you to uniquely identify the query coordinator.
QCSID Query coordinator session identifier. This is the same as the SID if the work area is allocated by a serial cursor.
ACTIVE_TIME
Average time this work area is active (in centi-seconds)
WORK_AREA_SIZE
Maximum size of the work area as it is currently used by the operation

EXPECTED_SIZE
Expected size (in KB) for this work area.
EXPECTED_SIZE is set on behalf of the operation by the memory manager.
Memory can be over-allocated when WORK_AREA_SIZE has a higher value than EXPECTED_SIZE.
This can occur when the operation using this work area takes a long time to resize it.
ACTUAL_MEM_USED
Amount of PGA memory (in KB) currently allocated on behalf of this work area.
This value should range between 0 and WORK_AREA_SIZE.
MAX_MEM_USED
Maximum memory amount (in KB) used by this work area

NUMBER_PASSES
Number of passes corresponding to this work area (0 if running in OPTIMAL mode)

TEMPSEG_SIZE
Size (in bytes) of the temporary segment used on behalf of this work area.
This column is NULL if this work area has not (yet) spilled to disk.

TABLESPACE
Tablespace name for the temporary segment created on behalf of this work area.
This column is NULL if this work area has not (yet) spilled to disk.

SEGRFNO#
Relative file number within the tablespace for the temporary segment created on behalf of this work area.
This column is NULL if this work area has not (yet) spilled to disk.

SEGBLK#
Block number for the temporary segment created on behalf of this work area.
This column is NULL if this work area has not (yet) spilled to disk.

V$SQL_WORKAREA_HISTOGRAM
V$SQL_WORKAREA_HISTOGRAM displays the cumulative work area execution statistics (cumulated since instance startup) for different work area groups. The work areas are
split into 33 groups based on their optimal memory requirements with the requirements increasing in powers of two. That is, work areas whose optimal requirement varies
from 0 KB to 1 KB, 1 KB to 2 KB, 2 KB to 4 KB, ... and 2 TB to 4 TB.
For each work area group, the V$SQL_WORKAREA_HISTOGRAM view shows how many work areas in that group were able to run in optimal mode, how many were able to run in one
-pass mode, and finally how many ran in multi-pass mode. The DBA can take a snapshot at the beginning and the end of a desired time interval to derive the same
statistics for that interval.
LOW_OPTIMAL_SIZE
Lower bound for the optimal memory requirement of work areas included in this row (bytes)

HIGH_OPTIMAL_SIZE
Upper bound for the optimal memory requirement of work areas included in this row (bytes)
OPTIMAL_EXECUTIONS
Number of work areas with an optimal memory requirement comprised between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE which have been executed in optimal mode since
instance startup

ONEPASS_EXECUTIONS
Number of work areas with an optimal memory requirement comprised between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE which have been executed in one-pass mode since
instance startup

MULTIPASSES_EXECUTIONS
Number of work areas with an optimal memory requirement comprised between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE which have been executed in multi-pass mode since
instance startup

TOTAL_EXECUTIONS
Sum of OPTIMAL_EXECUTIONS, ONEPASS_EXECUTIONS, and MULTIPASSES_EXECUTIONS

调整PGA_AGGREGATE_TARGET
Oracle提供了两个视图来帮助调整PGA_AGGREGATE_TARGET。

V$PGA_TARGET_ADVICE
predicts how the cache hit percentage and over allocation count statistics displayed by the V$PGASTAT performance view would be impacted if the value of the
PGA_AGGREGATE_TARGET parameter is changed. The prediction is performed for various values of the PGA_AGGREGATE_TARGET parameter, selected around its current value. The
advice statistic is generated by simulating the past workload run by the instance.
The content of the view is empty if PGA_AGGREGATE_TARGET is not set. In addition, the content of this view is not updated if the STATISTICS_LEVEL parameter is set to
BASIC. Base statistics for this view are reset at instance startup and when the value of the PGA_AGGREGATE_TARGET initialization parameter is dynamically modified.
PGA_TARGET_FOR_ESTIMATE NUMBER
Value of PGA_AGGREGATE_TARGET for this prediction (in bytes)

PGA_TARGET_FACTOR NUMBER
PGA_TARGET_FOR_ESTIMATE / the current value of the PGA_AGGREGATE_TARGET parameter

ADVICE_STATUS VARCHAR2(3)
Indicates whether the advice is enabled (ON) or disabled (OFF) depending on the value of the STATISTICS_LEVEL parameter

BYTES_PROCESSED NUMBER
Total bytes processed by all the work areas considered by this advice (in bytes)
ESTD_EXTRA_BYTES_RW NUMBER
Estimated number of extra bytes which would be read or written if PGA_AGGREGATE_TARGET was set to the value of the PGA_TARGET_FOR_ESTIMATE column.
This number is derived from the estimated number and size of work areas which would run in one-pass (or multi-pass) for that value of PGA_AGGREGATE_TARGET.

ESTD_PGA_CACHE_HIT_PERCENTAGE NUMBER
Estimated value of the cache hit percentage statistic when PGA_AGGREGATE_TARGET equals PGA_TARGET_FOR_ESTIMATE. This column is derived from the above two columns and
is equal to BYTES_PROCESSED / (BYTES_PROCESSED + ESTD_EXTRA_BYTES_RW)
ESTD_OVERALLOC_COUNT NUMBER
Estimated number of PGA memory over-allocations if the value of PGA_AGGREGATE_TARGET is set to PGA_TARGET_FOR_ESTIMATE. A nonzero value means that
PGA_TARGET_FOR_ESTIMATE is not large enough to run the work area workload. Hence, the DBA should not set PGA_AGGREGATE_TARGET to PGA_TARGET_FOR_ESTIMATE since Oracle
will not be able to honor that target.

V$PGA_TARGET_ADVICE_HISTOGRAM
V$PGA_TARGET_ADVICE_HISTOGRAM predicts how statistics displayed by the V$SQL_WORKAREA_HISTOGRAM dynamic view would be impacted if the value of the PGA_AGGREGATE_TARGET
parameter is changed. This prediction is performed for various values of the PGA_AGGREGATE_TARGET parameter, selected around its current value. The advice statistic is
generated by simulating the past workload run by the instance.
The content of the view is empty if PGA_AGGREGATE_TARGET is not set. In addition, the content of this view is not updated when the STATISTICS_LEVEL initialization
parameter is set to BASIC. Base statistics for this view are reset at instance startup or when the value of the PGA_AGGREGATE_TARGET initialization parameter is
dynamically modified.
PGA_TARGET_FOR_ESTIMATE NUMBER
Value of PGA_AGGREGATE_TARGET for this prediction (in bytes)

PGA_TARGET_FACTOR NUMBER
PGA_TARGET_FOR_ESTIMATE / the current value of the PGA_AGGREGATE_TARGET parameter

ADVICE_STATUS VARCHAR2(3)
Indicates whether the advice is enabled (ON) or disabled (OFF) depending on the value of the STATISTICS_LEVEL parameter
LOW_OPTIMAL_SIZE NUMBER
Lower bound for the optimal memory requirement of work areas included in this row (in bytes)
HIGH_OPTIMAL_SIZE NUMBER
Upper bound for the optimal memory requirement of work areas included in this row (in bytes)

ESTD_OPTIMAL_EXECUTIONS NUMBER
Number of work areas with an optimal memory requirement comprised between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE which are predicted to run optimal given a value of
PGA_AGGREGATE_TARGET equal to PGA_TARGET_FOR_ESTIMATE
ESTD_ONEPASS_EXECUTIONS NUMBER
Number of work areas with an optimal memory requirement comprised between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE which are predicted to run one-pass given a value of
PGA_AGGREGATE_TARGET equal to PGA_TARGET_FOR_ESTIMATE

ESTD_MULTIPASSES_EXECUTIONS NUMBER
Number of work areas with an optimal memory requirement comprised between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE which are predicted to run multi-pass given a value of
PGA_AGGREGATE_TARGET equal to PGA_TARGET_FOR_ESTIMATE

ESTD_TOTAL_EXECUTIONS NUMBER
Sum of ESTD_OPTIMAL_EXECUTIONS, ESTD_ONEPASS_EXECUTIONS, and ESTD_MULTIPASSES_EXECUTIONS
IGNORED_WORKAREAS_COUNT NUMBER
Number of work areas with optimal memory requirement between LOW_OPTIMAL_SIZE and HIGH_OPTIMAL_SIZE ignored in the advice generation due to memory and CPU constraints

例如查询V$PGA_TARGET_ADVICE
SELECT round(PGA_TARGET_FOR_ESTIMATE/1024/1024) target_mb,
ESTD_PGA_CACHE_HIT_PERCENTAGE cache_hit_perc,
ESTD_OVERALLOC_COUNT
FROM V$PGA_TARGET_ADVICE;
The output of this query might look like the following:
TARGET_MB CACHE_HIT_PERC ESTD_OVERALLOC_COUNT
---------- -------------- --------------------
63 23 367
125 24 30
250 30 3
375 39 0
500 58 0
600 59 0
700 59 0
800 60 0
900 60 0
1000 61 0
1500 67 0
2000 76 0
3000 83 0
4000 85 0
标签: 暂无标签
oraunix

写了 199 篇文章,拥有财富 1026,被 339 人关注

转播转播 分享分享 分享淘帖
回复

使用道具

P6 | 发表于 2010-11-7 21:35:30
如果你想真正的掌握PGA,对于优化人员来说,掌握PGA是基础技能之一。
必须读懂上面的每一行。
Oracle的英文写的还算是规整。
好了,大家认真阅读吧。
日复一日的积累,你会是一个优秀的DBA。
回复

使用道具

P4 | 发表于 2012-6-5 00:27:08
谢谢!!!!
回复

使用道具

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈