Check from init.ora the value for DB_BLOCK_BUFFERS. Calculate how much this makes in bytes. Say you use block size of 8K and DB_BLOCK_BUFFERS = 5000. Then you come with a value of 40000K. The SHARED_POOL_SIZE should generally be 50% up to 150% of the calculated value. So we are now in the interval (approx.) 20M-60M. Now comes the tricky part, 20M? 40M? 60M? It depends on the amount of stored PL/SQL (functions, packages, etc). If you have a lot of them go fot 60M shared pool. There are Oracle DBs without any stored procedures. Then you might downsize your shared pool to even 10-15% of the calculated value based on DB_BLOCK_BUFFERS.
What happens when I know that my buffer cache is not enough? What I mean is, because of poorly written SQL's and poor indexing done on a legacy system, a lot of full table scans are taking place and my buffer cache hit ratio is 50-60%. How do I go about calculating the right size of the SGA?
I am in the process of fixing the full table scan problems but till then???
What happens when I know that my buffer cache is not enough? What I mean is, because of poorly written SQL's and poor indexing done on a legacy system, a lot of full table scans are taking place and my buffer cache hit ratio is 50-60%. How do I go about calculating the right size of the SGA?
I am in the process of fixing the full table scan problems but till then???
Thanks,
Nizar
Increase first DB_BLOCK_BUFFERS until
select 1 - (phy.value / (cur.value + con.value)) "BUFFER HIT RATIO (> 0.90 OK)"
from v$sysstat cur, v$sysstat con, v$sysstat phy
where cur.name = 'db block gets'
and con.name = 'consistent gets'
and phy.name = 'physical reads';
returns more than 0.9 There should be some activity in the DB in order to get the correct ratio. It might take some days to get the BUFFER HIT RATIO in the high 90s. How big is your DB, how much RAM do you have and what is the current value of DB_BLOCK_BUFFERS?
Ones you fixed the buffer's number, you can estimate the proper size of the shared pool.
SELECT SUM(sharable_mem)
FROM v$sqlarea
WHERE executions > 5
/
SELECT SUM(250 * users_opening)
FROM v$sqlarea
/
SELECT SUM(sharable_mem)
FROM v$db_object_cache
WHERE type = 'PACKAGE'
or type = 'PACKAGE BODY'
or type = 'FUNCTION'
or type = 'PROCEDURE'
/
SELECT 250 * value bytes_per_user
FROM v$sesstat s, v$statname n
WHERE s.statistic# = n.statistic#
AND n.name = 'opened cursors current'
AND s.sid = 15
/
sum all is your shared pol usage
DONT set your shared pool too big if itīs not necessary, you will increase library cache lock latch contention if you do so
Bookmarks