SQL> show parameter sga
SQL> alter system set sga_max_size=24G scope=spfile;
SQL> alter system set sga_target=24G scope=spfile;
SQL> shutdown immediate
SQL> startup
SQL> show parameter sga
SQL> show parameter pga
SQL> alter system set workarea_size_policy=auto scope=both;
SQL> show parameter workarea
SQL> alter system set pga_aggregate_target=8G scope=both;
pga为动态参数,不需要重启,修改完直接生效
SQL> show parameter pga
SQL> SELECT * FROM V$PGASTAT;
aggregate PGA auto target
--当前可用于自动分配了的PGA大小,应该比PGA_AGGREGATE_TARGET 小
over allocation count
--实例启动后,发生的分配次数,如果这个值大于0,就要考虑增加pga的值
3-2查看sga和pga的使用情况
SQL> select name,total,round(total-free,2) used, round(free,2) free,round((total-free)/total*100,2) pctused from
(select 'SGA' name,(select sum(value/1024/1024) from v$sga) total,
(select sum(bytes/1024/1024) from v$sgastat where name='free memory')free from dual)
union
select name,total,round(used,2)used,round(total-used,2)free,round(used/total*100,2)pctused from (
select 'PGA' name,(select value/1024/1024 total from v$pgastat where name='aggregate PGA target parameter')total,
(select value/1024/1024 used from v$pgastat where name='total PGA allocated')used from dual);