Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Extending Tablespace

Re: Extending Tablespace

From: Darryl E Balaski <darryl_e_balaski_at_groton.pfizer.com>
Date: Tue, 12 Jan 1999 13:17:22 -0500
Message-ID: <369B91B2.D28@groton.pfizer.com>


ben dunlop wrote:
>
> Hi All,
>
> How would I go about a simple method to extend a table space from the
> command line ?
>
> If anyone can assist in the syntax and methodology I would be very
> grateful.
>
> Regards
>
> Ben {the new user}

Yup, it is easy look at ORACLE SERVER SQL Reference for the ALTER DATABASE command (should be around chapter 4 page 16-> 30.

Here is an example of what you need to do... Look at the data files for the tablespace in question with the following query.

Select tablespace_name,file_name, (bytes/1024/1024) from dba_data_files
where tablespace_name = <tablespace which needs to be extended>;

which will produce a listing of all the datafiles and their size (in MB) associated with a tablespace.. Note, there may be more than 1 datafile.

example:

Tablespace   File_name                                     Size MB
-----------  -------------------------------------------   -------
DATA         /ora01/oradata/prod/data/prod_data_01.dbf     100


then you would issue:

alter database datafile
'<data_file to be resize>' resize <size in k or m>;

example:
alter database datafile
'/ora01/oradata/prod/data/prod_data_01.dbf' resize 150M;

That is it...
BTW:
1) You can also add a datafile, but don't do that unless you are attempting to spread I/O over another device.... 2) You can set the datafile to autoextend which I would not recommend -- i've seen it lead to too many problems!

sincerely,
darryl dB Balaski
www.rdbms.org Received on Tue Jan 12 1999 - 12:17:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US