分类: Oracle
2015-03-10 12:18:51
SQL> create tablespace test001 datafile '/u01/app/oracle/oradata/test001.dbf' size 1M autoextend on maxsize 10M;
Tablespace created.
SQL> alter database datafile '/u01/app/oracle/oradata/test001.dbf' resize 20M;
Database altered.
SQL>
SQL> select AUTOEXTENSIBLE, MAXBYTES, BYTES, file_id from dba_data_files where file_name like '%test001%';
AUT MAXBYTES BYTES FILE_ID
--- ---------- ---------- ----------
YES 10485760 20971520 13
SQL>
###attention here ,the command runs fine , but the valus of maxsize is not what we expected , it will be the same as 'BYTES'
SQL> ALTER DATABASE DATAFILE '/u01/app/oracle/oradata/test001.dbf' autoextend on maxsize 15M;
Database altered.
SQL> select AUTOEXTENSIBLE, MAXBYTES, BYTES, file_id from dba_data_files where file_name like '%test001%';
AUT MAXBYTES BYTES FILE_ID
--- ---------- ---------- ----------
YES 20971520 20971520 13
SQL>
MAXSIZE is a limit that you can override manually.
the MAXSIZE limits the automatic extension of the datafile but, Oracle let you
the possibility to override this by resizing manually your datafile.