Solved

Maximum space that can be allocated to a new data file

Posted on 2007-03-20
5
877 Views
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 ?
0
Comment
Question by:sapnam
5 Comments
 
LVL 17

Accepted Solution

by:
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
       EXTENT MANAGEMENT LOCAL UNIFORM SIZE 4M NOLOGGING;
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';
FILE_ID       AUT      FILE_NAME
----------    ---      -------
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;
 4194302*8
----------
  33554416
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.

cheers
Nickson
0
 
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.

HTH

!i!
0
 
LVL 34

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.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20591311
Forced accept.

Computer101
EE Admin
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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…

708 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

17 Experts available now in Live!

Get 1:1 Help Now