Setting your datafiles to extend automatically results in the following:
You can specify automatic file extension when you create datafiles via the following SQL commands:
The following example enables automatic extension for a datafile, FILENAME2, added to the USERS tablespace:
ALTER TABLESPACE users ADD DATAFILE 'filename2' SIZE 10M AUTOEXTEND ON NEXT 512K MAXSIZE 250M
The value of NEXT is the minimum size of the increments added to the file when it extends. The value of MAXSIZE is the maximum size to which the file can automatically extend.
The next example disables automatic extension for the datafile FILENAME2:
ALTER DATABASE DATAFILE 'filename2' AUTOEXTEND OFF
See Also: For more information about the SQL commands for creating or altering datafiles, see the .
Because you can change the sizes of datafiles, you can add more space to your database without adding more datafiles. This is beneficial if you are concerned about reaching the maximum number of datafiles allowed in your database.
Manually reducing the sizes of datafiles allows you to reclaim unused space in the database. This is useful for correcting errors in estimates of space requirements.
In this example, assume that the datafile FILENAME2 has extended up to 250M. However, because its tablespace now stores smaller objects, the datafile can be reduced in size.
The following command decreases the size of datafile FILENAME2:
ALTER DATABASE DATAFILE 'filename2' RESIZE 100M
Note: It is not always possible to decrease the size of a file to a specific value.
See Also: For more information about the implications resizing files has for downgrading, see the Oracle7 Server Migration.
For more information about the ALTER DATABASE command, see the .