MEMORY MANAGEMENT
Automated SQL exec
Allocation dynamique des mémoires xxx_area_size
AUTOMATED SQL EXEC
Dispositif : Automated SQL Execution Automatic Management
Objectifs : Permettre une allocation DYNAMIQUE et SOUPLE de mémoire utilisée pour les opérations de tri, hash join, merge de bitmap et création de segments de bitmap.
Principe : Fixer une cible maximum d'espace mémoire vis à vis de laquelle Oracle allouera et désallouera pour les opérations exigeant des manipulations en mémoire (tris, bitmap merge et create, hash joins). Oracle décidera, en fonction du nombre et du volume des opérations courantes, de la taille attribuée aux nouveaux segments mémoire (work areas) évitant ou non l'utilisation du disque.
DYNAMIQUE Oracle alloue des segments de mémoire de taille variable adaptée au volume nécessaire pour l'opération. Ce sont des Work-Area, qui se situent dans la Run Time Area
SOUPLE La taille des segments de mémoire est décidée par Oracle, et juste contrainte par une valeur de paramètre d'initialisation.
Mise en oeuvre :
Ÿ Demander à Oracle d'assurer la gestion dynamique des work areas
workarea_size_policy=automatic
Ÿ Indiquer un seuil à ne jamais dépasser pour chaque segment alloué
pga_aggregate_target= nM
Le défaut de workarea_size_policy dépend de la présence ou de la valeur de pga_aggregate_target
Précautions :
Ce mécanisme ne peut être utilisé QUE POUR DES SESSIONS DEDIEES (dedicated sessions). Les "runtime" dont il est question sont bien celles qui appartiennent aux PGA dédiées, non situées en SGA.
LE CONTROLE
Les vues de monitoring et de contrôle (type désigne optimal, one-pass ou multi-pass):
Nombres d'exécutions par type V$SYSSTAT
Nombres d'exécutions par type, et par curseur V$SQL_WORKAREA
Quantités de mémoire prévues, réalisées et nombre de passes V$SQL_WORKAREA_ACTIVE
Pourcentages d'occupation de la PGA V$SQL_MEMORY_USAGE
Quantités de mémoire allouée et utilisée par process V$PROCESS
Obtenir la mémoire allouée et utilisée par un process V$PROCESS
utilisée maintenant pga_used_mem
allouée maintenant pga_alloc_mem
max allouée depuis naissance process pga_max_mem
Obtenir des statistiques sur la mémoire allouée selon divers types V$SYSSTAT(value) pour name:
Somme mémoire de toutes allocations workarea memory allocated
Somme mémoire saturée de façon évitable (multipass) workarea executions - multipass
Somme mémoire saturée de façon inévitable (onepass) workarea executions - onepass
Somme mémoire optimale (non saturée) workarea executions - optimal
Juger de la performance :
Bon 100 * optimal / (optimal + onepass + multipass) en PROGRESSION
Mauvais 100 * optimal / (optimal + onepass + multipass) en CHUTE
Obtenir des statistiques sur la mémoire utilisée par les curseurs V$SQL_WORKAREA(operation_type,total_executions,optimal_executions )
Obtenir un instantanné sur la mémoire utilisée par les processV$SQL_WORKAREA_ACTIVE(expected_size,actual_mem_used ) Suivre les consommations de mémoire PGA V$SQL_MEMORY_USAGE(value) pour name :
Total PGA inuse%
Total PGA used for auto%
Maximum%one-pass
LES NOTIONS DE "PASS" et OPTIMAL
The size of a work area can be controlled and tuned. Generally, bigger work areas can significantly improve the performance of a particular operator at the cost of higher memory consumption.
Ÿ Ideally, the size of a work area is big enough that it can accommodate the input data and auxiliary memory structures allocated by its associated SQL operator. This is known as the optimal size of a work area.
Ÿ When the size of the work area is smaller than optimal, the response time increases, because an extra pass is performed over part of the input data. This is known as the one-pass size of the work area.
Ÿ Under the one-pass threshold, when the size of a work area is far too small compared to the input data size, multiple passes over the input data are needed. This could dramatically increase the response time of the operator. This is known as the multi-pass size of the work area.
For example, a serial sort operation that needs to sort 10GB of data needs a little more than 10GB to run
optimal and at least 40MB to run one-pass. If this sort gets less that 40MB, then it must perform several passes
over the input data.
DEDICATED PGA DEDICATED PGA
PRIVATE SQL AREA PRIVATE SQL AREA PRIVATE SQL AREA
STRUCTURE MEMOIRE ORACLE
MEMOIRE
SGA
SHARED POOL LARGE POOL
DICTIONARY CACHE LIBRARY CACHE Buffers for // exec
+ ctrl structure REDO LOG BUFFER
DATA CACHE BUFFER
PERSISTENT AREA RUNTIME AREA
...
...
...
...
...
...
stack space infos sessio n stack space infos sessio n stack space infos sessio n stack space infos sessio n stack space infos sessio n BINDinfos PERSISTENT AREA
dynamicall y acquired
dynami cally acquir
ed RUN TIME AREA
UGA
SHARED SQL AREA PRIVATE SQL AREA
si large_pool_size > 300 k
SHARED PL/SQL AREA
DEDICATED PGA DEDICATED PGA
db_cache_size log_buffer shared_pool_size
Défauts :
Ÿ large_pool_s i z e 0
Ÿ db_cache_s i z e 48Mbrounded mult granul-size Ÿ log_buff e r max (512K,128K*NBCPUs)
Ÿ shared_pool_s i z e platform 32b platform 64b
8Mb 64Mb
rounded mult granul size
large_pool_size
GESTION AUTOMATIQUE DE LA PGA
Jusqu'en 8i, la mémoire allouée pour les opérations de Ÿ TRI
Ÿ MERGE DE BITMAPS Ÿ MISE A JOUR DE BITMAPS Ÿ HASH JOINS
se faisait de façon statique, DANS UNE ZONE DE LA PGA APPELEE SQL WORK AREA à travers les paramètres Ÿ SORT_AREA_SIZE
Ÿ CREATE_BITMAP_AREA_SIZE Ÿ BITMAP_MERGE_AREA_SIZE la "WORK AREA "
Ÿ qui fait partie de la RUNTIME AREA
Ÿ qui appartient à la PRIVATE SQL AREA Ÿ peut être localisée
Ÿ soit en PGA (dedicated mode) Ÿ soit en SGA (Multithreaded mode)
Ÿ Dans la LARGE POOL (si large_pool_size > 300K) Ÿ Dans la LIBRARY CACHE (si large_pool_size absent)
Ÿ ON S'INTERESSE LA UNIQUEMENT A LA PARTIE LOCALISEE DANS LES PGAs
Ÿ Avec Oracle 9i, Deux options sont offertes :
continuer en mode classique, c'est à dire en fixant la taille de chaque zone
faire assurer par Oracle même, la gestion "au mieux" de cette mémoire.
workarea_size_policy
=
manual
automatic
GESTION AUTOMATIQUE DE LA PGA
Ÿ Si WORKAREA_SIZE_POLICY =AUTOMATIC , alors
Ÿ PGA_AGGREGATE_TARGET représente une cible (par exemple, 2.5M ), qui est une valeur max de mémoire utilisée pour les PGAs à ne jamais dépasser. Cette mémoire sera prise au détriment de la SGA.
Ÿ En cas de dépassement, Oracle constitue des data-pieces qu'Oracle réparti ( Spills) dans la mémoire temporaire ( to temporary storage).
WORKAREA_SIZE_POLICY=
manual automatic
create_bitmap_area_size= nM bitmap_merge_area_size= nM sort_area_size=nM
PGA_AGGREGATE_TARGET=0M
BIEN VOIR :
Ÿ sort_area_size , hash_area_size , bitmap_merge_area_siz e et bitmap_create_area_size indiquent des tailles unitaires de segments mémoire
Ÿ pga_aggregate_target indique une taille globale à ne pas franchir pour tous ces segments mémoire (toutes ces "work areas").
zone de tri zone de tri zone de tri
"Alterable" aux niveaux SESSION et USER
BIEN VOIR :
Ÿ positionner pga_aggregate_ t a r g e t porte le défaut de workarea_size_ p o l i c y à aut o BIEN VOIR :
Ÿ le DEFAUT de workarea_size_policy dépend de la présence ou de la valeur de
pga_aggregate _ t a r g e t
va l rowid départ rowid fin
va l rowid départ rowid fin
va l rowid départ rowid fin
mem use for bitmap création
create_bitmap
_area_size= nM def 8MBcreate_bitmap
mem use for range scan
bitmap_merge
_area_size= nM def 1MBbitmap_merge
SORT_AREA_SIZE=
PGA dédiée
infos sessi o n
stack space - infos sessi o n s etat curseur
zone de tri
L'UTILISATION CLASSIQUE DE LA SQL WORK AREA
SQL WORK AREA
UNTUNABLE_MEMORY_SIZE
Restant des memory areas SENSIBLE si DSS TUNABLE_MEMORY_SIZE Mémoire consommée par des SQL
WORKING AREAS
SUIVI DE LA MEMOIRE : SYNOPTIQUE GENERAL
Nb OPTIMAL
Nb ONEPASS
Nb MULTIPASS
Nb TOTAL
Nb PASSES
MEM USED
MEM ALLOC
MEM HWM
MEM PREVUE MEM TOTALE
ESTIM OPTIMAL
ESTIM ONEPASS
Par CURSEUR
pour l'INSTANCE Par PROCESS Par WORKAREA
V$SQL_MEMORY_USAGE
value pour name:like maximum % one-pass%
V$SQL_WORKAREA
optimal_executions
V$SQL_WORKAREA
onepass_executions
V$SQL_WORKAREA
multipasses_executions
V$SQL_WORKAREA
estimated_optimal_size
V$SQL_WORKAREA
estimated_onepass_size
V$SQL_WORKAREA
total_executions
V$SYSSTAT
value pour name :=
workarea executions - optimal
V$SYSSTAT
value pour name :=
workarea executions - onepass
V$SYSSTAT
value pour name:=
workarea executions - multipass
V$SYSSTAT
value pour name:=
workarea memory allocated
V$SQL_WORKAREA_ACTIVE
number_passes
V$SQL_WORKAREA_ACTIVE
actual_mem_used
V$SQL_WORKAREA_ACTIVE
expected_size
V$SQL_WORKAREA_ACTIVE
workarea_size
V$PROCESS
pga_used_mem
V$PROCESS
pga_alloc_mem
V$PROCESS
pga_max_mem
V$SQL_MEMORY_USAGE
value pour name:like total_pga_inuse%
% onepass
STATISTIQUES SUR L'UTILISATION DE LA MEMOIRE (MONITORING "SPACE USAGE")
V$SQL_MEMORY_USAGE Ÿ value
name
"Total PGA inuse%"
V$SQL_MEMORY_USAGE Ÿ value
name
"Total PGA used for auto%"
V$SQL_MEMORY_USAGE Ÿ value
name
"Maximum % one-pass"
PGA_AGGREGATE_TARGET=nM
c
c
BIEN VOIR :
PGA used for auto représente la partie TUNEE en automatique
PGA inuse représente la PGA totale, partie
"tunable" comme partie "untunable"
MODELE DE REQUETE DE MONITORING "SPACE USAGE" NIVEAU INSTANCE
select p.value pga_aggregate_target, pga_inuse,
(pga_inuse - pga_auto) *100 / pga_inuse percent_untuned, pga_auto * 100 / pga_inuse percent_tuned, onepass_req
from (select
sum(case when name like 'Total PGA inuse%' then value els e 0 end) pga_inuse, sum(case when name like 'Total PGA used for auto%'
then value else 0 end) pga_auto, sum(case when name like 'Maximum % one-pass'
then value else 0 end) onepass_req from v$sql_memory_usage
) mem_usage,
v$parameter p
where p.name ='pga_aggregate_target' ;
Afin d'assurer de bonnes performances, il est recommandé au DBA de vérifier que
Ÿ la cible PGA reste supérieure à la taille mémoire requise pour un one-pass (transfert sur disque évitable).
Ÿ La requête suivante, qui peut être exécutée à intervalles réguliers, sert à suivre les consommations de mémoire PGA.
workarea executions - optimal
workarea memory allocated
CONTROLE DU THROUGHPUT (MONITORING "EXECUTIONS STATS")
SE P
workarea memory allocated
workarea executions - optimal
BIEN VOIR :
onepass : Dépassement évitable de Workarea
multipass : Dépassement inéévitable de Workarea
optimal : workarea a assuré entièrement son rôle (ex, tri entièrement contenu dans.)
workarea executions - multipass workarea executions - multipass
V$SYSSTAT
Ÿ class
Ÿ value
statistic#
name
"workarea executions - onepass"
V$SYSSTAT
Ÿ class
Ÿ value
statistic#
name
"workarea memory allocated"
V$SYSSTAT
Ÿ class
Ÿ value
statistic#
name
"workarea executions - optimal"
V$SYSSTAT
Ÿ class
Ÿ value
statistic#
name
"workarea executions - multipass"
workarea executions - onepass
workarea executions - onepass
MODELE DE REQUETE DE MONITORING NIVEAU INSTANCE ("EXECUTIONS STATS")
select trunc(( sum(case when name like 'work area executions - optimal' then value else 0 end) * 100)
/
( sum(case when name like 'work area executions - optimal' then value else 0 end) +
sum(case when name like 'work area executions - one pass' then value else 0 end) + sum(case when name like 'work area executions - multipass' then value else 0 end) ) optimal_percent
from V$SYSSTAT
where name like 'work area executions - %' ;
V$SYSSTAT name="work area executions - optimal"
name="work area executions - one pass"
name="work area executions - multipass"
/
(value|0) (value|0) (value|0)
+
optimal_percent
Time MAUVABON
IS
CONTROLE DE LA MEMOIRE PGA ALLOUEE ET UTILISEE PAR UN PROCESS
V$PROCESS
addr
Ÿ username OS
Ÿ spid ident OS Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance proces s
pid
PGA_MAX_MEM
PGA_ALLOC_MEM
PGA_USED_MEM
Bien voir :
Ÿ Par process pid
Ÿ On dispose des quantités de mémoire
Ÿ max allouée depuis la naissance du process pga_max_mem
Ÿ allouée sur le moment pga_alloc_mem
Ÿ utilisée sur le moment pga_used_mem
V$SESSION
saddr
Ÿ username Ÿ status
Ø activ e Ø inacti v e Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
paddr
sid
SUIVI DE LA MEMOIRE : MODELE RELATIONNEL
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address Ÿ operation_type
Ÿ sor t Ÿ hash join Ÿ group by Ÿ bitmap merge Ÿ bitmap create Ÿ polic y
Ÿ MANUAL
Ÿ AUTO
Ÿ total_executions nb fois WA active Ÿ optimal_executions nb fois WA optimale Ÿ onepass_executions nb fois WA one pass Ÿ multipasses_executions nb fois WA multipass Ÿ estimated_optimal_size
Ÿ estimated_onepass_size Ÿ serial# serial number
operation_id
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_address
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_address
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_address
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_address
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_address
V$SQL_WORKAREA_ACTIVE
sid Ÿ operation_type
Ÿ sor t Ÿ hash join Ÿ group by Ÿ bitmap merge Ÿ bitmap create Ÿ polic y
Ÿ MANUAL
Ÿ AUTO
Ÿ active_time Ÿ work_area_size Ÿ expected_size Ÿ actual_mem_used Ÿ number_passes
operation_id workarea_address
...
...
...
...
...
V$SESSION sad d r
Ÿ user n a m e Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
padd r si d
V$SESSION sad d r
Ÿ user n a m e Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
padd r si d
V$SESSION sad d r
Ÿ user n a m e Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
padd r si d
V$SESSION sad d r
Ÿ user n a m e Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
padd r si d
V$SESSION sad d r
Ÿ user n a m e Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
padd r si d
V$SESSION sad d r
Ÿ user n a m e Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user) Ÿ serial# (serial number)
padd r si d
V$PROCE S S ad d r
Ÿ username OS Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pi d
V$PROCE S S ad d r
Ÿ username OS Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pi d
V$PROCE S S ad d r
Ÿ username OS Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pi d
V$PROCE S S ad d r
Ÿ username OS Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pi d
V$PROCE S S ad d r
Ÿ username OS Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pi d
V$PROCE S S ad d r
Ÿ username OS Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pi d
CONTROLER L'UTILISATION DE LA MEMOIRE PAR CURSEUR
...
...
...
...
...
...
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address
Ÿ
operation_id
V$SQL_WORKAREA
address Ÿ operation_type
Ÿ sort Ÿ hash join Ÿ group by Ÿ bitmap merge Ÿ bitmap create
Ÿ policy
Ÿ MANUAL
Ÿ AUTO
Ÿ total_executions nb fois WA active Ÿ optimal_executi ons nb fois WA optimale Ÿ onepass_executions nb fois WA one pass Ÿ multipasses_executions nb fois WA multipass Ÿ estimated_optimal_size
Ÿ estimated_onepass_siz e
Ÿ serial# serial number
operation_id
select operation_typ e,
optimal_execution s * 100 / total_execution s "%cache"
fro m V$SQL_WORKAR E A where policy = 'AUTO'
and optimal_executions > 0 order by operation_typ e ;
REMARQUE :
Ÿ Une ligne existe par curseur.
Ÿ Un curseur donnant lieu à de multiples exécutions, nous avons de multiples work areas allouées et désallouées, pour lesquelles V$SQL_WORKAREA contient des statistiques.
REMARQUE :
Ÿ V$SQL_WORKAREA fournit infos
équivalentes à V$SYSTAT, par CURSEUR
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_addre ss AVOIR UN CLICHE SUR L'INSTANT, DES WORK AREAS ALLOUEES, VOIR LES SUR et SOUS ALLOUES
V$SESSION saddr
Ÿ username Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user)
Ÿ serial# (serial number)
paddr sid
V$SESSION saddr
Ÿ username Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user)
Ÿ serial# (serial number)
paddr sid
V$SESSION saddr
Ÿ username Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user)
Ÿ serial# (serial number)
paddr sid
V$SESSION saddr
Ÿ username Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user)
Ÿ serial# (serial number)
paddr sid
V$SESSION saddr
Ÿ username Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user)
Ÿ serial# (serial number)
paddr sid
V$SESSION saddr
Ÿ username Ÿ sta t u s
Ø active
Ø inactive
Ø killed
Ÿ user# (ident user)
Ÿ serial# (serial number)
paddr sid
V$PROCESS addr
Ÿ username OS
Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pid
V$PROCESS addr
Ÿ username OS
Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pid
V$PROCESS addr
Ÿ username OS
Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pid
V$PROCESS addr
Ÿ username OS
Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pid
V$PROCESS addr
Ÿ username OS
Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pid
V$PROCESS addr
Ÿ username OS
Ÿ spid ident OS
Ÿ serial# serial number
Ÿ pga_used_mem mémoire utilisée sur le moment
Ÿ pga_alloc_mem mémoire allouée sur le moment
Ÿ pga_max_mem mémoire max allouée depuis naissance process
pid
select total_used,
under * 100 / (total_used + 1 ) percent_under_use over * 100 / (total_used + 1 ) percent_over_use from
(select sum(case when expected_size > actual_mem_used then actuel_mem_used else 0 end ) under, sum(case when expected_size < actual_mem_used
then actuel_mem_used else 0 end ) over, sum(actual_mem_used) total_used
from v$sql_workarea_active
where policy = 'AUTO' ) usage;
cette requête produit, pour toute la mémoire gérée en automatique (policy = AUTO) Ÿ la mémoire totale allouée (somme des actual_mem_used, appelé total_used)
Ÿ le pourcentage de quantité appartenant à des work_areas sous allouées par rapport à l'attendu (calcul à partir de total_used et de la somme des work_areas dont
expected_size supérieur à actual_mem_used
Ÿ le pourcentage de quantité appartenant à des work_areas sur allouées par rapport à l'attendu (calcul à partir de total_used et de la somme des work_areas dont
expected_size inférieur à actual_mem_used
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_addre ss
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_addre ss
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_addre ss
V$SQL_WORKAREA_ACTIVE
sid Ÿ
operation_id workarea_addre ss
V$SQL_WORKAREA_ACTIVE
sid Ÿ operation_type
Ÿ sort Ÿ hash join Ÿ group by Ÿ bitmap merge Ÿ bitmap create
Ÿ policy
Ÿ MANUAL Ÿ AUTO
Ÿ active_time Ÿ work_area_size Ÿ expected_size Ÿ actual_mem_used Ÿ number_passes
operation_id workarea_addre ss BIEN VOIR :
Les écarts entre prédiction Oracle et sur ou sous allocation s'expliquent par des changements soudains d'activité
Setting PGA_AGGREGATE_TARGET Initially
The value of the PGA_AGGREGATE_TARGET initialization parameter (for example 100000 KB, 2500 MB, or 50 GB) should be set based on the total amount of memory available for the Oracle instance. This value can then be tuned and dynamically modified at the instance level. Example below illustrates a typical situation.
Example : Initial Setting of PGA_AGGREGATE_TARGET
Assume that an Oracle instance is configured to run on a system with 4 GB of physical memory. Part of that memory should be left for the operating system and other non-Oracle applications running on the same hardware system. You might decide to dedicate only 80% of the available memory to the Oracle instance, or 3.2 GB.
You must then divide the resulting memory between the SGA and the PGA.
Ÿ For OLTP systems, the PGA memory typically accounts for a small fraction of the total memory available (for example, 20%), leaving 80% for the SGA.
Ÿ For DSS systems running large, memory-intensive queries, PGA memory can typically use up to 70% of that total (up to 2.2 GB in this example).
Good initial values for the parameter PGA_AGGREGATE_TARGET might be:
Ÿ For OLTP: PGA_AGGREGATE_TARGET= (<total_mem> * 80%) * 20%
Ÿ For DSS: PGA_AGGREGATE_TARGET= (<total_mem> * 80%) * 50%
where <total_mem> is the total amount of physical memory available on the system.
In this example, with a value of <total_mem> equal to 4 GB, you can initially set PGA_AGGREGATE_TARGET to Ÿ 1600 MB for the DSS system
and to
Ÿ 655 MB for the OLTP system.
Monitoring the Performance of the Automatic PGA Memory Management
Before starting the tuning process, you need to know how to monitor and interpret the key statistics collected by Oracle to help in assessing the performance of the automatic PGA memory management component. Several dynamic performance views are available for this purpose:
Ÿ V$PGASTAT Ÿ V$PROCESS
Ÿ V$SQL_WORKAREA_HISTOGRAM Ÿ V$SQL_WORKAREA_ACTIVE Ÿ V$SQL_WORKAREA
OLT P
16 %
de la
mémoire physiq
ue disponible
DSS
40 %
de
la mémoire
physique dispon
ible