Datafile in Tablespace : 1x 16Go or 4x4Go ?

Hello,
i just want to know witch is more efficient :
A Tablespace with 1 datafile of 4 Go or a Tablespace with 4 datafile of 4Go each ? (access, backup...)
Thanks in advance
Phil

Hello,
i just want to know witch is more efficient :
A Tablespace with 1 datafile of 4 Go or a Tablespace with 4 datafile of 4Go each ? (access, backup...)
Thanks in advance
Phil

Similar Messages

  • Multiple datafiles per tablespace in 9i?

    Is it recommended to have multiple datafiles per tablespace?

    Is it recommended to have multiple datafiles per
    tablespace?It all depends on your particular storage needs. You could have a single datafile at maximum capacity for your tablespace, just ensure you can store it and in case you have to move it, it could be affordable.
    There are DBA's who use several datafiles for a single tablespaces, this reduces the single point of failure possibility and allows a more flexible datafile maintenance.
    Performance is the same for, except for the checkpoint process, the more datafiles, the more effort to update datafile headers.
    ~ Madrid

  • Adding No. of Datafiles to TableSpace

    Hi All,
    I have doubt regarding adding no. of datafiles to Tablespace. I wanna connect my application to Oracle10g database. As a DBA I am going to allocate on separate Tablespace to this new Application. As time will pass the data acumulated by the application would reach in GBs, So how should I control the datafile???
    1) Shall I add only one Big datafile to the TB
    OR
    2) Periodically I should go on adding the datafile as it crosses the particular limit of
    data size???
    What policy should I follow....
    Regards,
    Darshan

    Hi,
    There is no issue in creating multiple datafiles while creating database or adding them later. If space is no constraitn for you then you should create multiple datafiles during creation of database.
    Also create then with AUTOEXTEND clause and you don't have to put this clause OFF if you create it with MAXSIZE parameter. It's always better tot have MAXSIZE parameter defined because this will not allow your datafile to grow bigger then the MAXSIZE parameter size. Here is example of adding a datafile to tablespace with MAXSIZE clause;
    ALTER TABLESPACE users
    ADD DATAFILE '/u02/oracle/rbdb1/users03.dbf' SIZE 10M
    AUTOEXTEND ON
    NEXT 512K
    MAXSIZE 250M;
    After defining the MAXSIZE, keep a close eye on growth of data in datafile and when its near to fill add a new datafile to tablespace and keep this cycle on....
    Regarding your second question :
    You are write that data is written 2nd to datafile when first one is full. But you try to validate this point running database then sometimes you will find that 2nd datafile is consuming more space then 1st, even have 1st datafile is sufficient empty. This is due to fact od frequent deletions in the tables who resides in datafile.
    Hope that you got some hints......

  • How many datafile in tablespace

    Hi,
    I have migrate database 9i to 10g so some question is required?
    how many datafile in tablespace ?
    i hv following query is use
    select file_name,tablespace_name from dba_data_file ?

    Dear Mohamed
    Select name, ts#
    from v$datafile;
    this statment give you only the datafiles
    and
    select file_name, tablespace_name
    from dba_data_files;
    give you the tablespace name and datafiles
    thank you
    Mohamed Tawfik

  • Drop one datafile from Tablespace

    Hi,
    I have 9i Database on Linux. I want to drop one datafile from tablespace. I have tried to drop datafile through following command but it gave no effect.
    alter database datafile <datafile name> offline drop;
    What should i have to do for dropping datafile?
    Do the needful
    Thankx in advance.

    Hi
    since you dont specify the database version or if you have it setup as archivelog or noarchivelog mode, i paste the drop specs for dropping a datafile, from SQL Reference manual of 9i
    DROP If the database is in NOARCHIVELOG mode, you must specify the DROP
    clause to take a datafile offline. However, the DROP clause does not remove the
    datafile from the database. To do that, you must drop the tablespace in which the
    datafile resides. Until you do so, the datafile remains in the data dictionary with the
    status RECOVER or OFFLINE.
    If the database is in ARCHIVELOG mode, Oracle ignores the DROP keyword.
    Regards
    Message was edited by:
    pcambra

  • Any Software/Program to keep track of growth of Datafiles and Tablespaces

    Hi,
    I am looking for a program that can keep an eye on the growth of the datafiles and tablespaces as well as it can raise an alert when the growth is critical regarding the space.
    Can anybody suggest me such program/tool/utility/script?
    Thanks in advance.
    Himanshu

    There are plenty of vendors out there that sell very high-end database monitoring tools. Quest has a whole suite of them. Any of these guys should have tablespace monitoring (and a variety of other reports) as part of the package.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Script for adding datafile to tablespace

    Hi
    Does anyone have a template alter tablespace add datafile script handy?
    Basically, we need to, in the event of a tablespace alert, do two things:
    query that tablespace to see how much space is remaining.
    ascertain the size of the datafiles added to that tablespace already (to clarify what size we should make the additional datafile)
    finally, the command itself for adding the extra datafile.
    Thanks.
    10.0.2.0

    SELECT Total.tablespace_name "TSPACE_NAME",
    round(nvl(TOTAL_SPACE,0),2) Tot_space,
    round(nvl(USED_Space,0),2) Used_space,
    round(nvl(TOTAL_SPACE - USED_Space,0),2) Free_space,
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2) "USED%"
    FROM
    (select tablespace_name, sum(bytes/1024/1024) TOTAL_SPACE
    from sys.dba_data_files
    group by tablespace_name
    ) Total,
    (select tablespace_name, sum(bytes/1024/1024) USED_Space
    from sys.dba_segments
    group by tablespace_name
    ) USED
    WHERE Total.Tablespace_name(+) = USED.tablespace_name and
    round(nvl(round(nvl((TOTAL_SPACE - USED_Space)*100,0),2)/(Total_space),0),2)< 20;
    the above query will display tablespaces which are having freespace below 20%
    select file_name,autoextensible,sum(bytes)/1024/1024,sum(maxbytes)/1024/1024
    from dba_data_files
    where tablespace_name='TBS_NAME'
    group by file_name,autoextensible;
    the above query will give details of datafiles like autoextensible or not etc.
    SELECT SUBSTR (df.NAME, 1, 40) file_name,dfs.tablespace_name, df.bytes / 1024 / 1024 allocated_mb,
    ((df.bytes / 1024 / 1024) - NVL (SUM (dfs.bytes) / 1024 / 1024, 0))
    used_mb,
    NVL (SUM (dfs.bytes) / 1024 / 1024, 0) free_space_mb
    FROM v$datafile df, dba_free_space dfs
    WHERE df.file# = dfs.file_id(+)
    GROUP BY dfs.file_id, df.NAME, df.file#, df.bytes,dfs.tablespace_name
    ORDER BY file_name;
    the above query will show how much freespace is left in each datafile.

  • More small datafiles or one big datafile for tablespace

    Hello,
    I would like to create a new tablespace (about 4 GB). Could someone if it's better to create one big datafile or create 4 datafiles with 1 GB each?
    Thank you.

    It depends. Most of the time, it's going to come down to personal preference.
    If you have multiple data files, will you be able to spread them over multiple physical devices? Or do you have a disk subsystem that virtualizes many physical devices and spreads the data files across physical drives (i.e. a SAN)?
    How big is the database going to get? You wouldn't want to have a 1 TB database with 1000 1 GB files, that would be a monster to manage. You probably wouldn't want a 250 GB database with a single data file either, because it would take forever to recover the data file from tape if there was a single block corruption.
    Is there a data files size that fits comfortably in whatever size mount points you have? If you get 10 GB chunks of SAN at a time, for example, you would probably want data files that were an integer factor of that (i.e. 1, 2, or 5 GB) so that you can add similarly sized data files without wasting space and so that you can move files to a new mountpoint without worrying about whether they'll all fit.
    Does your OS support files of an appropriate size? I know Windows had problems a while ago with files > 2 GB (at least when files extended beyond 2 GB).
    In the end though, this is one of those things that probably doesn't matter too much within reason.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Can't drop UNDOTBS datafile and tablespace

    The datafile is already offline but i still can't drop either that or the entire UNDOTBS tablespace.
    Please help!

    Hi,
    the answer gives by mr stevencallan is right.
    first create new undo tablespace for ur instance and then assign this undo tablespace by
    alter system set undo_tablespace=<undo_tb name> scope=both;
    later u drop ur old undo tablespace.
    no need of any shutdown inthis scenario.
    Thanks and Regards
    Kuljeet Pal Singh

  • Drop datafile from tablespace

    I'm new to oracle.
    After I extended a tablespace I understood that it was too large.
    I've been reading about how to drop a tablespace, but I don't want to drop the entire tablespace. I just want to drop the last datafile of this tablespace.
    I know how to drop tablespaces in sapdba and brtools, but I don't know how I can drop one specific datafile (number 29) of the tablespace PSAPBTABD?
    Please Help med.
    Best regards
    Harald V

    Hello Harald,
    see please this thread:
    Re: How to drop data file?
    also the section 43. <i>How can I delete a data file that was created by mistake</i>
    in the SAP Note<i><b> 592393 - FAQ: Oracle</b></i>
    if you have Oracle 9i databases, it is not easy to drop a datafile, but in Oracle 10g
    you can drop a datafile like that:
    <b><i>ALTER TABLESPACE</i></b> <<u><i>Tablespace Name</i></u>> <b><i>DROP DATAFILE</i></b> '<<u>PATH und NAME of Datafile</u>>';
    for example,  you have a tablespace called PSAPC11 and you want to drop a datafile called dat.data15 of this tablespace, you can drop it like that:
    e.g. <b><i>alter tablespace</i></b> <u>PSAPC11</u> <b><i>drop datafile</i></b> <u>'/oracle/C11/psapc11/dat.data15'</u>
    Best regards
    Baran

  • When to add datafile to tablespace

    Hi! I would like to ask at what percent used of the tablespace should you add another datafile to accommodate the data?
    Thank you.

    Ok Imagine that you have 1000$ and everyday you buying something in 1 Dollar , so the 1000$ will not be 1000$ which mean it will be decrease with time , the same for One Data file you create datafile with space and also with max size , but everytime you insert data this consider as size so you will need to add another data file to avoid any errors.

  • Alter tablespace add datafile taking too much time

    Hi All,
    DB Version :10.2.0.1
    OS Version: Windows Server 2003 32 Bit
    When i am trying to add datafile into tablespace it takes lot of time approx 8 hours.but earlier it take approx 40 to 60 mins
    When i check Alert log file i got the message:
    ORA-604 signalled during: alter tablespace crbt add datafile
    I check there is sufficent space in Disk as i need to add Datafile of 30G.
    Syntax i am using is
    ALTER TABLESPACE TEST
    ADD DATAFILE 'C:\TEST02.DBF' SIZE 30G
    Can anyone tell me exactly the reason for the same
    Thanks in advance

    Hi Aman,
    The space is added sometime but most of the time i am getting this error
    SQL> ALTER TABLESPACE IN_OCT2011
    2 ADD DATAFILE 'E:\CAT\IN_OCT04.DBF' SIZE 30G REUSE;
    ALTER TABLESPACE IN_OCT2011
    ERROR at line 1:
    ORA-19502: write error on file "E:\CAT\IN_OCT04.DBF", blockno 11008
    (blocksize=8192)
    ORA-27072: File I/O error
    OSD-04008: WriteFile() failure, unable to write to file
    O/S-Error: (OS 33) The process cannot access the file because another process
    has locked a portion of the file.
    Kindly help over the same
    Edited by: Vikas Kohli on Nov 5, 2011 8:38 PM

  • Adding datafile automatically when tablespace is 90% full

    Hi,
    I have a tablesspace having a name user01.dbf(Auto extensible to 4 GB) user02.dbf(Auto extensible to 4GB) ..........
    I am just thinking about automatically creating datafile(alter tablespace add datafile).
    1. (total number of datafiel in tablespace) *4 - space used by dba_segments belonging to user tablespace. if it returns less then 1 GB space, then add a datafile.
    And I will put it on CRONTAB. and it will run every 24/7.
    Does not this look weired?
    Advice:
    1. Don't we have any option like the database server will trigger an event when it is 90% and I can trap this event and run a command to add a datafile. I know internally it will do the same but still I feel if you have a feature then why not use it.
    Any information will be helpful in this regards. And the same question is for OS level do I have to check it every second, space on the file system?

    Do one thing ,write a script which will check free space of your tablespaces like..
    SELECT NAME FROM V$DATABASE;
    select to_char(sysdate,'dd-MON-yyyy hh:mi:ss')Snap_ShotTime from dual;
    SELECT Total.name "Tablespace Name",
    nvl(free_space, 0) free_space,
    nvl(total_space-free_space, 0) Used_space,
    total_space
    FROM
    (select tablespace_name, sum(bytes/1024/1024) free_Space
    from sys.dba_free_space
    group by tablespace_name
    ) free,
    (select b.name, sum(bytes/1024/1024) TOTAL_SPACE
    from sys.v_$datafile a, sys.v_$tablespace B
    where a.ts# = b.ts#
    group by b.name
    ) Total
    WHERE free.Tablespace_name(+) = Total.name
    AND Tablespace_name <> 'PERFSTAT'
    ORDER BY Total.name;
    and find the %age of used space Vs free space.Enable your mail server which will send you the alerts.
    Put in crotab file and set them accordingly..
    Pratap

  • Tablespace with datafiles on many disks

    Hello,
    I am using Oracle 11g R2 on AIX 7.1
    I am planing to create a tablespace where it is datafiles on 4 disks.
    How can I specify a datafile to be on a disk while creating the tablespace?
    Regards,

    NB wrote:
    thanks for the info.
    No i have no control on the disks.
    I am doing that for better performance so I will put each datafile of a tablespace on a disk, and I/O will decrease.
    How can I achieve that ?
    again if the 4 disks are mounted on a single mount point /u01
    Edited by: NB on Mar 17, 2012 11:08 AMRead this.
    Consider the Performance Impact_
    The number of datafiles contained in a tablespace, and ultimately the database, can have an impact upon performance.
    Oracle Database allows more datafiles in the database than the operating system defined limit. The database DBWn processes can open all online datafiles. Oracle Database is capable of treating open file descriptors as a cache, automatically closing files when the number of open file descriptors reaches the operating system-defined limit. This can have a negative performance impact. When possible, adjust the operating system limit on open file descriptors so that it is larger than the number of online datafiles in the database.
    Place Datafiles Appropriately_
    Tablespace location is determined by the physical location of the datafiles that constitute that tablespace. Use the hardware resources of your computer appropriately.
    For example, if several disk drives are available to store the database, consider placing potentially contending datafiles on separate disks.This way, when users query information, both disk drives can work simultaneously, retrieving data at the same time.
    Source:-
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/dfiles001.htm

  • No of Datafiles needed in single tablespace ?

    hi,
    i have one tablespace of size 120gb with 23 datafiles in which first 19 datafiles are size with 2gb each. and rest data files are size with around 28 gb.
    Recently i heard that by keeping more no of datafiles will affect the performance of Database . so my question is what are the advantage and disadvantage of keeping more no of
    datafiles in single tablespace and how can i merge small data files of 2 gb ?
    Regards,
    Mithun Mathew
    Oracle DBA

    After going through couple of links provied by google i made a note on this issue :
    Optimizer does not consider number of data files when selecting execution path. Also as a general rule, you do not deal with I/O performance at tablespace level. You cannot stripe the contents of a tablespace across multiple datafiles. This need to be dealt with at a lower level (like inside Oracle ASM).
    Advantages: (More Datafiles)
    1.By using more than one datafile per tablespace, you can spread data over many different disks to distribute the I/O load and improve performance.
    2.Easy and faster restoration and recovery. The more datafiles for a given amount of data, some recovery scenarios will be faster due to having to restore/recover a smaller file.
    3.Less chances of encountering 2gb
    issue.(http://www.fors.com/velpuri2/Oracle%20block%20structure/2gb)
    4.Having multiple datafiles per tablespace facilitates the adoption of a uniform datafile size policy, which in turn facilitates disk load rebalancing.
    5.For file system based databases, having multiple datafiles may reduce the risk of contention for the operating system's datafile read/write locks (inode locks).
    6.If any corruption happens in a datafile, then there is less data loss chances in compare to one or less datafile.
    Disadvantages: (More Datafiles)
    1.We can not have BigFile Tablespace's advantages.
    2.Tough managebility and portability.
    3.Putting tablespace offline will offline all the datafiles, which will stop other applications/of its parts unnecessarily.
    4.More datafiles for DBWR for writting and more files for RMAN to backup.
    5.Many datafiles are opens when we online tablespace; means many file handlers for OS at kernel side.
    6.We have to carefull to create rollback segments because, never create rollback segments using multiple datafiles within a single tablespace.
    7.The more datafiles, the more time required to do checkpoints and such, because every file has to have its header updated.
    8.More entries in data dictionary, control file entries more file structs in SGA vs less or 1.
    Regards
    Girish Sharma

Maybe you are looking for