【Datafile】Oracle單個datafile大小的限制
最近在維護資料庫空間,給tablespace新增datafile的時候,由於達到了資料庫最大datafile的個數,所以不能再新增。而我們的單個datafile的大小為2G,所以我就在想,單個datafile的大小限制到底是多少,我們可以相應擴大單個datafile的大小,以減少datafile的個數。
在網上參考了很多專業人士的技術文件,也做了相應的測試,現在記錄如下:
1、建立普通tablespace時,報錯
SYS@MTH> create tablespace TEST
2 datafile '/oradat/MTH/TEST01.dbf' size 2000M
3 autoextend on next 10M maxsize 50000M
4 extent management local
5 segment space management auto;
create tablespace TEST
*
ERROR at line 1:
ORA-03206: maximum file size of (6400000) blocks in AUTOEXTEND clause is out of range
2、Oracle官方相關限制設定
Item |
Type of Limit |
Limit Value |
Database Block Size |
Minimum |
2048 bytes; must be a multiple of operating system physical block size |
Database Block Size |
Maximum |
Operating system dependent; never more than 32 KB |
Database Blocks |
Minimum in initial extent of a segment |
2 blocks |
Database Blocks |
Maximum per datafile |
Platform dependent; typically 2^22 - 1 blocks |
Controlfiles |
Number of control files |
1 minimum; 2 or more (on separate devices) strongly recommended |
Controlfiles |
Size of a control file |
Dependent on operating system and database creation options; maximum of 25,000 x (database block size) |
Database files |
Maximum per tablespace |
Operating system dependent; usually 1022 |
Database files |
Maximum per database |
65533 May be less on some operating systems Limited also by size of database blocks and by the DB_FILES initialization parameter for a particular instance |
Database extents |
Maximum per dictionary managed tablespace |
4 GB * physical block size (with K/M modifier); 4 GB (without K/M modifier) |
Database extents |
Maximum per locally managed (uniform) tablespace |
2 GB * physical block size (with K/M modifier); 2 GB (without K/M modifier) |
Database file size |
Maximum |
Operating system dependent. Limited by maximum operating system file size; typically 2^22 or 4 MB blocks |
MAXEXTENTS |
Default value |
Derived from tablespace default storage or DB_BLOCK_SIZE initialization parameter |
MAXEXTENTS |
Maximum |
Unlimited |
Redo Log Files |
Maximum number of logfiles |
Limited by value of MAXLOGFILES parameter in the CREATE DATABASE statement Control file can be resized to allow more entries; ultimately an operating system limit |
Redo Log Files |
Maximum number of logfiles per group |
Unlimited |
Redo Log File Size |
Minimum size |
4 MB |
Redo Log File Size |
Maximum Size |
Operating system limit; typically 2 GB |
Tablespaces |
Maximum number per database |
64 K Number of tablespaces cannot exceed the number of database files because each tablespace must include at least one file |
Bigfile Tablespaces |
Number of blocks |
A bigfile tablespace contains only one datafile or tempfile, which can contain up to approximately 4 billion ( 2^32 ) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32 K blocks and 32 TB for a tablespace with 8 K blocks. |
Smallfile (traditional) Tablespaces |
Number of blocks |
A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 datafiles or tempfiles, each of which can contain up to approximately 4 million (2^22) blocks. |
External Tables file |
Maximum size |
Dependent on the operating system. An external table can be composed of multiple files. |
每個datafile最多包含2^22-1個block,存在這個限制是因為Oracle的內部ROWID使用22位2進位制數來儲存不同的block號,所以22位最多代表(2^22-1)個block。
3、根據文件,計算我的資料庫單個檔案的大小限制
SYS@MTH> show parameter db_block_size
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_block_size integer 8192
單個檔案的最大大小:(2^22-1) × 8K=33554432K=32G
顯然我指定的50000M超過了最大限制,所以報錯。
檢視到文件中建議單個datafile的大小設定成8G,既避免datafile過小導致的個數過多,難以維護,又能避免datafile過大,一旦出現問題很難恢復的情況。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30776559/viewspace-2146790/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 資料檔案(Datafile ) 大小 限制 說明Oracle
- Oracle datafileOracle
- 收縮datafile for oracle -- 轉Oracle
- rman copy asm datafile(rename asm datafile)ASM
- oracle datafile 與 object的關係OracleObject
- 由drop datafile導致的oracle bugOracle
- v$datafile_header 查詢datafile 狀態Header
- oracle asm diskgroup add datafile error problemOracleASMError
- Oracle 使用RMAN COPY 移動 Datafile 位置Oracle
- oracle實用sql(6)--tablespace/datafile resizeOracleSQL
- alter database create datafileDatabase
- alter database create datafile '' as ''Database
- how to remove datafile pathREM
- 【Oracle】oracle tablespace&datafile -- oracle表空間 分享[轉]Oracle
- 體驗Oracle 10gR2的drop empty datafileOracle 10g
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- Renaming a Datafile in the Primary DatabaseDatabase
- v$datafile&v$datafile_header,oracle 備份恢復時,查詢資料檔案資訊HeaderOracle
- oracle 10g R2 drop empty datafileOracle 10g
- v$datafile中的last_change#AST
- 從Undo, Redo, DataFile看Oracle中的事務過程Oracle
- 一個事務的整個流程,datafile,undo,redo的內容
- Move datafile:From File System to ASMASM
- Move datafile:From ASM to File SystemASM
- alter system dump datafile headerHeader
- ALTER DATABASE DATAFILE OFFLINEDatabase
- How to Choose Size of Datafile on Raw Devicedev
- 重新認識CREATE DATAFILE命令
- 冷備_並行copy datafile並行
- oracle檔案遷移之datafile,relog file,tempfileOracle
- oracle 10g_rac_create tablespace_add_datafileOracle 10g
- alter database ... create datafile的原理及用途Database
- impdp中remap_datafile的測試。REM
- tablespace和datafile之間的關係
- oracle刪除datafile導致資料庫打不開Oracle資料庫
- rman datafile恢復(歸檔模式)模式
- oracle裡tablespace offline和datafile offline的區別Oracle
- POST表單資料大小的限制