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

Similar Messages

  • 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.

  • Can I Drop a datafile from UNDOTBS

    Hi!!!!
    I want to drop a datafile from UNDOTBS . can I Drop it.
    If yes then how to drop ? what is the effect of it on database?
    If anybody knows the the answer then Pls reply..

    You can do this provided test it before doing it in production
    Steps.
    1. Create a new Undo tablespace
    2. Shutdown the database
    3. Change the parameter UNDO_TABLESPACE to the newly created undo tablespace
    4. Start the database
    5. Do whatever you want with the old undo tablespace.

  • 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

  • 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

  • Drop a datafile from physical standby's control file

    Hi,
    I am trying to create a physical standby database for my production...
    1) I have taken cold backup of my primary database on 18-Nov-2013...
    2) I added a datafile on 19-nov-2013 ( 'O:\ORADATA\SFMS\SFMS_DATA4.DBF' )
    3) Standby control file was generated on 20-ov-2013 (today) after shutting down and then mounting the primary database...
    When i try to recover the newly setup standby using archive files, i am getting the following error (datafile added on 19th Nov is missing)
    SQL> recover standby database;
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ORA-01157: cannot identify/lock data file 39 - see DBWR trace file
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    How to overcome this situation...
    Can i delete the entry for the newly added datafile from the backup control file ?
    When i tried to delete datafile using "alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF';", it is showing that database should be  open..
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      AUTO
    SQL> alter system set STANDBY_FILE_MANAGEMENT=manual;
    System altered.
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      MANUAL
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    Regards,
    Jibu

    Jibu wrote:
    Hi,
    I am trying to create a physical standby database for my production...
    1) I have taken cold backup of my primary database on 18-Nov-2013...
    2) I added a datafile on 19-nov-2013 ( 'O:\ORADATA\SFMS\SFMS_DATA4.DBF' )
    3) Standby control file was generated on 20-ov-2013 (today) after shutting down and then mounting the primary database..
    Hi,
    What is your version?
    If you added new datafile or created new tablespace, take backup again for restore new created standby database.
    If your standby  database running well, DG configuration success, then this datafile will create on standby side, too.
    Set STANDBY_FILE_MANAGEMENT=AUTO best practice.
    When i try to recover the newly setup standby using archive files, i am getting the following error (datafile added on 19th Nov is missing)
    SQL> recover standby database;
    ORA-00283: recovery session canceled due to errors
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ORA-01157: cannot identify/lock data file 39 - see DBWR trace file
    ORA-01110: data file 39: 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    How to overcome this situation...
    Can i delete the entry for the newly added datafile from the backup control file ?
    Not need any delete datafile from standby side, you must recreate standby database, or you can  take RMAN backup and restore to standby  side again.
    When i tried to delete datafile using "alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF';", it is showing that database should be  open..
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      AUTO
    SQL> alter system set STANDBY_FILE_MANAGEMENT=manual;
    System altered.
    SQL> show parameter STANDBY_FILE_MANAGEMENT
    NAME                                 TYPE        VALUE
    standby_file_management              string      MANUAL
    SQL> alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    alter tablespace SFMS_BR_DATA drop datafile 'O:\ORADATA\SFMS\SFMS_DATA4.DBF'
    ERROR at line 1:
    ORA-01109: database not open
    It is not logical, Physical  standby must be bit-for-bit same with Primary  database.
    Regards
    Mahir M. Quluzade

  • 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

  • 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.

  • Need to drop datafile from my undo tablespace

    I have a undo tablespace and it has 2 datafiles. i would like to drop one datafile.
    befor i am droping this datafile i am going to bring this file to offline and i got this message: ORA--01145 offline immediate disallowed unless media recovery enable.
    can someone tell me how i can safly do it without any problem.
    Thanks

    An undo tablespace can be dropped like any other tablespace, but not until all transactions within the tablespace are complete. First, specify a new undo tablespace as in the previous example. To see if the tablespace has any pending transactions, run the following query:
    SQL> select rn.name, rs.status
    2 from v$rollname rn, v$rollstat rs
    3 where rn.name in
    4 (select segment_name from dba_segments
    5 where tablespace_name = 'UNDOTBS')
    6 and rn.usn = rs.usn
    7 ;

  • 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

  • Droping a datafile from a tablespace

    I want to drop a datafile from a tablespace by using the query
    SQL> alter tablespace TS1 drop datafile 'OS path\df1';
    This query drops the datafile. But physically the datafile is present in the OS path. how to delete the datafile completely from the disk.

    Version:-
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    Although it's dropped on database level, I can't delete.If dropped data file from ORACLE, it deletes from OS level too. By any other processes being locked like antivirus and so on?
    SQL> select file_name from dba_data_files where tablespace_name='USERS';
    FILE_NAME
    C:\ORACLE\ORADATA\ORCL\USERS01.DBF
    C:\ORACLE\ORADATA\ORCL\USERS02.DBF
    SQL> alter tablespace users add datafile 'c:\oracle\oradata\orcl\users03.dbf' size 10m;
    Tablespace altered.
    SQL> host
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\bn2676>cd c:\Oracle\oradata\orcl
    c:\Oracle\oradata\orcl>dir users*
    Volume in drive C is System
    Volume Serial Number is 1853-3E21
    Directory of c:\Oracle\oradata\orcl
    02/15/2012  11:25 PM         5,251,072 USERS01.DBF
    02/16/2012  09:04 PM        10,493,952 USERS02.DBF
    02/16/2012  09:05 PM        10,493,952 USERS03.DBF
                   3 File(s)     26,238,976 bytes
                   0 Dir(s)  177,196,707,840 bytes free
    c:\Oracle\oradata\orcl>exit
    SQL> alter tablespace users drop datafile 'c:\oracle\oradata\orcl\users03.dbf';
    Tablespace altered.
    SQL> select file_name from dba_data_files where tablespace_name='USERS';
    FILE_NAME
    C:\ORACLE\ORADATA\ORCL\USERS01.DBF
    C:\ORACLE\ORADATA\ORCL\USERS02.DBF
    SQL> host
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    C:\Users\bn2676>cd c:\Oracle\oradata\orcl\
    c:\Oracle\oradata\orcl>dir user*
    Volume in drive C is System
    Volume Serial Number is 1853-3E21
    Directory of c:\Oracle\oradata\orcl
    02/15/2012  11:25 PM         5,251,072 USERS01.DBF
    02/16/2012  09:04 PM        10,493,952 USERS02.DBF
                   2 File(s)     15,745,024 bytes
                   0 Dir(s)  177,207,398,400 bytes free
    c:\Oracle\oradata\orcl>

  • How can I copy datafile (from one Raw device) to another Raw device ???

    can anybody tell me how do i copy/move one datafile from one raw device to another raw device.... ?
    I am having AIX 5.3 with SAN.
    Pls. help me...
    regards,
    Star Nirav

    Hello Hans,
    Currently I am using via RMAN... Want to know which one help me....? Is there any size limitation via dd command ? Can I use iocopy instead of dd in AIX ?
    man dd

  • Remove datafile from database

    Hello all,
    I have a database 11.1.0.7 where I wanted to remove a datafile. The database is in archivelog.
    The first thing that I did was to make sure that no data was in the datafile. - OK
    Then, since I only wanted to remove 1 week later, I put the datafile offline - OK
    On the day (one week after putting it offline) that I was going to remove/drop the datafile from the tablespace I got an ORA- saying to put the datafile online before dropping.
    And here is my problem! The database says that the datafile needs recover :(
    Questions:
    1- If the datafile was offline, why does it need recover?
    2- Do you thing that the database will ask for all archivelogs until now to recover this datafile ?
    3- If I dont want to apply all archivelogs, can I simply remove the datafile by recreating the controlfile without this datafile?
    Thank you.

    Questions:
    1- If the datafile was offline, why does it need recover?The SCN must be alligned with the DB
    2- Do you thing that the database will ask for all archivelogs until now to recover this datafile ?I never tried that with missing archived logs so I cannot say it. Just try and you will see.
    3- If I dont want to apply all archivelogs, can I simply remove the datafile by recreating the controlfile without this datafile?The problem is that this datafile is registered in the dictionary. You cannot do it.
    Probably you got this exception:
    ORA-03264: cannot drop offline datafile of locally managed tablespace
    Cause: Trying to drop offline datafile in lmts
    Action: Try to drop file after making it onlinehttp://download.oracle.com/docs/cd/B28359_01/server.111/b28310/dfiles006.htm#ADMIN11435
    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.

  • 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.

  • 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

Maybe you are looking for

  • SQL Loader and record order

    I am using sqlloader utility to load data from a CSV file in to a table. My .ctl file looks as below ------- 8< ------- options (errors=5,SILENT=(HEADER, FEEDBACK),direct=true) load data infile "mytest.csv" discardmax 0 into table owneruser.MY_TABLE

  • SE14 - mass check for Database objects

    Dear Gurus We have a lot of tables, that have error/problems in check DB14->Check->Database object How can I find all problematic tables in single report? Regards Vladimir

  • Vendor deletion/Block update from ECC to SNC

    Hi When vendor is blocked or deletion flag is set, and after that when vendor is CIFe'd to SNC, is the status in SNC get updated. We have an issue that after CIF status of vendor still PO are able to be confirmed on SNC side? Is somebody having cllue

  • Why is my mouse jumping up,down,side to side all over the page?

    This has been happening for a week. The mouse is jumping very fast; up,down,side to side, I can't find it sometimes; I cannot control it! == This happened == A few times a week == about 5 minutes ago again

  • What is the problem with Adobe flash player usage?

    Why doesn't adobe flash player work in my iPad?