Oracle Shared Pool Techniques
Vendredi 2 mars 2007Concept:
The oracle Shared pool is the area where things (objects) are loaded for execution compilation (all database operations).
Pinning refers to the concept of keeping an object in the shared pool area.
The main reason to keep objects in shared memory is to improve system performance.
If the object is a code object such as a procedure, package, etc., you can pin the code in the cache to stop it from being removed.
How about you try to find out which objects are being loaded way too many times into the shared pool ?
Example:
/* The following query lists Owner / Object_name / Number_of_Loads*/
select OWNER,
NAME||’ - ‘||TYPE object,
LOADS
from v$db_object_cache
where LOADS > 3
and type in (’PACKAGE’,'PACKAGE BODY’,'FUNCTION’,'PROCEDURE’)
order by LOADS desc;
Using the Query above you and other factors (such as the size you have allocated to you shared pool) you can find that paramters in
$ORACLE_HOME/dbs/init.ora.
It should be listed such as:
shared_pool_size = 524288000 # 500M
Pinning Method:
connect sys/passwd
execute dbms_shared_pool.keep(OWNER_NAME.OBJECT_NAME, ‘FLAG_TYPE’);
FLAG_TYPE =
‘P’ for procedure/package/function
‘R’ for trigger
‘Q’ for sequence
‘T’ for type
Notes:
The package dbms_shared_pool must be created by running the following scripts as sys.
dbmspool.sql
-Thanks for reading.




Index du Blog














