1、将sga锁定在物理内存中,设置参数lock_sga=true:
sql>alter system set lock_sga=true scope=spfile;
2、启动数据库实例时,将整个sga锁定在物理内存中:
sql>alter system set pre_page_sga=true scope=spfile;
3、启动sga的自动管理:
参数sga_target 就是决定是否使用sga自动管理,该参数的默认值和系统的sga_max_size 一样大,当参数值不为0时,就启动了sga的自动管理。
SQL> show parameter lock_sga
SQL> show parameter sga_target
4、将程序常驻内存,创建dbms_shared_pool软件包:
sql>@/u01/oracle/product/10.2.0/rdbms/admin/dbmspool.sql;
5、查询hr用户下的过程:
sql>conn hr/oracle
sql>select object_name from user_objects where object_type='PROCEDURE';6、将过程secure_dml常驻内存:
sql>execute dbms_shared_pool.keep('HR.SECURE_DML');
将用户hr的过程secure_dml 清除出内存:
sql>execute dbms_shared_pool.unkeep('HR.SECURE_DML');