Tuning The PGA
Tuning The PGA
By Ahmed Baraka
Instance
SGA
Buffer Shared Pool Java Large Redo Log
Cache Pool Pool Buffer
Library Cache
PGA
SQL Work Private Session
Area SQL Area Memory
sort operations •
hash joins • SQL Work Area Server
bitmap operators • Session Memory Private SQL A. Process
• Session variables
Instance PGA
Instance PGA
The size of a work area is An extra pass is performed Multiple passes over
large enough to over part of the input data the input data are
accommodate the input data needed
• WORKAREA_SIZE_POLICY
- Is automatically set to AUTO when PGA_AGGREGATE_TARGET is set to a
positive value
- Is automatically set to MANUAL when PGA_AGGREGATE_TARGET is set to
zero
- Can be set at the session level
• DSS:
- 20% SGA
- 80% PGA
V$SQL_WORKAREA
V$SQL V$SQL_PLAN
V$SQL_WORKAREA_ACTIVE
V$PGASTAT V$SYSSTAT
V$PROCESS_MEMORY V$SQL_WORKAREA_HISTOGRAM
Statistic Description
aggregate PGA shows the current value of the PGA_AGGREGATE_TARGET
target parameter parameter.
aggregate PGA the amount of PGA memory Oracle Database can use for work
auto target areas that are running in automatic mode
total PGA the current amount of PGA memory allocated by the database
allocated instance.
over allocation How many times the instance needed to exceed the size set to the
count PGA_AGGREGATE_TARGET
cache hit The ratio of optimal executions
percentage
• Symptoms:
- Undersized PGA finding by ADDM
- Instance events:
workarea executions – multipass
Number of sort (disk)
- Top wait events: direct path write temp
- Low 'cache hit percentage' in V$PGASTAT