Saturday, April 26, 2008

ASH size

Sizing ASH
ASH is actually a first-in, first-out (FIFO) buffer in memory that collects statistics on current session
activity. These statistics are gathered by extracting samples from V$SESSION every second.
Because this kind of frequent gathering could quickly overwhelm the system, ASH continually
ages out old statistics to make room for new ones.
ASH resides in the System Global Area (SGA) and its size is fixed for the lifetime of the
instance. Its size is calculated using the following calculation:
The lesser of:
 Total number of CPUs × 2MB of memory
 5 percent of the Shared Pool size
So, on a 16-processor system, with a Shared Pool size of 500MB, the size of the ASH buffer
could be calculated as follows:
 ASH desired size: 16 × 2MB = 32MB
 5 percent of Shared Pool size: 500MB × 5% = 25MB
 Final ASH size: 25MB
Using the Automatic Workload Repository (AWR) 265
Because the desired ASH size exceeded 5 percent of the Shared Pool size, Oracle will choose
the lesser size. There are, therefore, only two ways to increase the ASH buffer size:
 Increase the number of CPUs.
 Increase the Shared Pool size.

select * from v$sgastat where name like '%ASH%';