Maximum space that can be allocated to a new data file

Posted on 2007-03-20
Medium Priority
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 336 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 332 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 36

Assisted Solution

by:Mark Geerlings
Mark Geerlings earned 332 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

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

607 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