Query to check the PGA Space Consumption.
select name, value
from v$sesstat ss, v$statname sn
where sn.name like '%ga memory%'
and ss.statistic# = sn.statistic#
5 and ss.sid =&i;
Enter value for i: 1001
old 5: and ss.sid =&i
new 5: and ss.sid =1001
NAME VALUE
---------------------------------------------------------------- ----------
session uga memory 442688
session uga memory max 3931248
session pga memory 1527080
session pga memory max 5655848
select category,allocated,used,max_allocated
from v$process_memory
where pid = (
select pid
from v$process
where addr = (
select paddr
from V$session
where sid = &i
)
)
12 ;
Enter value for i: 1001
old 9: where sid = &i
new 9: where sid = 1001
CATEGORY ALLOCATED USED MAX_ALLOCATED
--------------- ---------- ---------- -------------
SQL 1000 184 42864
PL/SQL 30584 25568 30584
Other 1505168 1505168
select pga_used_mem,pga_alloc_mem,pga_freeable_mem,pga_max_mem
from v$process
where addr = (
select paddr
from V$session
where sid =&i
)
8 ;
Enter value for i: 1001
old 6: where sid =&i
new 6: where sid =1001
PGA_USED_MEM PGA_ALLOC_MEM PGA_FREEABLE_MEM PGA_MAX_MEM
------------ ------------- ---------------- -----------
1425760 1536752 0 1536752
test.db.com:test>select NAME,VALUE,UNIT from v$pgastat
2 order by VALUE desc;
NAME VALUE UNIT
---------------------------------------------------------------- ---------- ------------
bytes processed 7.3362E+14 bytes
PGA memory freed back to OS 2.8569E+14 bytes
extra bytes read/written 4.8353E+12 bytes
maximum PGA allocated 1.1684E+10 bytes
aggregate PGA target parameter 6291456000 bytes
total PGA allocated 5351336960 bytes
total PGA inuse 4372375552 bytes
maximum PGA used for auto workareas 3277716480 bytes
aggregate PGA auto target 1727096832 bytes
total freeable PGA memory 666107904 bytes
global memory bound 629145600 bytes
maximum PGA used for manual workareas 6993920 bytes
recompute count (total) 3452863
total PGA used for auto workareas 2445312 bytes
max processes count 1000
over allocation count 1000
process count 779
cache hit percentage 99.34 percent
total PGA used for manual workareas 0 bytes
19 rows selected.
select n.name,sum(s.value) value
from v$sesstat s,v$statname n
where s.STATISTIC#=n.STATISTIC#
and n.name like 'workarea executions%'
5 group by n.name;
NAME VALUE
---------------------------------------------------------------- ----------
workarea executions - multipass 0
workarea executions - optimal 2302483
workarea executions - onepass 104
NOTE.
When a PGA fails to handle the sorting operation of a session then it use the temp segment space, this phenomena known as One Pass and if PGA looks the temp segment consistently to fulfill the session's sort operation then it called as Multi Pass.
select SID,OPERATION_TYPE,EXPECTED_SIZE/1024,ACTUAL_MEM_USED/1024,MAX_MEM_USED/1024,NUMBER_PASSES,TEMPSEG_SIZE/1024
2 from v$sql_workarea_active;
SID OPERATION_TYPE EXPECTED_SIZE/1024 ACTUAL_MEM_USED/1024 MAX_MEM_USED/1024 NUMBER_PASSES TEMPSEG_SIZE/1024
----- -------------------- ------------------ -------------------- ----------------- ------------- -----------------
1390 GROUP BY (SORT) 1206 1054 1054 0
1362 HASH-JOIN 1675 563 563 0
References.
http://jonathanlewis.wordpress.com/2009/06/07/pga-leaks/
select name, value
from v$sesstat ss, v$statname sn
where sn.name like '%ga memory%'
and ss.statistic# = sn.statistic#
5 and ss.sid =&i;
Enter value for i: 1001
old 5: and ss.sid =&i
new 5: and ss.sid =1001
NAME VALUE
---------------------------------------------------------------- ----------
session uga memory 442688
session uga memory max 3931248
session pga memory 1527080
session pga memory max 5655848
select category,allocated,used,max_allocated
from v$process_memory
where pid = (
select pid
from v$process
where addr = (
select paddr
from V$session
where sid = &i
)
)
12 ;
Enter value for i: 1001
old 9: where sid = &i
new 9: where sid = 1001
CATEGORY ALLOCATED USED MAX_ALLOCATED
--------------- ---------- ---------- -------------
SQL 1000 184 42864
PL/SQL 30584 25568 30584
Other 1505168 1505168
select pga_used_mem,pga_alloc_mem,pga_freeable_mem,pga_max_mem
from v$process
where addr = (
select paddr
from V$session
where sid =&i
)
8 ;
Enter value for i: 1001
old 6: where sid =&i
new 6: where sid =1001
PGA_USED_MEM PGA_ALLOC_MEM PGA_FREEABLE_MEM PGA_MAX_MEM
------------ ------------- ---------------- -----------
1425760 1536752 0 1536752
test.db.com:test>select NAME,VALUE,UNIT from v$pgastat
2 order by VALUE desc;
NAME VALUE UNIT
---------------------------------------------------------------- ---------- ------------
bytes processed 7.3362E+14 bytes
PGA memory freed back to OS 2.8569E+14 bytes
extra bytes read/written 4.8353E+12 bytes
maximum PGA allocated 1.1684E+10 bytes
aggregate PGA target parameter 6291456000 bytes
total PGA allocated 5351336960 bytes
total PGA inuse 4372375552 bytes
maximum PGA used for auto workareas 3277716480 bytes
aggregate PGA auto target 1727096832 bytes
total freeable PGA memory 666107904 bytes
global memory bound 629145600 bytes
maximum PGA used for manual workareas 6993920 bytes
recompute count (total) 3452863
total PGA used for auto workareas 2445312 bytes
max processes count 1000
over allocation count 1000
process count 779
cache hit percentage 99.34 percent
total PGA used for manual workareas 0 bytes
19 rows selected.
select n.name,sum(s.value) value
from v$sesstat s,v$statname n
where s.STATISTIC#=n.STATISTIC#
and n.name like 'workarea executions%'
5 group by n.name;
NAME VALUE
---------------------------------------------------------------- ----------
workarea executions - multipass 0
workarea executions - optimal 2302483
workarea executions - onepass 104
NOTE.
When a PGA fails to handle the sorting operation of a session then it use the temp segment space, this phenomena known as One Pass and if PGA looks the temp segment consistently to fulfill the session's sort operation then it called as Multi Pass.
select SID,OPERATION_TYPE,EXPECTED_SIZE/1024,ACTUAL_MEM_USED/1024,MAX_MEM_USED/1024,NUMBER_PASSES,TEMPSEG_SIZE/1024
2 from v$sql_workarea_active;
SID OPERATION_TYPE EXPECTED_SIZE/1024 ACTUAL_MEM_USED/1024 MAX_MEM_USED/1024 NUMBER_PASSES TEMPSEG_SIZE/1024
----- -------------------- ------------------ -------------------- ----------------- ------------- -----------------
1390 GROUP BY (SORT) 1206 1054 1054 0
1362 HASH-JOIN 1675 563 563 0
References.
http://jonathanlewis.wordpress.com/2009/06/07/pga-leaks/
No comments:
Post a Comment