tom认为UGA不包含 sort工作区,所以下面的图都是错误的
The UGA is, in effect, your session’s state. It is memory that your session must always be able to get to. The location of the UGA is wholly dependent on how you connected to Oracle. If you connected via a shared server, then the UGA must be stored in a memory structure that every shared server process has access to—and that would be the SGA. In this way, your session can use any one of the shared servers, since any one of them can read and write your session’s data. On the other hand, if you are using a dedicated server connection, this need for universal access to your session state goes away, and the UGA becomes virtually synonymous with the PGA; it will, in fact, be contained in the PGA of your dedicated server. When you look at the system statistics, you’ll find the UGA reported in the PGA in dedicated server mode (the PGA will be greater than or equal to the UGA memory used; the PGA memory size will include the UGA size as well).
 
So, the PGA contains process memory and may include the UGA. The other areas of PGA memory are generally used for in-memory sorting, bitmap merging, and hashing. It would be safe to say that, besides the UGA memory, these are the largest contributors by far to the PGA.
tom认为 sortarea
  • 在dicidcate server的时候,是不在 uga里的,但是在 pga里但uga之外分配
  • 在 shared server的时候,在uga里包含一部分,大小是(sort_area_retained_size),超出的部分在 pga里(sort_area_size-sort_area_retained_size),
UGA is not PGA.
 
 
see the concepts guide or if you have access to my book Expert Oracle Database Architecture, I go through many concepts like this in detail.
 
 
1gb of data would likely not be loaded into the buffer cache all at once.
 
sort areas would be allocated in the PGA (not UGA, UGA might be used a bit if you are using shared server, but we are getting really detailed at that point) in general.
it will allocate up to sort_area_retained_size in the UGA and the spill over into the "pure" PGA up to sort_area_size if the sort exceeds the sort_area_retained_size AND sort_area_size is greater then sort_area_retained_size.
 
the sort_area_retained_size parameter is often misunderstood. At a high level, this is what happens:
 
to do a sort, Oracle allocates chunks of memory up to a maximum of sort_area_size.
 
As each chunk is allocated -- Oracle checks to see if the sort area is less then the sort_area_retained_size.
 
If so, this chunk is allocated in memory that survives from call to call (in the UGA -- where ever the UGA might be -- in the pga or sga). This memory survives as long as needed (across many calls potentially to fetch rows and such)
 
If not, this chunk is allocated in the "pure pga" and freed at the end of the call. This memory does not survive across calls at all.
 
Sort area memory is not necessarily contigous memory -- hence bits of it could be in the SGA, some in the PGA -- it matters not to Oracle.
 
see also
 
1) What happens when the sort is completed,I mean where is the resultset(fetched rows) kept before sending it to the user process.According to me ,it is in UGA.
1) the sort workarea is kept in whole or part (the rest goes to TEMP on disk). The rows come from this 'retained' size.
 
In manual memory management, you used to set 
 
a) sort_area_size
b) sort_area_RETAINED_size
 
the amount of memory upto (a) would be allocated during the sort and upon completion - right before returning the data, the workarea would be shrunk down to (b) with any excess being written to disk. So, you could set (a) to 10mb and (b) to 1mb - we'd use 10mb to sort the data, shrink the workarea does to 1mb and use that as a buffer to return the data to the client through.
 
In automatic memory management, the server sets (a) and (b) as it likes.
 
所以下面的图都是错误的 
 

 
 
 
 

UGA,PGA的更多相关文章

  1. ora-00600笔记

    一. ORA-600 概述 Errorsof the form ORA-600 are called internal errors. This section clarifies themisund ...

  2. [20190402]Library Cache mutex.txt

    [20190402]Library Cache mutex.txt 1.环境:SCOTT@book> @ ver1PORT_STRING                    VERSION   ...

  3. [20190329]探究sql语句相关mutexes补充2.txt

    [20190329]探究sql语句相关mutexes补充2.txt --//昨天测试sql语句相关mutexes,看看如果出现多个子光标的情况. 1.环境:SCOTT@book> @ ver1P ...

  4. [20190328]简单探究sql语句相关mutexes.txt

    [20190328]简单探究sql语句相关mutexes.txt --//摘要:http://www.askmaclean.com/archives/understanding-oracle-mute ...

  5. 04 memory structure

    本章提要--------------------------------------------------SGA: System Global Area ( 包括background process ...

  6. oracle-Expdp/impdp命令

    建立逻辑路径 create or replace directory dumpdir as 'c:\'; grant read,write on directory dumpdir to scott; ...

  7. Oracle内存结构:SGA PGA UGA

    内存结构是oracle数据库最重要的组成部分之一,在数据库中的操作或多或少都会依赖到内存,是影响数据库性能的重要因素Oracle数据库中包括3个基本的内存结构: 一. 系统全局区  (System G ...

  8. ORACLE内存结构:PGA And UGA,ORACLE用户进程、服务器进程

    执行一个SQL语句 执行查询语句的过程: 用户进程执行一个查询语句如select * from emp where empno=7839 用户进程和服务器进程建立连接,把改用户进程的信息存储到PGA的 ...

  9. PGA和UGA内存的使用情况

    引用thomas kyte的PGA和UGA的统计内存的使用情况,用排序区不同的大小来查看pga.UGA.物理读取不同内存使用 会话1:创建测试表和测试不同排序大小 create table t as ...

随机推荐

  1. c# 圆上坐标点

    var x=-33204.0924438;  //圆心x var y=-9512.41208658; //圆心y var r=1000;//半径 var angle=30;//角度 var tmpX ...

  2. html打造动画【系列4】哆啦A梦

    我相信每个人的童年都有一个哆啦a梦,一个小小的肚皮里装满了不可思议的哆啦a梦,一个在你无助伤心的时候陪在你身边的哆啦a梦,一个陪你胡思乱想陪你吃铜锣烧的哆啦a梦~今天我们就来画一个我们心中的哆啦a梦吧 ...

  3. Linux下vim(文本编译器)的使用

    vim (文本编译器): Vim是从 vi 发展出来的一个文本编辑器. vim的一些命令操作: 插入命令: a 在光标所在字符后插入 A 在光标所在行尾插入 i 在光标所在字符前插入 I 在光标所在行 ...

  4. 算法day02

    算法动态演示网站 数组是有长度限制的,有类型限制 CPU计算 每次是2的32位的,32根线,支持最大是4G 数组:线性表 列表:动态表链表:存储的位置不是连续的 insert 时间复杂度是 Onapp ...

  5. mvn install 时候报GBK编码错误解决办法

    在pom.xml里面 <properties> <!-- 文件拷贝时的编码 --> <project.build.sourceEncoding>UTF-</p ...

  6. C#字节流通信格式

    类似通信格式的实现关键点: byte数组转float的实现,BitConvetor.toSingle() float类型转by,BitConverter.GetBytes #客户端发送public b ...

  7. Project Euler 44: Find the smallest pair of pentagonal numbers whose sum and difference is pentagonal.

    In Problem 42 we dealt with triangular problems, in Problem 44 of Project Euler we deal with pentago ...

  8. LDF文件丢失, 如何仅用MDF文件恢复数据库呢?

    笔者的一个大小为2 TB的SQL Server的database的LDF文件在玩存储盘映射的过程中莫名其妙的丢失了. 好在MDF文件还在. 笔者慌了, Bruce Ye告诉笔者, 不用着急, 光用MD ...

  9. sequelize 学习之路

    如果你觉得Sequelize的文档有点多.杂,不方便看,可以看看这篇. 在使用NodeJS来关系型操作数据库时,为了方便,通常都会选择一个合适的ORM(Object Relationship Mode ...

  10. 传递给数据库 'model' 中的日志扫描操作的日志扫描号无效

    状况描述:在服务器的管理中重新启动MSSQLSERVER启动后马上又停止   通过"事件查看器" 发现 错误: ,严重度: ,状态: LSN(::)无效.该 LSN 是传递给数据库 ...