But be careful!!
A reader, May 02, 2007 - 6:07 am UTC
In case of Shared Server Architecture, the PGA_AGGREGATE_TARGET is ignored. It is only used when the database is in Dedicated mode.
May 02, 2007 - 9:07 am UTC
in 9i, but not so in 10g.
A reader, May 08, 2007 - 10:25 pm UTC
Thanks Tom!
You said above:
And if your session exceeds that - it is just like exceeding the sort area size - it'll spill into temp.
But in another thread¿sorry I can't find it) ¿you said the total PGA size can exceed the pga_target_size because of a larging sorting...
I think big sorting will used the left os RAM not temp ts.
Sorry ,But I am quite confusing.
Waiting for your aply.
Regards.
Alan
May 11, 2007 - 9:24 am UTC
if your SESSION exceeds the dynamic memory allocated to it, it'll spill to temp.
if the sum(sessions dynamic work areas) exceed the pga aggregate target - well, that is all you can say - they exceeded your target.
sessions spill into temp individually.
A reader, May 08, 2007 - 10:26 pm UTC
Thanks Tom!
You said above:
And if your session exceeds that - it is just like exceeding the sort area size - it'll spill into temp.
But in another thread¿sorry I can't find it) ¿you said the total PGA size can exceed the pga_target_size because of a large sorting...
I think big sorting will used the left os RAM not temp ts.
Sorry ,But I am quite confusing.
Waiting for your aply.
Regards.
Alan
size of pga_aggregate_target
Branka, May 31, 2007 - 10:52 am UTC
How to know if size of pga_aggregate_target in my database is good? (oracle 9i)
I run selects below:
select name,value from v$sysstat where name like 'workarea executions%';
NAME VALUE
------------------------------ ----------
workarea executions - optimal 19334639
workarea executions - onepass 174
workarea executions - multipass 0
select * from v$pgastat;
NAME VALUE UNIT
---------------------------------------- ---------- ------------
aggregate PGA target parameter 1048576000 bytes
aggregate PGA auto target 898080768 bytes
global memory bound 52428800 bytes
total PGA inuse 50969600 bytes
total PGA allocated 101782528 bytes
maximum PGA allocated 205692928 bytes
total freeable PGA memory 16711680 bytes
PGA memory freed back to OS 2.3360E+10 bytes
total PGA used for auto workareas 24576 bytes
maximum PGA used for auto workareas 84390912 bytes
total PGA used for manual workareas 0 bytes
maximum PGA used for manual workareas 0 bytes
over allocation count 0
bytes processed 1.9707E+11 bytes
extra bytes read/written 9.1902E+10 bytes
cache hit percentage 68.19 percent
select round(pga_target_for_estimate/1024/1024) as target_size_MB,
bytes_processed,estd_extra_bytes_rw as est_rw_extra_bytes,
estd_pga_cache_hit_percentage as est_hit_pct,
estd_overalloc_count as est_overalloc
from v$pga_target_advice
TARGET_SIZE_MB BYTES_PROCESSED EST_RW_EXTRA_BYTES EST_HIT_PCT EST_OVERALLOC
-------------- --------------- ------------------ ----------- ---------
125 3.4378E+10 3.1062E+10 53 0
250 3.4378E+10 3.0998E+10 53 0
500 3.4378E+10 3.0998E+10 53 0
750 3.4378E+10 3.0998E+10 53 0
1000 3.4378E+10 8768714752 80 0
1200 3.4378E+10 8737902592 80 0
1400 3.4378E+10 8737902592 80 0
1600 3.4378E+10 8737902592 80 0
1800 3.4378E+10 8737902592 80 0
2000 3.4378E+10 8737902592 80 0
3000 3.4378E+10 8737902592 80 0
4000 3.4378E+10 8737902592 80 0
6000 3.4378E+10 8737902592 80 0
8000 3.4378E+10 8737902592 80 0
I also don¿t know why cache hit percentage is only 68.19 percent
May 31, 2007 - 10:55 am UTC
use statspack, it'll have a nice report for you with recommendations.
using a fixed width font so you can read it :)
pga_agregate_target
Branka, May 31, 2007 - 11:45 am UTC
Here is Statspack result. It seam that size iz OK, but Estd PGA Cache Hit % is 80.0. Why is that?
PGA Aggr Target Stats for DB: PACRP Instance: PACRP Snaps: 827 -828
-> B: Begin snap E: End snap (rows dentified with B or E contain data
which is absolute i.e. not diffed over the interval)
-> PGA cache hit % - percentage of W/A (WorkArea) data processed only in-memory
-> Auto PGA Target - actual workarea memory target
-> W/A PGA Used - amount of memory used for all Workareas (manual + auto)
-> %PGA W/A Mem - percentage of PGA memory allocated to workareas
-> %Auto W/A Mem - percentage of workarea memory controlled by Auto Mem Mgmt
-> %Man W/A Mem - percentage of workarea memory under manual control
PGA Cache Hit % W/A MB Processed Extra W/A MB Read/Written
--------------- ---------------- -------------------------
100.0 355 0
%PGA %Auto %Man
PGA Aggr Auto PGA PGA Mem W/A PGA W/A W/A W/A Global Mem
Target(M) Target(M) Alloc(M) Used(M) Mem Mem Mem Bound(K)
- --------- --------- ---------- ---------- ------ ------ ------ ----------
B 1,000 855 99.5 0.0 .0 .0 .0 51,200
E 1,000 850 105.0 0.0 .0 .0 .0 51,200
-------------------------------------------------------------
PGA Aggr Target Histogram for DB: PACRP Instance: PACRP Snaps: 827 -828
-> Optimal Executions are purely in-memory operations
Low High
Optimal Optimal Total Execs Optimal Execs 1-Pass Execs M-Pass Execs
------- ------- -------------- ------------- ------------ ------------
2K 4K 54,811 54,811 0 0
4K 8K 1,724 1,724 0 0
8K 16K 1,040 1,040 0 0
16K 32K 344 344 0 0
32K 64K 618 618 0 0
64K 128K 160 160 0 0
128K 256K 174 174 0 0
256K 512K 47 47 0 0
512K 1024K 84 84 0 0
1M 2M 6 6 0 0
-------------------------------------------------------------
PGA Memory Advisory for DB: PACRP Instance: PACRP End Snap: 828
-> When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value
where Estd PGA Overalloc Count is 0
Estd Extra Estd PGA Estd PGA
PGA Target Size W/A MB W/A MB Read/ Cache Overalloc
Est (MB) Factr Processed Written to Disk Hit % Count
---------- ------- ---------------- ---------------- -------- ----------
125 0.1 33,461.6 29,623.4 53.0 0
250 0.3 33,461.6 29,561.8 53.0 0
500 0.5 33,461.6 29,561.8 53.0 0
750 0.8 33,461.6 29,561.8 53.0 0
1,000 1.0 33,461.6 8,362.5 80.0 0
1,200 1.2 33,461.6 8,333.1 80.0 0
1,400 1.4 33,461.6 8,333.1 80.0 0
1,600 1.6 33,461.6 8,333.1 80.0 0
1,800 1.8 33,461.6 8,333.1 80.0 0
2,000 2.0 33,461.6 8,333.1 80.0 0
3,000 3.0 33,461.6 8,333.1 80.0 0
4,000 4.0 33,461.6 8,333.1 80.0 0
6,000 6.0 33,461.6 8,333.1 80.0 0
8,000 8.0 33,461.6 8,333.1 80.0 0
-------------------------------------------------------------
May 31, 2007 - 2:19 pm UTC
man oh man.
*using a fixed width font* (eg: ala the CODE BUTTON)
I'm not even going to try to mentally line up these columns.
This however has prompted me to put in a change request for the asktom software. User supplied content is going to be entirely fixed width fonts again soon.
freeing memory,
A reader, May 31, 2007 - 12:10 pm UTC
I have heard that there is a Oracle package that can free up the memory (I guess it is PGA) that are filled up by stuff executed by the cursors.
What is that package? How does it work?
I have seen packages failing after sometime due to ORA-04030 error. Can we use this package during the execution to prevent memory related error?
Thanks,
May 31, 2007 - 2:19 pm UTC
if you have access to Expert One on One Oracle and or Expert Oracle database architecture, I cover that
and explain why it is a very good placebo sort of tool, makes some people feel better.
Shared/Dedicated Architecture in 10g
Sergey, June 01, 2007 - 8:36 am UTC
Dear Tom,
could you explain a little your response:
"Followup May 2, 2007 - 9am US/Eastern:
in 9i, but not so in 10g."
I haven't seen any changes about sort algorithm in 10g in Docu Library.
Thanks in advance.
Sergey
June 01, 2007 - 1:07 pm UTC
pga_agregate_target
Branka, June 02, 2007 - 11:24 am UTC
Here is Statspack result. It seam that size iz OK, but Estd PGA Cache Hit % is 80.0. Why is that?
PGA Aggr Target Stats for DB: PACRP Instance: PACRP Snaps: 827 -828
-> B: Begin snap E: End snap (rows dentified with B or E contain data
which is absolute i.e. not diffed over the interval)
-> PGA cache hit % - percentage of W/A (WorkArea) data processed only in-memory
-> Auto PGA Target - actual workarea memory target
-> W/A PGA Used - amount of memory used for all Workareas (manual + auto)
-> %PGA W/A Mem - percentage of PGA memory allocated to workareas
-> %Auto W/A Mem - percentage of workarea memory controlled by Auto Mem Mgmt
-> %Man W/A Mem - percentage of workarea memory under manual control
PGA Cache Hit % W/A MB Processed Extra W/A MB Read/Written
--------------- ---------------- -------------------------
100.0 355 0
%PGA %Auto %Man
PGA Aggr Auto PGA PGA Mem W/A PGA W/A W/A W/A Global Mem
Target(M) Target(M) Alloc(M) Used(M) Mem Mem Mem Bound(K)
- --------- --------- ---------- ---------- ------ ------ ------ ----------
B 1,000 855 99.5 0.0 .0 .0 .0 51,200
E 1,000 850 105.0 0.0 .0 .0 .0 51,200
-------------------------------------------------------------
PGA Aggr Target Histogram for DB: PACRP Instance: PACRP Snaps: 827 -828
-> Optimal Executions are purely in-memory operations
Low High
Optimal Optimal Total Execs Optimal Execs 1-Pass Execs M-Pass Execs
------- ------- -------------- ------------- ------------ ------------
2K 4K 54,811 54,811 0 0
4K 8K 1,724 1,724 0 0
8K 16K 1,040 1,040 0 0
16K 32K 344 344 0 0
32K 64K 618 618 0 0
64K 128K 160 160 0 0
128K 256K 174 174 0 0
256K 512K 47 47 0 0
512K 1024K 84 84 0 0
1M 2M 6 6 0 0
-------------------------------------------------------------
PGA Memory Advisory for DB: PACRP Instance: PACRP End Snap: 828
-> When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value
where Estd PGA Overalloc Count is 0
Estd PGA Cache Hit % is 80.0
Estd Extra Estd PGA Estd PGA
PGA Target Size W/A MB W/A MB Read/ Cache Overalloc
Est (MB) Factr Processed Written to Disk Hit % Count
---------- ------- ---------------- ---------------- -------- ----------
125 0.1 33,461.6 29,623.4 53.0 0
250 0.3 33,461.6 29,561.8 53.0 0
500 0.5 33,461.6 29,561.8 53.0 0
750 0.8 33,461.6 29,561.8 53.0 0
1,000 1.0 33,461.6 8,362.5 80.0 0
1,200 1.2 33,461.6 8,333.1 80.0 0
1,400 1.4 33,461.6 8,333.1 80.0 0
1,600 1.6 33,461.6 8,333.1 80.0 0
1,800 1.8 33,461.6 8,333.1 80.0 0
2,000 2.0 33,461.6 8,333.1 80.0 0
3,000 3.0 33,461.6 8,333.1 80.0 0
4,000 4.0 33,461.6 8,333.1 80.0 0
6,000 6.0 33,461.6 8,333.1 80.0 0
8,000 8.0 33,461.6 8,333.1 80.0 0
June 03, 2007 - 5:46 pm UTC
because the % column is a function of the prior two columns
c1/(c1+c2)
and c2 != 0....
pga_agregate_target
Branka, June 03, 2007 - 11:32 pm UTC
Would % change if I increase pga_agregate_target more?
June 05, 2007 - 7:51 am UTC
it says "no" up to 8,000 mb.
Dynamic Factor
Jagjeet Singh, June 04, 2007 - 4:16 pm UTC
Hi Tom,
You said ...
>Consider the pga aggregate target a way to have the sort area size dynamically set and reset itself as the load on the system goes up and down over time.
Here I want to ask what is dynamic here ? --
As per documentation, each session will get either 5% or 100mb which is less and it would be depend upon the value of PGA_AGG. When/what got reset when system goes up and down
over time.
June 06, 2007 - 12:37 pm UTC
at most 5% or .... (and that'll vary by release as they 'tweak' this over time)
it backs off the size of the allocated workareas as the amount of PGA in use goes up (if interested in an example and you have access to my book Expert Oracle Database Architecture - I have one in there that shows the amount of memory allocated to each sort as the number of users goes from small to large)
SERVER PROCESS
Deepak, June 26, 2007 - 8:50 am UTC
Hi,
Am running 9i DB on Solaris 9 (64bit). When I configure my database for shared server connection I can see one shared server UNIX process "s000" (whan used ps -ef) getting spawned.
Similarly please describe, how can I see a "dedicated" UNIX server process by exeuting "ps -ef" when a user is connected through sqlplus with the database.
Can we see dedicated server processes spawning when users connect to the database?
Please help.
July 02, 2007 - 9:18 am UTC
[tkyte@tkyte-pc ~]$ ps -aef | grep ora10gr2
ora10gr2 3726 1 0 08:55 ? 00:00:00 ora_pmon_ora10gr2
ora10gr2 3728 1 0 08:55 ? 00:00:00 ora_psp0_ora10gr2
ora10gr2 3730 1 0 08:55 ? 00:00:00 ora_mman_ora10gr2
ora10gr2 3732 1 0 08:55 ? 00:00:00 ora_dbw0_ora10gr2
ora10gr2 3734 1 0 08:55 ? 00:00:00 ora_lgwr_ora10gr2
ora10gr2 3736 1 0 08:55 ? 00:00:00 ora_ckpt_ora10gr2
ora10gr2 3738 1 0 08:55 ? 00:00:00 ora_smon_ora10gr2
ora10gr2 3740 1 0 08:55 ? 00:00:00 ora_reco_ora10gr2
ora10gr2 3742 1 0 08:55 ? 00:00:05 ora_mmon_ora10gr2
ora10gr2 3744 1 0 08:55 ? 00:00:00 ora_mmnl_ora10gr2
ora10gr2 3746 1 0 08:55 ? 00:00:00 ora_d000_ora10gr2
ora10gr2 3748 1 0 08:55 ? 00:00:00 ora_s000_ora10gr2
ora10gr2 3754 1 0 08:55 ? 00:00:00 ora_qmnc_ora10gr2
ora10gr2 3756 1 0 08:56 ? 00:00:01 ora_q000_ora10gr2
ora10gr2 3765 1 0 08:56 ? 00:00:00 ora_cjq0_ora10gr2
ora10gr2 3776 1 0 08:56 ? 00:00:00 ora_q001_ora10gr2
tkyte 3822 3711 0 09:16 pts/1 00:00:00 grep ora10gr2
[tkyte@tkyte-pc ~]$ sqlplus /
SQL*Plus: Release 10.2.0.2.0 - Production on Mon Jul 2 09:16:54 2007
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
ops$tkyte%ORA10GR2> !ps -aef | grep ora10gr2
ora10gr2 3726 1 0 08:55 ? 00:00:00 ora_pmon_ora10gr2
ora10gr2 3728 1 0 08:55 ? 00:00:00 ora_psp0_ora10gr2
ora10gr2 3730 1 0 08:55 ? 00:00:00 ora_mman_ora10gr2
ora10gr2 3732 1 0 08:55 ? 00:00:00 ora_dbw0_ora10gr2
ora10gr2 3734 1 0 08:55 ? 00:00:00 ora_lgwr_ora10gr2
ora10gr2 3736 1 0 08:55 ? 00:00:00 ora_ckpt_ora10gr2
ora10gr2 3738 1 0 08:55 ? 00:00:00 ora_smon_ora10gr2
ora10gr2 3740 1 0 08:55 ? 00:00:00 ora_reco_ora10gr2
ora10gr2 3742 1 0 08:55 ? 00:00:05 ora_mmon_ora10gr2
ora10gr2 3744 1 0 08:55 ? 00:00:00 ora_mmnl_ora10gr2
ora10gr2 3746 1 0 08:55 ? 00:00:00 ora_d000_ora10gr2
ora10gr2 3748 1 0 08:55 ? 00:00:00 ora_s000_ora10gr2
ora10gr2 3754 1 0 08:55 ? 00:00:00 ora_qmnc_ora10gr2
ora10gr2 3756 1 0 08:56 ? 00:00:01 ora_q000_ora10gr2
ora10gr2 3765 1 0 08:56 ? 00:00:00 ora_cjq0_ora10gr2
ora10gr2 3776 1 0 08:56 ? 00:00:00 ora_q001_ora10gr2<b>
ora10gr2 3825 3824 0 09:16 ? 00:00:00 oracleora10gr2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))</b>
tkyte 3826 3824 0 09:17 pts/2 00:00:00 /bin/bash -c ps -aef | grep ora10gr2
it'll be that one in bold.