一、概念
SGA指系統(tǒng)全局區(qū)域(System Global Area),是用于存儲數(shù)據(jù)庫信息的內存區(qū),該信息為數(shù)據(jù)庫進程所共享。
PGA指進程全局區(qū)域(Process Global Area),包含單個服務器進程或單個后臺進程的數(shù)據(jù)和控制信息,與幾個進程共享的SGA 正相反,PGA 是只被一個進程使用的區(qū)域,PGA 在創(chuàng)建進程時分配,在終止進程時回收。 Oracle 10g提供了PGA內存的自動管理。參數(shù)pga_aggregate_target可以指定PGA內存的最大值。當參數(shù) pga_aggregate_target大于0時,Oracle將自動管理pga內存,并且各進程的所占PGA之和,不大于 pga_aggregate_target所指定的值。
二、配置
oracle推薦OLTP(on-line Transaction Processing)系統(tǒng)oracle占系統(tǒng)總內存的80%,然后再分配80%給SGA,20%給PGA。也就是
SGA=system_total_memory*80%*80%
PGA=system_total_memory*80%*20%
三、操作
用SYS用戶以SYSDBA身份登錄系統(tǒng)
alter system set sga_max_size=2000m scope=spfile;
alter system set sga_target=2000m scope=spfile;
alter system set pga_aggregate_target=500m scope=spfile;
然后重新啟動數(shù)據(jù)庫
最后查看一下是否生效
show parameter sga_max_size;
show parameter sga_target;
show parameter pga_aggregate_target;