当向日葵向着太阳微笑时... » 日志 » oracle各种逻辑、物理单位大小限制以及ROWID的结构
oracle各种逻辑、物理单位大小限制以及ROWID的结构
太阳 发表于 2007-08-18 20:34:52
Physical Database Limits
| Item | Type of Limit | Limit Value |
|---|---|---|
| Database Block Size | Minimum | 2048 bytes; must be a multiple of operating system physical block size |
| Maximum | Operating system dependent; never more than 32 KB |
|
| Database Blocks | Minimum in initial extent of a segment. | 2 blocks |
| Maximum per datafile | Platform dependent; typically 222 - 1 blocks | |
| Controlfiles | Number of control files | 1 minimum; 2 or more (on separate devices) strongly recommended |
| Size of a control file | Dependent on operating system and database creation options; maximum of 20,000 x (database block size) |
|
| Database files | Maximum per tablespace | Operating system dependent; usually 1022 |
| Maximum per database | 65533
May be less on some operating systems Limited also by size of database blocks and by the |
|
| Database extents | Maximum per dictionary managed tablespace | 4 GB * physical block size (with K/M modifier); 4 GB (without K/M modifier) |
| 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 222 or 4 MB blocks |
MAXEXTENTS |
Default value | Derived from tablespace default storage or DB_BLOCK_SIZE initialization parameter |
| 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 |
| Maximum number of logfiles per group | Unlimited | |
| Redo Log File Size | Minimum size | 50 KB |
| 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 ( 232 ) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K 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 (222) blocks. |
| External Tables file | Maximum size | Dependent on the operating system.
An external table can be composed of multiple files. |
以上表格引用:
download.oracle.com/docs/cd/B19306_01/server.102/b14237/limits002.htm#sthref4183
Database Limits
Table A-1 lists the default and maximum values for parameters in a CREATE DATABASE or CREATE CONTROLFILE statement.
Note:
Interdependencies between these parameters may affect allowable values.Table A-1 CREATE CONTROLFILE and CREATE DATABASE Parameters
| Parameter | Default | Maximum Value |
|---|---|---|
|
16 |
255 |
|
|
2 |
5 |
|
|
100 |
65534 |
|
|
30 |
65534 |
|
|
1 |
63 |
Table A-2 lists the Oracle Database file size limits in bytes.
Table 1-1 File Size Limits
| File Type | Maximum Size |
|---|---|
|
Data File |
4,194,303 multiplied by the value of the DB_BLOCK_SIZE parameter |
|
Import file |
Unlimited (limited by the OS file size limit) |
|
Export file |
Unlimited (limited by the OS file size limit) |
|
SQL*Loader file |
Unlimited (limited by the OS file size limit) |
ROWID:
ROWID的结构如下面的例子:(6,3,6,3)
Examples of Rowid Use
You can use the function SUBSTR to break the data in a rowid into its components. For example, you can use SUBSTR to break an extended rowid into its four components (database object, file, block, and row):
SELECT ROWID,SMALLFILE:
SUBSTR(ROWID,1,6) "OBJECT",
SUBSTR(ROWID,7,3) "FIL",
SUBSTR(ROWID,10,6) "BLOCK",
SUBSTR(ROWID,16,3) "ROW"
FROM products;
ROWID OBJECT FIL BLOCK ROW
------------------ ------ --- ------ ----
AAAA8mAALAAAAQkAAA AAAA8m AAL AAAAQk AAA
AAAA8mAALAAAAQkAAF AAAA8m AAL AAAAQk AAF
AAAA8mAALAAAAQkAAI AAAA8m AAL AAAAQk AAI
rowid中的FIL使用3bytes, block#使用6bytes是属于smallfile的情况,是数据库的缺省数据文件类型
这样oracle可以支持的单个文件的块数是2^22 -> 4M blocks
当1个block为8k缺省大小时,单个数据文件大小为32GB.
SQL>select * from database_properties where property_name = 'DEFAULT_TBS_TYPE';
可以通过以下方式查询数据库中数据文件类型:
SQL>select file_name,file_id,relative_fno from dba_data_files;
改变缺省数据文件类型:
SQL>ALTER DATABASE SET DEFAULT bigfile TABLESPACE;
BIGFILE:
当BIGFILE数据文件类型时,每个标空间只能存在1个文件.这样在rowid中的FIL可以取消,
而block#可以使用额外的3bytes原FIL数据位共9bytes的容量来存放文件.
这样oracle可以支持文件块数为2^32 -> 4G blocks
当1个block为8k缺省大小时,该数据文件的大小为32TB.
各种数据文件的极限大小由数据库平台所支持的文件大小所决定.
