暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle内存容量规划-SGA/PGA (Oracle enterprise/RAC)

ASKTOM 2021-05-19
1050

问题描述

嗨,团队,

我想知道是否有可能根据用户会话或sql (sql_id) 找到SGA/PGA的使用量?

我的想法是根据上述模型的当前状态计划任何扩展,例如,如果我在高峰期从20个应用服务器生成200个会话,如果我们添加另外20个应用服务器,我知道他们将生成〜400个会话。因此,如果200会话消耗100 GB SGA/20 GB PGA,那么我可以将其导出为〜400会话。

尝试了不同的方法来为PGA,但SGA似乎有点麻烦,有什么想法或想法吗?

我确实可以访问性能/诊断ADDM视图。

例如。

SELECT
s.sid sid
, lpad(s.username,12) oracle_username
, lpad(s.osuser,9) os_username
, s.program session_program
, lpad(s.machine,8) session_machine
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = 'session pga memory') session_pga_memory
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = 'session pga memory max') session_pga_memory_max
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = 'session uga memory') session_uga_memory
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = 'session uga memory max') session_uga_memory_max
FROM
v$session s
ORDER BY session_pga_memory DESC


谢谢,
贾亚纳特


专家解答

对于SGA,我倾向于查看顾问视图,例如V $ SGA_TARGET_ADVICE

如果其中的建议是,即使是很小的增加也会从库缓存或数据库缓存中获得很大的好处,那么这表明它们可能会在当前工作负载下接近 “容量”。这表明随着工作量的增加,您需要大量增加。

但是,如果他们建议随着您的增长而获得最小的收益,那么这将表明工作量的增加不一定需要等效的大小跳跃。

例如,在我的 (几乎不用的) 笔记本电脑上

SQL> select * from V$SGA_TARGET_ADVICE;

  SGA_SIZE SGA_SIZE_FACTOR ESTD_DB_TIME ESTD_DB_TIME_FACTOR
---------- --------------- ------------ -------------------
      2048              .5       217086             12.7271
      2560            .625        40886               2.397
      3072             .75        18937              1.1102
      3584            .875        17437              1.0223
      4096               1        17057                   1
      4608           1.125        16873               .9892
      5120            1.25        16603               .9734
      5632           1.375        16503               .9675
      6144             1.5        16441               .9639
      6656           1.625        16412               .9622
      7168            1.75        16376               .9601
      7680           1.875        16370               .9597
      8192               2        16370               .9597


我基本上被告知增加分配几乎没有好处。

另外,您可以使用自己的业务知识。例如

-还有20个应用服务器访问 * 相同 * 代码和 * 相同 * 数据?可能不需要太多的SGA提升
-还有20多个应用服务器访问 * new * 代码和 * same * 数据?可能需要提升SGA以帮助共享池
-还有20个应用服务器访问 * new * 代码和 * new * 数据?可能需要对SGA进行更大的提升,以帮助共享池 * 和 * 缓冲区缓存


文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论