Maximum space that can be allocated to a new data file

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 ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ivo StoykovCommented:
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.


Mark GeerlingsDatabase AdministratorCommented:
"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.
Forced accept.

EE Admin
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.