0% found this document useful (0 votes)
33 views1 page

Extending The Size of Tablespace and Datafiles

Uploaded by

Mohammed Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views1 page

Extending The Size of Tablespace and Datafiles

Uploaded by

Mohammed Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Option 1

You can extend the size of a tablespace by increasing the size of an existing
datafile by typing the following command

SQL> alter database orcl datafile �/u01/oracle/data/icatbs01.dbf� resize 100M;

Option 2

You can also extend the size of a tablespace by adding a new datafile to a
tablespace.
This is useful if the size of existing datafile is reached o/s file size limit or
the drive where the file is existing does not have free space.
To add a new datafile to an existing tablespace give the following command.

SQL> alter tablespace add datafile �/u02/oracle/ica/icatbs02.dbf� size 50M;

Option 3

You can also use auto extend feature of datafile. In this, Oracle will
automatically increase the size of a datafile whenever space is required.
You can specify by how much size the file should increase and Maximum size to
which it should extend.

To make a existing datafile auto extendable give the following command

SQL> alter database datafile �/u01/oracle/ica/icatbs01.dbf� auto extend ON next 5M


maxsize 500M;

You can also make a datafile auto extendable while creating a new tablespace itself
by giving the following command.

SQL> create tablespace ica datafile �/u01/oracle/ica/icatbs01.dbf� size 50M auto


extend ON next 5M maxsize 500M;

To decrease the size of a tablespace

You can decrease the size of tablespace by decreasing the datafile associated with
it. You decrease a datafile only up to size of empty space in it. To decrease the
size of a datafile give the following command

SQL> alter database datafile �/u01/oracle/ica/icatbs01.dbf� resize 30M;

You might also like