Oracle 中数据文件大小的限制

Oracle数据文件的大小存在一个内部限制,这个限制是:
每个数据文件最多只能包含2^22-1个数据块。

这个限制也就直接导致了每个数据文件的最大允许大小。
在2K Block_size下,数据文件最大只能达到约8G
在32K的Block_size下,数据文件最大只能达到约16*8G的大小。

这个限制是由于Oracle的Rowid中使用22位来代表Block号,这22位最多只能代表2^22-1个数据块。

为了扩展数据文件的大小,Oracle10g中引入了大文件表空间,在大文件表空间下,Oracle使用32位来代表Block号,也就是说,在新的技术下,大文件表空间下每个文件最多可以容纳4G个Block。
那么也就是说当Block_size为2k时,数据文件可以达到8T 。
当block_size为32K时,数据文件可以达到128T。

做2K block_size测试时,第一次遇到了这个限制:

SQL> alter tablespace eygle add datafile 'f:\eygle02.dbf' size 8192M;
alter tablespace eygle add datafile 'f:\eygle02.dbf' size 8192M
*
ERROR 位于第 1 行:

ORA-01144: 文件大小 (4194304 块) 超出 4194303 块的最大数


缩减一点,最后创建成功:
SQL> alter tablespace eygle add datafile 'f:\eygle02.dbf' size 8191M reuse;

表空间已更改。


autoextend_clause
The autoextend_clause is valid for datafiles and tempfiles but not for redo log files. Use this clause to enable or disable the automatic extension of a new or existing datafile or tempfile. If you omit this clause:

  For Oracle-managed files:
    If you specify SIZE, then Oracle Database creates a file of the specified size with AUTOEXTEND disabled.
    If you do not specify SIZE, then the database creates a 100M file with AUTOEXTEND enabled. When autoextension is required, the database extends the file by its original size or 100MB, whichever is smaller. You can override this default behavior by specifying the NEXT clause.
  For user-managed files, with or without SIZE specified, Oracle creates a file with AUTOEXTEND disabled.

ON 
Specify ON to enable autoextend.

OFF 
Specify OFF to turn off autoextend if is turned on. When you turn off autoextend, the values of NEXT and MAXSIZE are set to zero. If you turn autoextend back on in a subsequent statement, you must reset these values.

NEXT 
Use the NEXT clause to specify the size in bytes of the next increment of disk space to be allocated automatically when more extents are required. The default is the size of one data block.

MAXSIZE 
Use the MAXSIZE clause to specify the maximum disk space allowed for automatic extension of the datafile.

UNLIMITED 
Use the UNLIMITED clause if you do not want to limit the disk space that Oracle can allocate to the datafile or tempfile.

Restriction on the autoextend_clause 
You cannot specify this clause as part of the datafile_tempfile_spec in a CREATE CONTROLFILE statement or in an ALTER DATABASE CREATE DATAFILE clause.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值