Oracle 配置 Multiple Block Sizes 表空间(二)

2014-11-24 18:29:03 · 作者: · 浏览: 1
K_SIZE has a value other than nK. For example, ifDB_BLOCK_SIZE=4096, then it is illegal to specify the parameterDB_4K_CACHE_SIZE (because the size for the 4 KB block cache is alreadyspecified by DB_CACHE_SIZE).


-- DB_nK_CACHE_SIZE 参数指定nK 的buffer,在指定cache时,要确保有足够的空间。 不能和DB_BLOCK_SIZE参数冲突,n 可以取2,4,8,16,32.


Donot set this parameter to zero if there are any online tablespaces with an nKblock size.


Operating system-specific block size restrictions apply.For example, you cannot set DB_32K_CACHE_SIZE if the operating system's maximumblock size is less than 32 KB. Also, you cannot set DB_2K_CACHE_SIZE if theminimum block size is greater than 2 KB.


-- DB_nK_CACHE_SIZE要操作系统支持,如果n=32,但操作系统支持,也是不行的。



See Also:


Youroperating system-specific Oracle documentation for more information on blocksize restrictions




二. 测试


--查看db_block_size


SYS@anqing2(rac2)> show parameterdb_block_size



NAME TYPE VALUE


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


db_block_size integer 8192




--查看操作系统位数


[root@rac2 ~]# cat /proc/cpuinfo | grepflags | grep 'lm' | wc -l


1


结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit。



有关CPU的更多信息参考:


Linux CPU 信息查看


http://blog.csdn.net/tianlesoftware/article/details/5970500



--查看db_32k_cache_size值


SYS@anqing2(rac2)> show parameterdb_32k_cache_size



NAME TYPE VALUE


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


db_32k_cache_size big integer 0



-- 指定32k 时,报错,提示系统不支持,看来只能用16k了


SYS@anqing1(rac1)> alter system setdb_32k_cache_size=1M scope=both sid='anqing1';


alter system set db_32k_cache_size=1Mscope=both sid='anqing1'


*


ERROR at line 1:


ORA-32017: failure in updating SPFILE


ORA-00382: 32768 not a valid block size,valid range [..]



--指定16k 的cachebuffer


SYS@anqing1(rac1)> alter system set db_16k_cache_size=1M scope=bothsid='anqing1';


System altered.


SYS@anqing2(rac2)> alter system set db_16k_cache_size=1M scope=bothsid='anqing2';


System altered.


-- 因为我的测试环境是RAC,所以在2个节点上都指定了参数



--查看cache,虽然指定了1M,但系统使用了默认的最小值


SYS@anqing1(rac1)> show parameter db_16k_cache_size


NAME TYPE VALUE


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


db_16k_cache_size big integer 4M


SYS@anqing2(rac2)> show parameter db_16k_cache_size


NAME TYPE VALUE


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


db_16k_cache_size big integer 4M


-- 这个最小的默认值,上面的官网说明有解释:


--values greater thanzero are automatically modified to be either the granule size * number ofprocessor groups, or 4 MB * number of CPUs, whichever is greater



--指定了16kcache,我们就可以创建block 为16k的表空间了



SYS@anqing1(rac1)> CREATE TABLESPACETest DATAFILE


2 '+DATA/anqing/datafile/test01.dbf' SIZE 50M AUTOEXTEND ON NEXT 10MMAXSIZE 100M BLOCKSIZE 16K;


Tablespace created.


-- 注意这里指定了Blocksize为16k,和我们之前创建的Cache 大小相对应。



--为了验证不指定cache报的错误,我们创建一个4k的tablespace


SYS@anqing1(rac1)> CREATE TABLESPACE TTDATAFILE '+DATA/anqing/datafile/TT01.dbf' SIZE 50M AUTOEXTEND ON NEXT 10MMAXSIZE 100M BLOCKSIZE 4K;


CREATE TABLESPACE TT DATAFILE'+DATA/anqing/datafile