1) 开启了自动内存管理之后,如果有pool的值设置为非0值会怎么处理?
比如,设置了sga_target=10G,但是java_pool_size设置为10m,这时,10m会作为java pool的最少分配内存空间。
If these automatically tuned memory pools had been set to nonzero values, those values are used as minimum levels by Automatic Shared Memory Management. You would set minimum values if an application component needs a minimum amount of memory to function properly.
2) 关闭自动管理后,相关pool的值会被自动设置。
If you dynamically disable SGA_TARGET by setting its value to 0 at instance startup, Automatic Shared Memory Management will be disabled and the current auto-tuned sizes will be used for each memory pool.
sys@HUA>show parameter memory;NAME TYPE VALUE------------------------------------ ----------- ------------------------------hi_shared_memory_address integer 0memory_max_target big integer 0memory_target big integer 0shared_memory_address integer 0sys@HUA>show parameter sgaNAME TYPE VALUE------------------------------------ ----------- ------------------------------lock_sga boolean FALSEpre_page_sga boolean FALSEsga_max_size big integer 440Msga_target big integer 440Msys@HUA>alter system set sga_target=0;System altered.sys@HUA>show parameter pool;NAME TYPE VALUE------------------------------------ ----------- ------------------------------_shared_io_pool_size big integer 0buffer_pool_keep stringbuffer_pool_recycle stringglobal_context_pool_size stringjava_pool_size big integer 4Mlarge_pool_size big integer 8Molap_page_pool_size big integer 0shared_pool_reserved_size big integer 7549747shared_pool_size big integer 208Mstreams_pool_size big integer 0sys@HUA>alter system set sga_target=440;System altered.sys@HUA>show parameter pool;NAME TYPE VALUE------------------------------------ ----------- ------------------------------_shared_io_pool_size big integer 0buffer_pool_keep stringbuffer_pool_recycle stringglobal_context_pool_size stringjava_pool_size big integer 4Mlarge_pool_size big integer 8Molap_page_pool_size big integer 0shared_pool_reserved_size big integer 7549747shared_pool_size big integer 208Mstreams_pool_size big integer 0sys@HUA>alter system set java_pool_size=0;System altered.sys@HUA>alter system set large_pool_size=0;System altered.sys@HUA>alter system set shared_pool_size=0;System altered.sys@HUA>sys@HUA>show parameter pool;NAME TYPE VALUE------------------------------------ ----------- ------------------------------_shared_io_pool_size big integer 0buffer_pool_keep stringbuffer_pool_recycle stringglobal_context_pool_size stringjava_pool_size big integer 0large_pool_size big integer 0olap_page_pool_size big integer 0shared_pool_reserved_size big integer 7549747shared_pool_size big integer 0streams_pool_size big integer 0sys@HUA>sys@HUA>sys@HUA>alter system set sga_target=0;System altered.sys@HUA>show parameter pool;NAME TYPE VALUE------------------------------------ ----------- ------------------------------_shared_io_pool_size big integer 0buffer_pool_keep stringbuffer_pool_recycle stringglobal_context_pool_size stringjava_pool_size big integer 4Mlarge_pool_size big integer 8Molap_page_pool_size big integer 0shared_pool_reserved_size big integer 7549747shared_pool_size big integer 208Mstreams_pool_size big integer 0
3) 是否有在SGA内的组件,但是却不在自动内存管理之内的?
The following pools are manually sized components and are not affected by Automatic Shared Memory Management: * Log buffer * Other buffer caches (such as KEEP, RECYCLE, and other nondefault block size) * Fixed SGA and other internal allocations To manually size these memory pools, you must set the DB_KEEP_CACHE_SIZE, DB_RECYCLE_CACHE_SIZE, DB_nK_CACHE_SIZE, and LOG_BUFFER initialization parameters. The memory allocated to these pools is deducted from the total available for SGA_TARGET when Automatic Shared Memory Management computes the values of the automatically tuned memory pools.
4) 组件之间“挪借”内存空间,是按什么单位进行?是一个一个字节来分配?
Memory for the shared pool, large pool, java pool, and buffer cache is allocated in units of granules. The granule size is 4MB if the SGA size is less than 1GB. If the SGA size is greater than 1GB, the granule size changes to 16MB. The granule size is calculated and fixed when the instance starts up. The size does not change during the lifetime of the instance.
The granule size that is currently being used for SGA can be viewed in the view V$SGA_DYNAMIC_COMPONENTS. The same granule size is used for all dynamic components in the SGA.
5) 如果使用了自动内存管理,每个pool的值都设置为0了,那如何查看当前每个pool的当前值?
V$MEMORY_DYNAMIC_COMPONENTS displays information about the current sizes of all dynamically tuned memory components, including the total sizes of the SGA and instance PGA.