ITPub博客

首页 > 数据库 > Oracle > ORACLE 内存管理 之六 SGA Multiple Block Sizes,Large Pool

ORACLE 内存管理 之六 SGA Multiple Block Sizes,Large Pool

原创 Oracle 作者:weifenghq 时间:2007-01-05 10:05:10 0 删除 编辑

ORACLE DBA 内存管理 SGA Multiple Block Sizes,Large Pool

Multiple Block Sizes

9i前只能设置一种blocksize,如果想改变只能重装数据库.9I后可以设置多种.要设置多种blocksize必须先设置相应的buffer cache area.

SQL> show parameter cache_size

NAME TYPE VALUE

------------------------------------ ---------------------- -------------------

db_16k_cache_size big integer 0

db_2k_cache_size big integer 0

db_32k_cache_size big integer 0

db_4k_cache_size big integer 0

db_8k_cache_size big integer 0

db_cache_size big integer 243269632

db_keep_cache_size big integer 0

db_recycle_cache_size big integer 0

SQL> show parameter db_block_size

NAME TYPE VALUE

------------------------------------ ---------------------- ---------

db_block_size integer 8192

可以看到DEFAULT是8K,默认值用的时db_cache_size所以是不需要设置相应的db_xk_cache_size的。

当想建立一个32K的表空间但是又没有设置 db_32k_cache_size的时候会出错的:

1 create tablespace ts_wwm_32k

2 datafile 'D:ORACLEORADATAJMCOEMDBTS_WWM_32K.DBF' size 10m

3* blocksize 32k

SQL> /

create tablespace ts_wwm_32k

*

ORA-29339: 表空间块大小32768 与配置的块大小不匹配

所以必须先设置32K的cache size,要保证有这部分空余mem可以分配出来,先看sga_max_size是否大于当前sga 的大小,如果大于当前sga说明有一部分mem没有分配,可以用来分配给32k_cache_size。如果等于当前sga的大小说明可用内存都已用掉,此时需要缩小其他组件的大小来让出地方给32k_cache_Size.

SQL> show sga

Total System Global Area 420551900 bytes

Fixed Size 453852 bytes

Variable Size 176160768 bytes

Database Buffers 243269632 bytes

Redo Buffers 667648 bytes

SQL> show parameter sga_max_size

NAME TYPE VALUE

------------------------------------ ---------------------- --------------

sga_max_size big integer 420551900

可以看到sga_max_size=420551900

缩小default 的db_cache_Size以便空出地方。

SQL> alter system set db_cache_Size=200M;

SQL> alter system set db_32k_cache_size=50m;
alter system set db_32k_cache_size=50m
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00382: 32768 not a valid block size, valid range [2048..16384]

由于做实验用的是WIN2000,只支持2k---16k.所以修改成16K

1* alter system set db_16k_cache_size=30M

create tablespace ts_wwm_16k

datafile 'D:ORACLEORADATAJMCOEMDBTS_WWM_16K.DBF' size 20M

blocksize 16k;

表空间已创建.

现在有了两个buffer cache了,8k的cache size是200M,16K的是30M,这两个区域不能通用,16K的30M用完后不能用8k的200M.所以增加灵活性的同时也增加了管理的复杂性.

Large Pool

large pool 并不是因为他本身大,而是说他分配的PIECE比较大,8.0前large pool需要实现的功能都在shared pool里实现.但是shared pool里用LRU算法,LRU对于那些用了之后还要用的数据比较好,但LARGE的特征却是需要的时候要分配大块的内存,不需要的时候可以不保留数据,也就是说不会被重用. 所以8.0后就单独分出来large pool.shared pool和large pool的关系就像buffer cache里的 recycle和keep的关系一样,large pool,就相当于recycle,shared pool就像keep一样。

Large pool在一下情况用到:

* Shared Server Connections – to allocate the UGA region in the SGA.

* Parallel Execution of statements – to allow for the allocation of inter-process message buffers, used to coordinate the parallel query servers.

* Backup – for RMAN disk I/O buffers in some cases.

摘自:http://sunmoonking.spaces.msn.com[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/633084/viewspace-888425/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: EXP-00002
请登录后发表评论 登录
全部评论

注册时间:2008-11-25

  • 博文量
    100
  • 访问量
    595191