oltp系统参考(要设置好,防止内存抖动): sga=内存*80%*80% pga=内存*80%*20%
1、通过spfile修改
(1)使用SYS用户以SYSDBA身份登录系统
(2)查看修改前sga_max_size,sga_target大小
show parameter sga_max_size;
show parameter sga_target;
(3)修改参数
alter system set sga_max_size=1600m scope=spfile;
alter system set sga_target=1600m scope=spfile;
备注:alter system set sga_target=1600m scope=spfile;后面必须要加scope=spfile,指定修改Spfile。否则会报“无法修改初始化参数”的错。
修改pga
alter system set pga_aggregate_target=800m scope=spfile;
2、通过pfile参数修改
(1)创建pfile,创建后在c:/oracle/product/10.1.0/db_1/database目录下面多1个文件INITorcl.ORA
SQL>create pfile from spfile
(2)修改pfile内容,用写字板打开文件
修改后主要内容为 sga_target=1700000000(1.7G左右) lock_sga=true pga_aggregate_tagert=250000000(250M左右) workarea_size_policy=auto pre_page_sga=true sga_max_size=1720000000(1.72G左右)
(3)根据pfile启动数据库
SQL>startup pfile='c:/oracle/product/10.1.0/db_1/database/INITorcl.ORA'
其他
sga pga大小show parameter memory;
show parameter sga;
show parameter pga;
--如果要防止高并发情况下的内存抖动,考虑固定内存
alter system set memory_target=4096m scope=spfile;
alter system set memory_max_target=4096m scope=spfile;
alter system set sga_target=3027m scope=spfile;
alter system set sga_max_size=3027m scope=spfile;
alter system set pga_aggregate_target=1024m scope=spfile;