Maximum space that can be allocated to a new data file

Posted on 2007-03-20
Last Modified: 2008-01-09
We use Oracle 9i. I have to create a new tablespace with an underlying new data file of 500 MB.  I do not know how much free database size available.
I gave the command
select sum( bytes / ( 1024 * 1024 ) ) from dba_data_files;
and got 5145

So I think that means 5 GB of space is occupied by existing data files.

How do I know the maximum space I can allocate to this new datafile ?
Question by:sapnam
LVL 17

Accepted Solution

NicksonKoh earned 84 total points
ID: 18754516
Here's an extract I got from TOAD

There is always some ambiguity regarding the datafile size limit on a given platform and version of the database. This topic addresses a simple way of identifying the maximum size to which a datafile can grow before switching to the next datafile. To do this, create a tablespace with some default values and set AUTOEXTEND on without the MAXSIZE specified:

SQL> Create tablespace WORK_SPACE_DATA
       datafile '/keg4/oradata/fpdev1/work_space_data01.dbf'
       size 400M AUTOEXTEND ON
Get the file id of the datafile created for the WORK_SPACE_DATA tablespace:

SQL> select file_id,file_name,autoextensible
       from dba_data_files
       where tablespace_name like 'WORK_SPACE_DATA';
----------    ---      -------
31            YES      /keg4/oradata/fpdev1/work_space_data01.dbf
Querying the filext$ table, you can get the value of the maximum size in database blocks to which the datafile can grow before switching to the next file. This must be the maximum filesize that Oracle can understand for a database datafile.

SQL> select * from filext$
                     where file# = 31;
FILE#              MAXEXTEND             INC
----------        ----------           ----------
        31         4194302                1
Setting the default would give you a maximum value of 4194302 blocks with increments of 1 block when the datafile extends.

On a database of 8K block size this would work out to be:

SQL> select (4194302*8192)/1024 from dual;
The database datafile can have a maximum size of 33.55Gb on a 8k database block size and Sun Solaris8 platform. The above shows that the dependency is on the database block size for a given platform. If you do not set the MAXEXTEND for the datafile, then the first datafile would grow to the MAXEXTEND value. Only then would it shift to the next datafile for a given tablespace with multiple datafiles. This makes it imperative to set the MAXEXTEND value when turning on the AUTOEXTEND option.

LVL 22

Assisted Solution

by:Ivo Stoykov
Ivo Stoykov earned 83 total points
ID: 18754538
Hello sapnam

Nevertheless oracle manages larger files, I would obey the OS max file size limit becuase one could face dificulties trying to manipulate these data files lately through the OS.


LVL 35

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 83 total points
ID: 18756323
"How do I know the maximum space I can allocate to this new datafile?"

You cannot answer that question with information from Oracle only!  This also depends on how much free space your operating system has on the disk.  If your disk only has 300M of free space, you cannot create an Oracle data file larger than 300M on that disk.

If the disk show lots of free space though, then the maximum space you can allocate is the smallest of these three:
1. the available space on the disk
2. the O/S limit for a file size (with some 32-bit operating systems, this is 2GB)
3. the Oracle limit for a file size (varies by version of Oracle)

You didn't tell us your operating system, but I would guess that you could create a datafile of 2GB with no problem.  If you create a datafile larger than 2GB though, you may (or may not) have some problems with it.

Expert Comment

ID: 20591311
Forced accept.

EE Admin

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Swadhin
From the Oracle SQL Reference ( we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now