Oracle如何設置表空間數(shù)據(jù)文件大小
Oracle數(shù)據(jù)文件默認大小上限是32G,如果要數(shù)據(jù)文件大于32G,需要在數(shù)據(jù)庫創(chuàng)建之初就設置好。
表空間數(shù)據(jù)文件容量與DB_BLOCK_SIZE有關,在初始建庫時,DB_BLOCK_SIZE要根據(jù)實際需要,設置為 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é)的限制,不管是非標準塊還是標準塊。據(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錯誤。
后一段說明使用非標準塊要設置相應的內(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決定),需重新設置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ù)的值后,創(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(對應db_16k_cache_size)的大小16M*4194304/1024M=65536M=64G的值。
以上就是Oracle如何設置表空間數(shù)據(jù)文件大小的詳細內(nèi)容,更多關于oracle表空間數(shù)據(jù)文件的資料請關注腳本之家其它相關文章!
相關文章
Navicat連接Oracle數(shù)據(jù)庫報錯:Oracle library is not&nb
這篇文章主要介紹了解決Navicat連接Oracle數(shù)據(jù)庫提示oracle library is not loaded的問題,本文通過圖文結(jié)合的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2024-06-06詳解PL/SQL Developer連接本地Oracle 11g 64位數(shù)據(jù)庫
本篇文章主要介紹了PL/SQL Developer連接本地Oracle 11g 64位數(shù)據(jù)庫 ,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-04-04Oracle創(chuàng)建Database Link的兩種方式詳解
Oracle數(shù)據(jù)庫如何創(chuàng)建Database Link呢?本文我們主要就介紹一下這部分內(nèi)容,Oracle數(shù)據(jù)庫創(chuàng)建Database Link有兩種方式,一種是通過菜單,一種是通過SQL2016-02-02Oracle在表中有數(shù)據(jù)的情況下修改字段類型或長度的解決方法
這篇文章主要介紹了Oracle在表中有數(shù)據(jù)的情況下修改字段類型或長度,修改其某個字段的類型或改變他的長度,由于表中有數(shù)據(jù),不能直接修改,需要換個方法,接下來通過本文給大家介紹下解決方法,需要的朋友可以參考下2022-10-10OB Oracle系統(tǒng)視圖權限導致的故障解決案例
在 Oracle 和 OB Oracle 租戶下調(diào)用存儲過程時,兩者表現(xiàn)并不一致,導致獲取到的 SQL 文本拼接不完整,影響到了業(yè)務側(cè)的功能測試,本文將針對這個問題進行相關的測試和驗證2023-10-10Orcle的package中訪問其它Schema的表報錯ORA-00942解決方法
package要訪問其它Schema的表,但編譯報錯ORA-00942,經(jīng)過搜索了一下找到了解決方法下面與大家分享下2013-05-05Oracle中使用觸發(fā)器(trigger)和序列(sequence)模擬實現(xiàn)自增列實例
這篇文章主要介紹了Oracle中使用觸發(fā)器(trigger)和序列(sequence)模擬實現(xiàn)自增列實例,包含代碼實例,而且小編已經(jīng)測試過了哦,需要的朋友可以參考下2014-07-07