1. 程式人生 > >oracle10g調整sga和pga大小

oracle10g調整sga和pga大小

一、概念
SGA指系統全域性區域(System Global Area),是用於儲存資料庫資訊的記憶體區,該資訊為資料庫程序所共享。
PGA指程序全域性區域(Process Global Area),包含單個伺服器程序或單個後臺程序的資料和控制資訊,與幾個程序共享的SGA 正相反,PGA 是隻被一個程序使用的區域,PGA 在建立程序時分配,在終止程序時回收。 Oracle 10g提供了PGA記憶體的自動管理。引數pga_aggregate_target可以指定PGA記憶體的最大值。當引數 pga_aggregate_target大於0時,Oracle將自動管理pga記憶體,並且各程序的所佔PGA之和,不大於 pga_aggregate_target所指定的值。

二、配置
oracle推薦OLTP(on-line Transaction Processing)系統oracle佔系統總記憶體的80%,然後再分配80%給SGA,20%給PGA。也就是
SGA=system_total_memory*80%*80%
PGA=system_total_memory*80%*20%

三、操作
用SYS使用者以SYSDBA身份登入系統
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;

然後重新啟動資料庫
最後檢視一下是否生效
show parameter sga_max_size;
show parameter sga_target;
show parameter pga_aggregate_target;