|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pinning
the Oracle packages with start-up triggers Package pinning has
become a very important part of Oracle tuning, and with the introduction
of system-level triggers in Oracle8i, we now have an easy tool to ensure
that frequently-executed PL/SQL remains cached inside the shared pool. Just like using the
KEEP pool with the data buffer caches, the pinning of packages ensures
that the specified package always remains in the Most-recently-used (MRU)
end of the data buffer. This prevents the PL/SQL from being
paged-out, and then re-parsed upon reload. The Oracle DBA controls
the size of this RAM region by setting the shared_pool_size parameter to a
value large enough to hold all of the PL/SQL. Pinning of packages
involves two areas:
You can interrogate the v$db_object_cache view to see the most frequently used packages, and automatically pin them at database start-up time (with an ON DATABASE STARTUP trigger) using dbms_shared_pool.keep. create
or replace trigger
pin_packs
after startup on database
begin
dbms_shared_pool.keep('DBMS_ALERT');
dbms_shared_pool.keep('DBMS_DDL');
dbms_shared_pool.keep('DBMS_DESCRIBE');
dbms_shared_pool.keep('DBMS_LOCK');
dbms_shared_pool.keep('DBMS_OUTPUT');
dbms_shared_pool.keep('DBMS_PIPE');
dbms_shared_pool.keep('DBMS_SESSION');
dbms_shared_pool.keep('DBMS_SHARED_POOL');
dbms_shared_pool.keep('DBMS_STANDARD');
dbms_shared_pool.keep('DBMS_UTILITY');
dbms_shared_pool.keep('STANDARD');
end; If you like Oracle
tuning, you might enjoy my latest book “Oracle Tuning: The DefinitiveReference” by Rampant TechPress. (I don’t think
it is right to charge a fortune for books!) and you can buy it right now
at this link: http://www.rampant-books.com/book_1002_oracle_tuning_definitive_reference_2nd_ed.htm
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||