Oracle如何設(shè)置表空間數(shù)據(jù)文件大小
Oracle數(shù)據(jù)文件默認(rèn)大小上限是32G,如果要數(shù)據(jù)文件大于32G,需要在數(shù)據(jù)庫創(chuàng)建之初就設(shè)置好。
表空間數(shù)據(jù)文件容量與DB_BLOCK_SIZE有關(guān),在初始建庫時(shí),DB_BLOCK_SIZE要根據(jù)實(shí)際需要,設(shè)置為 4K,8K、16K、32K、64K等幾種大小,ORACLE的物理文件最大只允許4194304個(gè)數(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ù)庫,會報(bào)ORA-00374錯(cuò)誤。
后一段說明使用非標(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)文章!
相關(guān)文章
ORA-12514及ORA-28547錯(cuò)誤解決方案
Oracle安裝好修改配置NET Manager就可以連接了卻出現(xiàn)了ORA-12514及ORA-28547錯(cuò)誤,本文將介紹如何解決2012-11-11
Oracle數(shù)據(jù)庫中建立索引的基本方法講解
這篇文章主要介紹了Oracle數(shù)據(jù)庫中建立索引的基本方法,包括對性能方面進(jìn)行衡量而給出的一些索引的設(shè)計(jì)和使用建議,需要的朋友可以參考下2016-01-01
Oracle出現(xiàn)ora-12154無法解析指定連接標(biāo)識符的解決方法
這篇文章主要為大家詳細(xì)介紹了Oracle出現(xiàn)ora-12154無法解析指定連接標(biāo)識符的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-10-10
Oracle中PL/SQL復(fù)合數(shù)據(jù)類型
這篇文章介紹了Oracle中PL/SQL的復(fù)合數(shù)據(jù)類型,文中通過示例代碼介紹的非常詳細(xì)。對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-05-05

