创建该存储过程
SQL>@...\dbmspool.sql
查看该包是否创建
SQL>desc dbms_shared_pool
创建触发器
SQL>conn hr/hr;
SQL>CREATE OR REPLACE TRIGGER "HR".HR_START_TR AFTER
STARTUP ON DATABASE
begin
sys.DBMS_SHARED_POOL.KEEP('HR.ADD_JOB_HISTORY');
end;
授权给HR
grant execute on dbms_shared_pool to HR;
在关闭数据库之前验证内存中是否有add_job_history
select owner,name,type from v$db_object_cache
where owner='HR' and type='PROCEDURE';
重启数据库 再次查看下内存中是否有该存储过程
select owner,name,type from v$db_object_cache
where owner='HR' and type='PROCEDURE';
本文转自东方之子736651CTO博客,原文链接: http://blog.51cto.com/ecloud/1101569,如需转载请自行联系原作者