一,什么是内存粒度?

When a database instance starts up, the amount of memory allocated is determined by the allocations requested in the parameter file (init file or spfile).  This memory is allocated in units called granules. All memory pool sizes will be allocated in multiples of the granule size.

二,内存粒度大小定义

The granule size is determined based on the amount of memory requested at the instance startup. It is based on the SGA_MAX_SIZE.  If MEMORY_MAX_TARGET is specified, then SGA_MAX_SIZE defaults to MEMORY_MAX_TARGET for the purpose of sizing the granule.  Once set, the granule size does not change for the life of the instance.

The granule sizes at the time of writing, are:

三,内存粒度查询

You can check the granule size that is currently set for your database instance by running the following SQL statement as SYSDBA

-- You can determine your granule size with this SQL 
SQL> select bytes from v$sgainfo where name like 'Granule Size';

There is a 16MB granule size maximum on 32-bit platforms. This applies even if the granule size is manually overridden.

四,内存粒度的重要性

The SGA memory components are sized as multiples of granules.
The components are:

  • shared pool
  • buffer cache (plus different size buffer caches)
  • redo log buffer
  • java pool
  • streams pool
  • large pool

There can be no component of size less than one granule. The minimum of some components can be greater than one granule (and rounded up to the nearest granule boundary).  For example the Buffer Cache minimum will be 4MB*num_cpus, and can exceed 1 granule.

If you set a value in the spfile that is not a multiple of the granule size, the actual size allocated will be rounded up to the nearest granule. This can become important in large SGA's. 

For example, if your SGA in 11GR1 is 70G, and you set the java_pool_size to 150M in the spfile, the actual allocation for the java_pool_size will be rounded up to 512M.

The significance of this granule sizing is the following:

Consider a very large SGA on servers with many processors.
The SGA (actually shared, streams and large pool) gets divided in subpools, a maximum of 7 depending on the number of processors and the SGA size.
Typically, 16 processors (cores) will have 4 subpools, 24 processors will have 6 subpools, and 25 or more processors will have 7 subpools.  The number of subpools is derived by an internal algorithm.

In addition, in 10g and 11g, the shared pool and streams pool subpools are further divided into 4 'durations' ("instance", "session", "cursor", and "execution").  
(It is possible the number of durations may change in 12g.)

So with over 24 processors, there would be 28 subpools in the shared pool and likely another 28 in the streams pool, each with a minimum of 1 granule.

If you add to that the granules for the other SGA pools, the memory usage could be over 60 granules even before any memory component exceeds 1 granule in size.

If the derived granule size is 256MB, the resulting memory requirement becomes over 15 GB just to start up the instance. This scenario can cause an ORA-4031 during or soon after startup.

Oracle Support can usually offer solutions to this by manually reducing the granule size or by reducing the processor count used in the subpool algorithm. 

The patch for unpublished Bug 8813366 reduces the granule sizing to help offset this error.

Another place where granule sizes are taken into consideration, is with Automatic Shared Memory Management (ASMM) in 10g, and Automatic Memory Management (AMM) in 11g.

As memory pressures rise on the Shared Pool, instead of a ORA-4031, the memory auto-tuner in ASMM (or AMM) will go to the Buffer Cache and transfer memory to the Shared Pool to fill the required need. This memory transfer is also done in granules. So with large SGA sizes, it is possible that a transfer of memory will not occur unless there is 256M or 512M of memory available to be transferred. If at least one granule is not available, an ORA-4031 will occur.

来自:NOTE:947152.1



oracle内存粒度的更多相关文章

  1. Oracle内存全面分析

    Oracle内存全面分析 Oracle的内存配置与oracle性能息息相关.而且关于内存的错误(如4030.4031错误)都是十分令人头疼的问题.可以说,关于内存的配置,是最影响Oracle性能的配置 ...

  2. Oracle 内存结构

     内存结构 Oracle内存,进程与数据库的图 sga:系统全局区,用来存放操作的数据,库缓存,数据字典等控制信息的内存区域, pga:进程全局区,服务进程专用的内存区域,大多数内容非共享 uga:用 ...

  3. Oracle内存管理技术

    1.Oracle内存管理技术 2.配置自动内存管理(AMM) 3.监视自动内存管理(AMM) 4.配置自动共享内存管理(ASMM) 5.配置自动PGA内存管理 Reference 1.Oracle内存 ...

  4. 【转】oracle内存分配和调优总结

    转自 http://blog.itpub.net/12272958/viewspace-696834/ 一直都想总结一下oracle内存调整方面的知识,最近正好优化一个数据库内存参数,查找一些资料并且 ...

  5. 修改oracle内存占用

    修改oracle内存占用   ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # su oracle      $cd $ORACLE_HOM ...

  6. Oracle内存管理理论篇二

    目标 了解oracle内存管理方式 掌握ASMM管理方式 掌握AMM管理方式 监控内存使用 学习一个知识点时,最好先了解其历史.ORACLE近期的版本都对内存管理做了简化,从9i通过PGA_AGGRE ...

  7. 2014年1月9日 Oracle 内存与结构

    Oracle启动时为启动一个实例 主要为 实例 SVG 数据库文件 其它文件 1.Oracle:  内存 进程  其他文件 1.1 SVG内存(Cache)  1.1.1 共享池(Shared Poo ...

  8. oracle内存优化

    一直都想总结一下oracle内存调整方面的知识,最近正好优化一个数据库内存参数,查找一些资料并且google很多下.现在记录下来,做下备份.         一.概述:                ...

  9. Oracle内存详解之 Library cache 库缓冲

    Oracle内存详解之 Library cache 库缓冲 2017年11月09日 11:38:39 阅读数:410更多 个人分类: 体系结构 Library cache是Shared pool的一部 ...

随机推荐

  1. 关于BFC的初步了解以及常见使用

    在学习CSS的过程中,掌握一些常用方法或效果实现的原理对于我们的学习来说是很有帮助的.如最常见的清除浮动和取消外边距塌陷时使用overflow:hidden;,在学习初期往往只知道有这种用法,且使用时 ...

  2. Nginx笔记

    基础篇 关于Nginx Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器.最早由俄罗斯的程序设计师Igor Sysoev所开发,并在一个BSD-like ...

  3. HMM基本原理及其实现(隐马尔科夫模型)

    HMM(隐马尔科夫模型)基本原理及其实现 HMM基本原理 Markov链:如果一个过程的“将来”仅依赖“现在”而不依赖“过去”,则此过程具有马尔可夫性,或称此过程为马尔可夫过程.马尔可夫链是时间和状态 ...

  4. Digester组件

    刚认识Digester,记录一下: Digester随着Struts的发展以及其的公用性而被提到commons中独自立项,是apache的一个组件 apache commons-digester.ja ...

  5. Mysql基础(一)

    Mysql的历史度娘上一堆,就不再介绍了. 本文依照此路径学习Mysql数据库:数据库->表->数据 首先启动Mysql服务,然后通过控制台命令登入root账户输入密码回车 C:\User ...

  6. 关于java中自增,自减,和拓展运算符的小讨论

    java中运算符很多,但是能深入讨论的不算太多.这里我仅仅以++,*=为例做讨论. 例:++ i=0; i=i++ + ++i;//i=1 i=++i+i++;//i=2 i=i++ -++i;//i ...

  7. netlink优势

    netlink相对其他应用进程和内核之间通信的方式(ioctrl或者系统文件等方式),全双工,可由内核发起,应用进程可用epoll监听,而其他方式只能由应用进程发起. 顺便记下隧道,隧道可以通过在ip ...

  8. 现代软件工程作业 第二章 学习github笔记

    在网上大量资料的辅助下,学习了github的基本使用方法,尝试了一些常见的命令.为了便于记忆总结了自己的学习内容. 1.首先需要在github的官网上注册一个帐号,并新建一个repository,选这 ...

  9. PHP中被定义为false的

    if($res == false){ echo "未定义通过<br>"; } $res = 0; if($res == false){ echo "0数字通过 ...

  10. Android插件化框架研究-DroidPlugin

    直接贴上我做的ppt.