How to pin a stored procedure/functions ?
1.You can pin procedures and triggers with the dbms_shared_pool procedure.
Either procedures or packages can be pinned with the ‘P’ flag, which is
the default value (so you can leave it out). Triggers are pinned with
‘R’ and anonymous plsql blocks need any letter other than [p,P,r,R] as a
flag. Refer to dbmspool.sql for more documentation. Here is an example:
execute dbms_shared_pool.keep(owner.trigger, ‘R’)