Estimation de la PGA initiale avant recommandation de l'advisor
OLTP: PGA_AGGREGATE_TARGET = (total_mem * 80%) * 20%
DSS: PGA_AGGREGATE_TARGET = (total_mem * 80%) * 50%
Sinon pour voir votre PGA et ses besoins:
set lines 200
col OPERATION format a20
SELECT
to_number(decode(SID, 65535, NULL, SID)) sid,
operation_type OPERATION,
trunc(WORK_AREA_SIZE/1024/1024) WSIZE,
trunc(EXPECTED_SIZE/1024/1024) ExpectedSize,
trunc(ACTUAL_MEM_USED/1024/1024) ActualMemUsed,
trunc(MAX_MEM_USED/1024/1024) Mem_Max_Util,
number_passes Pass,
trunc(TEMPSEG_SIZE/1024/1024) TSIZE
FROM v$sql_workarea_active
ORDER BY 1,2;
Si EXPECTED_SIZE < ACTUAL_MEM_USED Trop
Si EXPECTED_SIZE > ACTUAL_MEM_USED Pas assez
Sort
-- Localisation des tris
SELECT name, value
FROM v$sysstat
WHERE name like 'sort%'
UNION
-- % de Tri sur Disque
SELECT 'disk sort percent', TRUNC(a.value/(a.value+b.value)*100,2)
FROM v$sysstat a, v$sysstat b
WHERE a.name = 'sorts (disk)'
AND b.name = 'sorts (memory)'
UNION
-- Lignes par tri
SELECT 'rows per sort', TRUNC(c.value/(a.value+b.value))
FROM v$sysstat a, v$sysstat b, v$sysstat c
WHERE a.name = 'sorts (disk)'
AND b.name = 'sorts (memory)'
AND c.name = 'sorts (rows)';
Le ratio doit être < 5% si OLTP sinon agrandir la SORT_AREA_SIZE
Le ratio doit être < 1% si OLTP sinon agrandir la SORT_AREA_SIZE
Hash
SELECT s.sid, u.segtype, blocks
FROM v$sort_usage u, v$session s
WHERE u.session_addr = s.saddr;
SID SEGTYPE BLOCKS
---------- --------- ----------
8 HASH 13311
22 SORT 128
40 HASH 13311
44 HASH 13311
Si on a beaucoup de has join, augmenter hash_area_size.
Si on a beaucoup de sort join, augmenter sort_area_size.