我是靠谱客的博主 活泼板栗,最近开发中收集的这篇文章主要介绍浅析PGA,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

作用:
会话数据排序 (sort, hash_join,  group-by, bitmap merge and bitmap index create )( 不够就去 temp space ); 会话权限审核,可以快速读取权限 保存;绑定变量; 游标区

构成:

主要由三个相关区域组成:
private SQL area:holds information about a parsed SQL statement and other session-specific information for processing
session Memory:hold a session's variables(logon information) and other information related to the session
SQL Work Areas:A work area is a private allocation of PGA memory used for memory-intensive operations

PGA管理
手动管理和自动管理,但是推荐使用自动管理方式,这样可以避免我们在手动配置时对数据库的不了解,造成对值得各个参数设置不标准

重要参数:
PGA_AGGREGATE_TARGET: 所有 session 一共使用的最大 PGA 上限
在OLTP系统中,典型PGA内存设置应该是总内存的较小部分(20%),剩下的80%分配给SGA
在DSS系统中,由于会运行一些很大的查询,典型的PGA内存最多分配70%的内存
select namevalue/1024/1024 MB from v$parameter where name ='pga_aggregate_target';
_pga_max_size( 隐藏参数 ): 每个 session 只能用到一半 _pga_max_size 值大小的内存

统计命中率
select pga_target_for_estimate/1024/1024 ||'M' "Estimate PGA Target",estd_pga_cache_hit_percentage "Cache Hit(%)",estd_extra_bytes_rw/1024/1024 ||'M' "Extra Read/Write",estd_overalloc_account "Over alloc count" 
from v$pga_target_adivce;

查看当前数据库SQL连接
select spid,program,pga_max_mem,pga_alloc_mem,pga_used_mem,pga_freeable_mem from v$process where program like '%orcl%';

查看PGA各个区域使用情况
select p.program,p.spid,pm.category,pm.allocated,pm.used,pm.max_allocated 
from v$process p,v$process_memory pm 
where p.pid=pm.pid
and p.spid in (select spid from v$process where addr in 
(select paddr from v$session where sid in
(select distinct sid from v$mystat)
));

最后

以上就是活泼板栗为你收集整理的浅析PGA的全部内容,希望文章能够帮你解决浅析PGA所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部