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: Newbie: Creating new database files

Re: Newbie: Creating new database files

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Wed, 8 Nov 2006 13:34:04 GMT
Message-ID: <J8Ez0v.Lv1@igsrsparc2.er.usgs.gov>

> I still can't find the command to extend a file once created though. I
> initially entered the following;
>
> SQL> create tablespace datafile 'c:\trash\my_tablespace.dbf' size 200000;
>
> I then had a look in the directory and saw the 200,000 byte file (I was kind
> of expecting it in 512 byte blocks - oh well that's VMS for ya!) so I
> decided to try to extend it but couldn't find the command.
>
> Looking on the web, I have found that you should initialize to what you
> think should last for a while and include the extend clause in the create
> statement. Still wouldn't mind a single command to extend it though.
>
> Thanks to all,
>
> Ade
>
>

You can set up a datafile to automatically extend, after the fact, by issuing the following command:

ALTER DATABASE DATAFILE '/directory/filename' AUTOEXTEND ON NEXT xxM MAXSIZE yyM;

The above will wait for the datafile to get full. If more space is requested in the datafile, the file will increase by the NEXT amount provided the MAXSIZE has not yet been reached and there is room on the physical disk device.

If you want to change the file size right now and not wait for it to automatically extend, you can resize it:

ALTER DATABASE DATAFILE '/directory/filename' RESIZE xxM;

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Wed Nov 08 2006 - 07:34:04 CST

Original text of this message

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