Drop one datafile

Hi,
I have 5 datafile in one tablespace. If i want to drop perticular one datafile from the tablespace can you please suggest me some command to do this activity.
Thank You

Hi,
My database version is 9i on Linux and this database in No archivelog mode.
Is it possible to drop one datafile from one Tablespace.
Thankx in advance.

Similar Messages

  • 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

  • Dropping a datafile

    Can we drop one datafile from a tablspace?
    I have a tablespace TS1 which has 3 datafiles.i made one datafile offline and trying to drop that particular datafile....is it possible ?
    SQL> alter database datafile 'E:\ORACLE\ORADATA\TESTDB\KISH1.DBF' DROP;
    alter database datafile 'E:\ORACLE\ORADATA\TESTDB\KISH1.DBF' DROP
    ERROR at line 1:
    ORA-01916: keyword ONLINE, OFFLINE, RESIZE, AUTOEXTEND or END/DROP expected
    the errror is we are not giving the right option but Oracle itself is suggesting a DROP option...CAN ANYONE HELPME OUT
    THANKS

    I have tried this. If the tablespace contains objects, when you issue command
    alter tablespace <tablespace_name> drop datafile <datafile_name>;
    you will get ORA-03263
    If the tablespace is empty, you can drop the second datafile.
    It doesn't make sense to me to drop one of the datafile. You can drop the entire tablespace with "including contents and datafiles" and create another tablespace. I rarely got the situation to drop one of the datafile.

  • How to drop the datafile in a tablespace

    hi,
    I need to drop the datafile in a tablespace.How to drop the datafile in the tablespace.If iam able to drop the datafile and is it possible to create the datafiles with the same name.could u pls help me out..
    Thanks in advance,
    R.Ratheesh

    sql > alter database <datafile> offline drop ;
    sql > alter database open ;What if the datafile have the segments in it, I believe users will not be able to access them. And system will put the datafile to Recovry mode not drop it.
    Dropping a datafle is possible only in 10G. In 9i you can reduce the size of file below the size of your min extents so that the space wont be allocated from that datafile or you may need to recreate a new tablespace copy all the segments from old tablespace and drop old one.
    Cheers

  • Recover from dropped SYSAUX datafile

    Trying to recover a DEV database without rebuilding it, but not hopeful at this point. Basically, someone dropped the SYSAUX (and a few other) datafiles, so now they are showing up in the database as MISSING0003 instead of the actual filename. There are no backups, but I want to drop the tablespaces (not SYSAUX) and in trying to do so, I'm getting an error about the SYSAUX tablespace for some reason. How can I rebuild or recover from the SYSAUX issue, since I cannot drop the SYSAUX tablespace, as it seems to be preventing me from dropping any of the other tablespaces that have missing datafiles as well. I really just need to recreate the tablespaces, but get the below error when I try to drop the schemas (with cascade) or the tablespaces (including contents).
    SQL> drop tablespace DATA001 including contents;
    drop tablespace DATA001 including contents
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 2
    ORA-00376: file 3 cannot be read at this time
    ORA-01111: name for data file 3 is unknown - rename to correct file
    ORA-01110: data file 3: 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\MISSING00003'
    ORA-06512: at line 19
    Any help to get past the first issue of dropping the non-SYSTEM tablespaces would be great, and any follow-up on how to rebuild/recreate/recover from the dropped SYSAUX datafiles would be appreciated as well.
    DB is 10gR2 on Windows.

    user4257171 wrote:
    Trying to recover a DEV database without rebuilding it, but not hopeful at this point. Basically, someone dropped the SYSAUX (and a few other) datafiles, so now they are showing up in the database as MISSING0003 instead of the actual filename. There are no backups,
    > DB is 10gR2 on Windows.
    Without backups you are not going to be able recover the dropped data files. Given that one of the tablespaces was the required SYSAUX tablespace you are most likely looking at a rebuild instead of a restore.

  • ORA-03264: cannot drop offline datafile of locally managed tablespace

    Hi list
    A datafile was acidentally created on filesystem in one node of two nodes RAC.
    After that the filesystem on which the datafile was created was out of space because of automatic control file backup and sysadmin move this datafile to another device. And before this action RMAN backup stopped work.
    Now we replace the datafile to the original location, but it stay offline and recover status, and we cant bring them online because the customer dont have necessary archive logs to recover this datafile. RMAN backup is now working. But now we need to create a DataGuard on a third server and want to drop this datafile.
    This datafile dont have any data segment and stay in most critical tablespace of the customer application which have more datafiles. This datafile in question isnt the first datafile of the tablespace.
    SQL> select file#, status from v$datafile where name='/oracle/product/db/ars/dbs/arsystem.old';
    FILE# STATUS
    21 RECOVER
    SQL> select file#, status from v$datafile_header where name='/oracle/product/db/ars/dbs/arsystem.old';
    FILE# STATUS
    21 OFFLINE
    How can I drop this datafile?
    Thanks
    Cristiano

    Review this metalink note, what to do:
    How to 'DROP' a Datafile from a Tablespace
    Doc ID:111316.1
    If you cannot recover the datafile, you have to export the 'rest' of the tablespace (after statement 'alter database datafile '/oracle/product/db/ars/dbs/arsystem.old' offline drop;' was successfully issued). Afterwards drop the tablespace,recreate it and import the data).
    Werner

  • Drop offline Datafile

    Oracle Database version - 10.2.0.3
    I have a tablespace with 2 datafiles. One of the datafile is offline since couple of months. Now I am trying to drop the offline datafile but its not possible to drop that datafile.
    As its production environment I can not take the tablespace in offline mode.
    Can anyone please suggest suitable solution to drop the datafile?
    Regards,
    Sandeep

    SQL> alter tablespace AUDIT_REPORT drop datafile '/data/zus26d-0701/oracle/u04/PZHINF01/cust_idx_04.dbf';
    alter tablespace AUDIT_REPORT drop datafile '/data/zus26d-0701/oracle/u04/PZHINF01/cust_idx_04.dbf'
    ERROR at line 1:
    ORA-03264: cannot drop offline datafile of locally managed tablespace
    SQL>

  • How to drop the datafile?

    Hello Everybody
    is it possible to drop the datafile? i have run the query ALTER DATABASE DATAFILE 'c:\oracle\oracle_db\m300\user\user01.dbf' offline drop. After i checked with DBA_DATA_FILES its there.Can any one help in this regards
    Regards
    Hameed

    Please see this link:
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14231/dfiles.htm#i1006556
    Restrictions for Dropping Datafiles
    The following are restrictions for dropping datafiles and tempfiles:
    The database must be open.
    If a datafile is not empty, it cannot be dropped.
    If you must remove a datafile that is not empty and that cannot be made empty by dropping schema objects, you must drop the tablespace that contains the datafile.
    You cannot drop the first or only datafile in a tablespace.
    This means that DROP DATAFILE cannot be used with a bigfile tablespace.
    You cannot drop datafiles in a read-only tablespace.
    You cannot drop datafiles in the SYSTEM tablespace.
    If a datafile in a locally managed tablespace is offline, it cannot be dropped.
    Regards

  • Dropping system datafile

    Dear all,
    10.2.0.4 on solaris 10
    We created some additional datafiles for system tablespace as we enabled auditing. Auditing is cancelled as per the requirement
    from management. now , out of 7 datafiles, 4 are empty.Is it safe to
    drop this datafiles .(am checking the free space of the datafile from
    toad object browser )
    Thanks
    Kai

    No. You can never drop datafiles in the SYSTEM tablespace. (You can resize them downards).
    One more reason why it is a bad idea to create objects in the SYSTEM tablespace.
    Hemant K Chitale

  • Drop undo datafile

    Hi,
    Database is 10.2.0.4
    I m planning to drop my undo datafile ..im falling short of space on server
    I have 2 undo datafiles in different mount points. First one is 10GB and second one is 2 GB
    Can i go ahead...i hope there is no risk in dropping second undo file...
    Pls advice
    Thanks

    Create a new undo tablespace
    switch database to then new undo tablespace
    drop the old one undo tablespace
    Don't drop just one datafile. undo tablespace is in use as Your db is in use and probably some activity is going there.

  • I am trying to drag and drop one page of a .pdf into another .pdf in Acrobat Reader.  I used to be able to drag and drop from one .pdf to another.

    I am trying to drag and drop one page of a .pdf into another .pdf in Acrobat Reader.  I used to be able to drag and drop from one .pdf to another.

    If you could drag and drop pages before, it wasn't in Reader. You no doubt had Adobe Acrobat (Pro or Standard) which shouldn't be confused with Adobe Acrobat Reader. They recently added Acrobat to the name of Adobe Reader so the confusion about which product you had and/or have is understandable.

  • Drop a datafile that is offline and not on the OS

    I am running a 2 node rac on ASM . 10gR2 on HP UX.
    By mistake 1 datafile has been deleted on the OS , and that datafile is marked as offline in the dba_data_files.
    How can I drop the datafile from the database.
    since when I query the dba_data_files the datafile 10 ( which was deleted on OS ) , shows its still present and online_status is offline.
    The datafile is not required and also there is no backup for the datafile.
    Thanks

    Hi,
    ALTER DATABASE DATAFILE '<full file spec>' OFFLINE DROP;
    example: just give '+dg1/../../..' if it not exists also give the same
    Kind Regards,
    Rakesh Jayappa

  • Can i use one datafile from different database to my database ?

    hi,
    i copied one datafile from development server to my database ? how can i use this datafile
    can i re-create controlfile , please suggest?
    Edited by: 819136 on Jan 12, 2011 2:45 AM

    I have create the controlfile please find the below details
    SQL> startup nomount
    ORACLE instance started.
    Total System Global Area 612368384 bytes
    Fixed Size 1298160 bytes
    Variable Size 255852816 bytes
    Database Buffers 348127232 bytes
    Redo Buffers 7090176 bytes
    SQL> CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
    2 MAXLOGFILES 5
    3 MAXLOGMEMBERS 3
    4 MAXDATAFILES 14
    5 MAXINSTANCES 1
    6 MAXLOGHISTORY 226
    7 LOGFILE
    8 GROUP 1 'E:\ORACLE\ORADATA\ORCL\REDO01.LOG' SIZE 100M,
    9 GROUP 2 'E:\ORACLE\ORADATA\ORCL\REDO02.LOG' SIZE 100M,
    10 GROUP 3 'E:\ORACLE\ORADATA\ORCL\REDO03.LOG' SIZE 100M
    11 DATAFILE
    12 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF',
    13 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF',
    14 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF',
    15 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF',
    16 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF',
    17 *'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEST01.DBF'*
    18 CHARACTER SET WE8MSWIN1252;
    CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG
    ERROR at line 1:
    ORA-01503: CREATE CONTROLFILE failed
    ORA-01159: file is not from same database as previous files - wrong database id
    ORA-01110: data file 43: 'E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\TEST01.DBF'
    SQL>
    SQL> ALTER DATABASE OPEN RESETLOGS;
    ALTER DATABASE OPEN RESETLOGS
    ERROR at line 1:
    ORA-01507: database not mounted

  • Dropping a Datafile and Deleting its References

    Using sqlplus how do I delete datafiles and any references to them?
    At the moment I start the database in mount mode and use:
    ALTER DATABASE DATAFILE 'O:\BCS\test.ora' OFFLINE DROP;
    Which drops the datafile, but when I try to open the database it fails because it is still referencing the datafile.
    How do I delete this reference?
    Any thoughts or suggestions are greatly appreciated.
    Regards
    Toby

    I usually use the following sql to see what is in a tablespace before I drop it with
    "drop tablespace users including contents and datafiles;"
    column meg format 999999999
    column tablespace_name format a20
    set wrap off
    set lines 120
    set heading on
    set pages 50
    select round(sum(a.bytes)/1024/1024) meg,
    count(*) extents,a.tablespace_name,a.segment_type,a.owner||'.'||a.segment_name
    from dba_extents a
    where a.tablespace_name=upper('&1')
    group by a.tablespace_name,a.segment_type,a.owner||'.'||a.segment_name
    order by round(sum(a.bytes)/1024/1024)
    I also map the contents of datafiles with the following you can get the file_id from v$datafile or dba_data_files:
    column owner format a30
    column object format a30
    set lines 120
    set wrap off
    set trunc off
    set pages 50
    set feedback on
    column file_id format 999
    select     /*+ Rule */     'free space' owner     /*"owner" of free space*/
    ,          ' ' object          /*blank object name*/
    ,          file_id                    /*file id for the extent header*/
    ,          block_id               /*block id for the extent header*/
    ,          blocks                    /*length of the extent, in blocks*/
    from          dba_free_space
    where          file_id=&1
    union
    select     /*+ Rule */ substr(owner,1,20)||' '||substr(segment_type,1,9) /*owner name (first 20 chars)*/
    ,          substr(segment_name,1,32)||'.'||partition_name     /*segment name*/
    ,          file_id                    /*file id for the extent header*/
    ,          block_id               /*block id for the extent header*/
    ,          blocks                    /*length of the extent, in blocks*/
    from           dba_extents
    where          file_id=&1
    order by     3,4
    And datafiles can be dropped in 10g if they are empty:
    alter tablespace users drop datafile '/oracle/oradata/users01.dbf';
    Good luck

  • How to recover data if one datafile was lost

    if i have a tablespace with 5 datafiles 9i or 10g...
    it's a fictional scenario :)
    one was lost during db start up
    and other 4 was still thre
    if no backup avail for restore and no archivelog for recreating the datafile
    how do i recovery data in this tablesapce ??
    thanks in advance!!
    br/ricky

    i know it's against my own statements
    just saying that i'm lazy , and don't want to write those PL/SQL to recovery the data
    alright , here is the story of why i asked this :
    Data source ------- Regional DB ------- Global DB----people
    i'm manaing regional DB which fetchs data from it's source
    and global db fetch's some key data from regional every hour
    so if one datafile in regional db was broken ,
    i don't really care about the data , most of them was already in global db ,
    and people only views report from global db
    and i can just as easy get the lost data from data source ( keeps 3 days )
    so basically what i care most is let the tables back to work ASAP ,
    and not those historical data , it does not matter that much , i only keep 2 weeks of them anyway
    it might appear strange to many DBA that protect the data as treasure....
    as a second thought , this is a somewhat silly question ;)
    thanks anyway ...

Maybe you are looking for

  • Outlook asks for credentials 2 times

    Hello, I'm in the middle of a transition from SBS 2011 to 2012 R2. Currently Exchange 2010 and 2013 co-exists. Every time I start Outlook (2013)  it asks for credentials. If I use [email protected] format it does not accept. If I use domain\user form

  • Can't use tab and esc function with wireless keyboard

    I've recently installed the wireless apple keyboard and it works fine when typing emails, etc., but I can't seem to scroll with the arrows, tab through emails, use the ESC button to close email messages, etc. Is this fixable?

  • Can i stop a timer in between

    hello, i have  a situatino where i have to monitor the time elapsed for an application but in one specific condition(say a switch toggle) i have to stop the timer and then resume the timing when the condition aborts. how do i achieve that?? awaiting

  • Hierarchy Problem ( Duplicates  records Problem)

    Gurus- I'm having a problem with cost center Hierarchy , my problem is if a person is the head of cost center , he can manage 4 to 5 Cost center, I configured in bw Ex:  Mr X as a Text Node Under him is  all the Cost center  Character under the tedxt

  • Account Determination group code and Chart of account code..?

    Dear Expertise, In purchase order item level in account assignment section node we can add G/L Account determination group. .. G/L account BO are saved against Chart of account code. G/L account determination group not available in this GENERALLedger