Oracle數(shù)據(jù)文件默認(rèn)大小上限是32G,如果要數(shù)據(jù)文件大于32G,需要在數(shù)據(jù)庫創(chuàng)建之初就設(shè)置好。
表空間數(shù)據(jù)文件容量與DB_BLOCK_SIZE有關(guān),在初始建庫時,DB_BLOCK_SIZE要根據(jù)實際需要,設(shè)置為 4K,8K、16K、32K、64K等幾種大小,ORACLE的物理文件最大只允許4194304個數(shù)據(jù)塊(由操作系統(tǒng)決定),表空間數(shù)據(jù)文件的最大值為 4194304×DB_BLOCK_SIZE/1024M。
即:
- 4k最大表空間為:16384M=16G
- 8K最大表空間為:32768M=32G
- 16k最大表空間為:65536M=64G
- 32K最大表空間為:131072M=128G
- 64k最大表空間為:262144M=256G
在windows下只能使用2K,4K,8K,16K的塊大小,在文檔中的描述如下。
Oracle Database Administrator's Guide
10g Release 2 (10.2)
Part Number B14231-02
/B19306_01/server.102/b14231/create.htm#sthref372中有如下描述:
Tablespaces of nonstandard block sizes can be created using the CREATE TABLESPACE statement and specifying the BLOCKSIZE clause. These nonstandard block sizes can have any of the following power-of-two values: 2K, 4K, 8K, 16K or 32K. Platform-specific restrictions regarding the maximum block size apply, so some of these sizes may not be allowed on some platforms.
To use nonstandard block sizes, you must configure subcaches within the buffer cache area of the SGA memory for all of the nonstandard block sizes that you intend to use. The initialization parameters used for configuring these subcaches are described in the next section, "Managing the System Global Area (SGA)".
前一段說明了某些塊大小在某些平臺上是不可用的,具體情況受操作系統(tǒng)限制。比如windows下就有塊大小2048字節(jié)到16384字節(jié)的限制,不管是非標(biāo)準(zhǔn)塊還是標(biāo)準(zhǔn)塊。據(jù)http://www.ningoo.net/html/2007/can_not_use_32k_block_size_on_windows.html的說明,如果Windows下使用32K作為db_block_size創(chuàng)建數(shù)據(jù)庫,會報ORA-00374錯誤。
后一段說明使用非標(biāo)準(zhǔn)塊要設(shè)置相應(yīng)的內(nèi)存參數(shù)。
Oracle是SGA自動共享內(nèi)存管理,初始化參數(shù)db_4k_cache_size=0、db_8k_cache_size=0、db_16k_cache_size=0、
db_32k_cache_size = 0、db_64k_cache_size = 0,使用
如果要創(chuàng)建表空間并指定其文件大?。ㄓ蓜?chuàng)建表空間的BLOCK_SIZE決定),需重新設(shè)置db_4k_cache_size、db_8k_cache_size、db_16k_cache_size、db_32k_cache_size、db_64k_cache_size的值。
db_4k_cache_size:
alter system set db_4k_cache_size = 4M scope=both;
db_8k_cache_size:
alter system set db_8k_cache_size = 8M scope=both;
db_16k_cache_size:
alter system set db_16k_cache_size = 16M scope=both;
db_32k_cache_size:
alter system set db_32k_cache_size = 32M scope=both;
db_64k_cache_size:
alter system set db_64k_cache_size = 64M scope=both;
其中windows系統(tǒng)只支持4k、8k、16k的設(shè)置。
設(shè)置好上述參數(shù)的值后,創(chuàng)建表空間:
CREATE TABLESPACE TEST DATAFILE 'E:\TEST.DBF'
SIZE 60G
AUTOEXTEND ON
BLOCKSIZE 16K
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 2M
SEGMENT SPACE MANAGEMENT AUTO;
SIZE:數(shù)據(jù)文件大小,不能超過BLOCKSIZE 16k(對應(yīng)db_16k_cache_size)的大小16M*4194304/1024M=65536M=64G的值。
以上就是Oracle如何設(shè)置表空間數(shù)據(jù)文件大小的詳細(xì)內(nèi)容,更多關(guān)于oracle表空間數(shù)據(jù)文件的資料請關(guān)注腳本之家其它相關(guān)文章!
您可能感興趣的文章:- Oracle如何更改表空間的數(shù)據(jù)文件位置詳解
- Oracle表空間數(shù)據(jù)文件移動的方法
- Oracle7.X 回滾表空間數(shù)據(jù)文件誤刪除處理方法
- Oracle7.X 回滾表空間數(shù)據(jù)文件誤刪除處理方法
- Oracle7.X 回滾表空間數(shù)據(jù)文件誤刪除處理方法