Unable to drop datafile after dropping tablespace

Hi All,
Trying to Drop tablespace with Datafile, command used is as below
drop tablespace tims_db including contents and datafiles;
this was executed successfully, but still the datafile exists... tried dropping from OS, but unable to delete the file... associated trace alert logs are as below
Dump file c:\oracle\admin\ocprd\udump\ocprd_ora_4236.trc
Mon Feb 06 03:40:58 2012
ORACLE V9.2.0.6.0 - Production vsnsta=0
vsnsql=12 vsnxtr=3
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
Windows 2000 Version 5.0 Service Pack 4, CPU type 586
Redo thread mounted by this instance: 1
Oracle process number: 14
Windows thread id: 4236, image: ORACLE.EXE
*** 2012-02-06 03:40:58.562
*** SESSION ID:(52.7127) 2012-02-06 03:40:58.500
ORA-01259: unable to delete datafile E:\ORACLE\ORADATA\OCPRD\TIMSDB01.DBF
ORA-27056: skgfrdel: could not delete file
OSD-04024: Unable to delete file.
O/S-Error: (OS 32) The process cannot access the file because it is being used by another process.
OS : Windows 2000
DB : Oracle 9i
Please help
Thanks

user1687821 wrote:
As this is a production instance, we need approval to bounce it, If you are sure this file isn't needed - unlock with unlocker and move to some place for a while. Then kill it or kill it immediatly.
Secondly will the database ask for missing datafile when restarted the database even if it is not listed in dba_data_files...?If your tbs drop was successfull - everything will be fine

Similar Messages

  • DROP DATAFILE FROM A TABLESPACE

    What is the difference between "ALTER TABLESPACE DROP DATAFILE ..." and "ALTER DATABASE DATAFILE ... OFFLINE DROP"?
    I read the Oracle document before, it tolds me that the "ALTER DATABASE DATAFILE ... OFFLINE DROP" is not really drop data file. But, does the "ALTER TABLESPACE DROP DATAFILE ..." really drop data file?

    "ALTER DATABASE DATAFILE ... OFFLINE DROP"
    will take datafile offline to drop it later. In this case your control file will need to be recreated to de-link the datafile from database.
    From 10g onwards you can ALTER TABLESPACE DROP DATAFILE... but in this case datafile should not contain any data in it.

  • Automatic deleting of datafiles after DROP TABLESPACE

    Lazy junior dba question. How can i order oracle to delete files automaticly after deleting them from control file (like drop tablespace command)?
    What technology/approach should I use? Can ASM help me?
    Thnaks.

    Well, ideally after issuing
    DROP TABLESPACE <TBS_NAME> INCLUDING CONTENTS AND DATAFILES; the datafiles corresponding to that tablespace should get deleted automatically. Although, in my case, sometimes it gets deleted automatically, but sometimes it doesn't(Windows Server).
    Comments from others will be useful.
    Regards,
    Anand

  • How can i drop datafile when drop tablespace?

    I use oo4o.
    null

    Xiaoer (guest) wrote:
    : I use oo4o.
    As far as Oracle is concerned, a datafile is no longer
    accessible if it's no longer assigned to a tablespace. To
    physically remove the datafile, you should use your OS. Just
    make sure you:
    1) Really have dropped the tablespace
    2) You delete the correct datafile - anything with 'SYS' in
    the title is probably a bad idea!
    null

  • Unable to join network after dropping my ipod in the water... anyone know a solution?

    I put my ipod in the pocket in the back of my jeans and when i went to the washroom, it fell into the toilet... I immediatey took it and dried it with a hairdryer and then a few hours after.. it was able to reopen again, but im unable to join my network ever since then...
    Anyone can help me? Thanks.

    Does it see any networks?  If wifi is dim or grayed out see:
    iOS: Wi-Fi or Bluetooth settings grayed out or dim
    However, it is frequently a hardware problem.
    If can se networks, try:
    - Resetting the iPod:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Powering off and then back on the router
    - Resetting network settings: Settings>General>Reset>Reet Network Settingds
    - The roubleshooting here:
    iPhone and iPod touch: Troubleshooting Wi-Fi networks and connections

  • Question about ALTER TABLESPACE add/drop datafile

    Good afternoon,
    As an exercise, I created a tablespace STORETABS and added a datafile to it using the command:
    SQL> alter tablespace storetabs add datafile 'e:/storetabs3.dbf' size 50M;This step succeeded. A new file was created in the root of e: as expected.
    Following that command, I issued:
    SQL> alter tablespace storetabs drop datafile 'e:/storetabs3.dbf';
    Tablespace altered.The command succeeded. However, the file *'e:/storetabs3.dbf'* was not removed. After re-reading the documentation found at http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_3002.htm, I get the impression that removing the O/S file itself is something that always needs to be done manually.
    The question: Am I correct that there is no option to cause the "alter tablespace <tablespace> drop datafile <datafilename>" to delete the O/S file ? In other words, must the O/S file always be manually deleted as a separate step ?
    Thank you for your help,
    John.

    I believe in windows directory paths used backslash and not forward slash.
    You can argue why oracle does not give error, either while creating or while dropping ;)
    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 Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> select tablespace_name, file_name from dba_data_files ;
    TABLESPACE_NAME
    FILE_NAME
    USERS
    /u01/app/oracle/oradata/orcl/users01.dbf
    UNDOTBS1
    /u01/app/oracle/oradata/orcl/undotbs01.dbf
    SYSAUX
    /u01/app/oracle/oradata/orcl/sysaux01.dbf
    SYSTEM
    /u01/app/oracle/oradata/orcl/system01.dbf
    EXAMPLE
    /u01/app/oracle/oradata/orcl/example01.dbf
    SCOTT_TBS
    /home/oracle/scott_f1.dat
    6 rows selected.
    SQL> !ls -l scott_f1.dat   
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat
    SQL> alter tablespace scott_tbs add datafile '/home/oracle/scott_f2.dat' size 10M ;
    Tablespace altered.
    SQL> !ls -l scott_*.dat
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat
    -rw-r----- 1 oracle oinstall  10493952 Sep 11 21:18 scott_f2.dat
    SQL> alter tablespace scott_tbs drop datafile '/home/oracle/scott_f2.dat' ;
    Tablespace altered.
    SQL> !ls -l scott*.dat
    -rw-r----- 1 oracle oinstall 276832256 Sep 11 21:15 scott_f1.dat

  • 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

  • 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

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

  • Create standby having offline dropped datafile .

    Hi,
    How to deal with offline dropped datafiles on source when creating standby .
    I've 4 node rac, and one tablespace offline and related bigdatafile droped offline (because of corruption).
    SQL> select tablespace_name , status from dba_tablespaces order by status ;
    TABLESPACE_NAME                STATUS
    OLD_TBS                         OFFLINE
    SQL> select TS#,STATUS,ENABLED from v$datafile order by status;
           TS# STATUS  ENABLED
            16 OFFLINE DISABLED
    Its 4 node RAC 10.2.0.3 and ASM .
    select name,TS#,STATUS,ENABLED from v$datafile order by status
    +DBG1/dbname/datafile/bigfile.279.615031073
    Currently I'm doing something like that
    rman target /
    catalog backuppiece '/oarch/backup/bigfile.279.615031073';
    run{
    allocate channel ch1 type disk;
    SET NEWNAME FOR DATAFILE 16 TO '+DBG1';   
    restore datafile 16 from tag='TAG20100209T124507';
    SWITCH DATAFILE 16;
    release channel ch1;
    and then after duplicate is end
    SQL> alter database datafile 16 offline drop;
    SQL> recover automatic standby database;Please advice.
    Regards
    GregG

    Hi GregG,
    I think there is no requirement to file the request with Oracle. :-) Please check the below testcase where I tried to simulate the scenario this time by using RMAN.
    Primary Database: oraprd
    Physical Standby database: oraphy
    SYS @ oraprd>select tablespace_name,file_id from dba_data_files;
    TABLESPACE_NAME                   FILE_ID
    SYSTEM                                  1
    SYSAUX                                  2
    UNDOTBS1                                3
    USERS                                   4
    TEST                                    5
    SYS @ oraprd>select TS#,file#,STATUS,ENABLED from v$datafile order by status;
           TS#      FILE# STATUS  ENABLED
             6          5 OFFLINE DISABLED
             1          2 ONLINE  READ WRITE
             2          3 ONLINE  READ WRITE
             4          4 ONLINE  READ WRITE
             0          1 SYSTEM  READ WRITEConfigure catalog (controlfile) to exclude an offline tablespace TEST and perform the full database backup with standby control file
    C:\>rman target sys/abc123@oraprd
    connected to target database: ORAPRD (DBID=2633932676)
    RMAN> configure exclude for tablespace 'TEST';
    using target database control file instead of recovery catalog
    Tablespace TEST will be excluded from future whole database backups
    new RMAN configuration parameters are successfully storedprimary database backup with standby control file
    RMAN> run{
    2>  allocate channel d1 type disk;
    3>  allocate channel d2 type disk;
    4>  backup database format 'c:\temp\rman_oraprd_%U.bkp';
    5>  backup archivelog all format 'c:\temp\rman_arch_%U.bkp';
    6>  backup current controlfile for standby format 'c:\temp\rman_standby_%U.bkp';
    7>  }
    released channel: ORA_DISK_1
    allocated channel: d1
    channel d1: SID=9 device type=DISK
    allocated channel: d2
    channel d2: SID=143 device type=DISK
    Starting backup at 15-JUN-12
    file 5 is excluded from whole database backup  <===
    channel d1: starting full datafile backup set
    channel d1: specifying datafile(s) in backup set
    input datafile file number=00001 name=C:\APP\XYZ\ORADATA\ORAPRD\ORAPRD\DATAFILE\O1_MF_SYSTEM_DATA_D-ORA11PRD_I-2924940358_TS-SYSTEM_FNO-1_07NDBK6A_.DBF
    input datafile file number=00003 name=C:\APP\XYZ\ORADATA\ORAPRD\ORAPRD\DATAFILE\O1_MF_UNDOTBS1_DATA_D-ORA11PRD_I-2924940358_TS-UNDOTBS1_FNO-3_0ANDBK7H_.DBF
    channel d1: starting piece 1 at 15-JUN-12
    channel d2: starting full datafile backup set
    channel d2: specifying datafile(s) in backup set
    input datafile file number=00002 name=C:\APP\XYZ\ORADATA\ORAPRD\ORAPRD\DATAFILE\O1_MF_SYSAUX_DATA_D-ORA11PRD_I-2924940358_TS-SYSAUX_FNO-2_08NDBK6A_.DBF
    input datafile file number=00004 name=C:\APP\XYZ\ORADATA\ORAPRD\ORAPRD\DATAFILE\O1_MF_USERS_DATA_D-ORA11PRD_I-2924940358_TS-USERS_FNO-4_09NDBK6B_.DBF
    channel d1: specifying datafile(s) in backup set
    including standby control file in backup set
    channel d1: starting piece 1 at 15-JUN-12
    channel d1: finished piece 1 at 15-JUN-12
    piece handle=C:\TEMP\RMAN_STANDBY_0VNDJJR2_1_1.BKP tag=TAG20120615T123858 commen
    t=NONE
    channel d1: backup set complete, elapsed time: 00:00:03
    Finished backup at 15-JUN-12
    released channel: d1
    released channel: d2
    RMAN> exitBuild the physical standby database using RMAN
    C:\>rman target sys/abc123@oraprd auxiliary sys/abc123@oraphy
    connected to target database: ORAPRD (DBID=2633932676)
    connected to auxiliary database: ORAPRD (not mounted)
    RMAN>
    RMAN>  run{
    2>  allocate auxiliary channel a1 type disk;
    3>  allocate auxiliary channel a2 type disk;
    4>  duplicate target database for standby nofilenamecheck;
    5>  }
    using target database control file instead of recovery catalog
    allocated channel: a1
    channel a1: SID=134 device type=DISK
    allocated channel: a2
    channel a2: SID=10 device type=DISK
    Starting Duplicate Db at 15-JUN-12
    contents of Memory Script:
       restore clone standby controlfile;
    executing command: SET NEWNAME
    Starting restore at 15-JUN-12
    file 5 is excluded from whole database backup <==
    channel a1: starting datafile backup set restore
    channel a1: specifying datafile(s) to restore from backup set
    channel a1: restoring datafile 00002 to C:\APP\XYZ\ORADATA\ORAPRD\ORAPHY\DATAFILE\O1_MF_SYSAUX_DATA_D-ORA11PRD_I-2924940358_TS-SYSAUX_FNO-2_08NDBK6A_.DBF
    channel a1: restoring datafile 00004 to C:\APP\XYZ\ORADATA\ORAPRD\ORAPHY\DATAFILE\O1_MF_USERS_DATA_D-ORA11PRD_I-2924940358_TS-USERS_FNO-4_09NDBK6B_.DBF
    channel a1: reading from backup piece C:\TEMP\RMAN_ORAPRD_0PNDJJN7_1_1.BKP
    datafile 3 switched to datafile copy
    input datafile copy RECID=10 STAMP=786026596 file name=C:\APP\XYZ\ORADATA\ORAPHY\ORAPHY\DATAFILE\O1_MF_UNDOTBS1_7XPWYO19_.DBF
    datafile 4 switched to datafile copy
    input datafile copy RECID=11 STAMP=786026596 file name=C:\APP\XYZ\ORADATA\ORAPHY\ORAPHY\DATAFILE\O1_MF_USERS_7XPWYN8N_.DBF
    Finished Duplicate Db at 15-JUN-12
    released channel: a1
    released channel: a2
    RMAN>start the managed recovery
    SYS @ oraphy>recover managed standby database disconnect;
    Media recovery complete.
    SYS @ oraphy>select TS#,file#,STATUS,ENABLED from v$datafile order by status;
           TS#      FILE# STATUS  ENABLED
             6          5 OFFLINE DISABLED
             1          2 ONLINE  READ WRITE
             2          3 ONLINE  READ WRITE
             4          4 ONLINE  READ WRITE
             0          1 SYSTEM  READ WRITE
    SYS @ oraphy>select thread#,sequence#,process,status from v$managed_standby;
       THREAD#  SEQUENCE# PROCESS   STATUS
             1         24 RFS       IDLE
             1         22 MRP0      WAIT_FOR_GAP  <---------------
    ....archive the current log on the primary database
    SYS @ oraprd>select thread#,sequence#,status from v$log;
       THREAD#  SEQUENCE# STATUS
             1         22 INACTIVE
             1         23 ACTIVE
             1         24 CURRENT
    SYS @ oraprd>alter system archive log current;
    System altered.
    SYS @ oraphy>select thread#,sequence#,process,status from v$managed_standby;
       THREAD#  SEQUENCE# PROCESS   STATUS
             1         25 RFS       IDLE
             1         25 MRP0      WAIT_FOR_LOG <--------  the recovery is in progress on the standby database.
    ....Regards,
    Vaibhav

  • Dropped datafile can't be removed from database

    I have a new dba on my team that mistakenly added a datafile to a tablespace in the wrong directory. When attempting to remove it he offlined it and then tried to drop it. It would not drop. He deleted the file from the file system. I am in archivelog mode and tried to recover datafile but no success.
    Oracle 10.2.0.4 on solaris 10 Any ideas?

    Try this.....from
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/recoscen.htm#sthref1366
    To re-create a datafile for recovery:
    Create a new, empty datafile to replace a damaged datafile that has no corresponding backup. For example, assume that the datafile ?/oradata/trgt/users01.dbf has been damaged, and no backup is available. The following statement re-creates the original datafile (same size) on disk2:
    ALTER DATABASE CREATE DATAFILE '?/oradata/trgt/users01.dbf' AS
    *'/disk2/users01.dbf';*
    This statement creates an empty file that is the same size as the lost file. The database looks at information in the control file and the data dictionary to obtain size information. The old datafile is renamed as the new datafile.
    Perform media recovery on the empty datafile. For example, enter:
    RECOVER DATAFILE '/disk2/users01.dbf'
    All archived logs written after the original datafile was created must be applied to the new, empty version of the lost datafile during recovery.
    If this does not work let us know your errors and problems.
    Regards
    Tim

  • Wifi keeps scanning and dropping even after connected to home network.  Never had this issue until the update, and now my phone runs slow and terrible.  Horrible update!!  Any ideas on a fix?

    Wifi keeps scanning and dropping even after connected to home network.  Never had this issue until the update, and now my phone runs slow and terrible.  Horrible update!!  Any ideas on a fix?

    It's important that you have a steady WiFi connection, ZealousEdge. What phone do you have? Is your phone unable to connect to any WiFi network? If you can, please try deleting the saved WiFi network and re-adding it.
    AndreaS_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • While dropping the old undo tablespace we get an error

    Hello friends ,
    i Cannot drop old undo tablespace. While dropping the old undo tablespace we get an error
    ERROR at line 1:
    ORA-01548: active rollback segment '_SYSSMU77$' found, terminate dropping
    tablespace
    SQL> select tablespace_name, status, segment_name from dba_rollback_segs where status != 'OFFLINE';
    TABLESPACE_NAME STATUS SEGMENT_NAME
    SYSTEM ONLINE SYSTEM
    APPS_UNDO NEEDS RECOVERY _SYSSMU77$
    Please help
    Thanks
    Edited by: Vicky C on Dec 23, 2012 9:23 AM

    Hi peter
    We not using rman backup only cold backup.. i tried using cold backup in ramn block media recovery but that recovery needs archive log
    RMAN> BLOCKRECOVER DATAFILE 158 BLOCK 48829;
    Starting blockrecover at 18-DEC-12
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=437 devtype=DISK
    channel ORA_DISK_1: restoring block(s) from datafile copy /var/undo/undo02.dbf
    starting media recovery
    media recovery failed
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of blockrecover command at 12/18/2012 16:45:11
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-00279: change 5975281035000 generated at 12/08/2012 06:00:58 needed for thread 1
    ORA-00289: suggestion : /prod/archlogs/1_465484_683651989.dbf
    ORA-00280: change 5975281035000 for thread 1 is in sequence #465484
    ORA-00278: log file '/prod/archlogs/1_465484_683651989.dbf' no longer needed for this re covery
    we did not have block media recovery needed archivelog
    Regards
    Vignesh C

  • DROP DATAFILE in Oracle 10g Rel2

    Hi,
    I have dropped my test tablespace and forgot to include:
    'INCLUDING CONTENTS AND DATAFILES;'
    Now the tablespace is gone but the data file is ofcourse there.
    If I do following:
    ALTER DATABASE DATAFILE 'C:\ORACLE\ORADATA\ORABASE\TOOLS02.TOM'
    OFFLINE DROP;
    I get the error message:
    ORA-01516: nonexistent log file, datafile, or tempfile "C:\temp\ts_test.dbf"
    I checked the dba_data_files view and can not see the file.
    Can I just delete the file manually or do I need to
    to create a new tablespace and move the datafile to the new tablespace.
    And than drop the new tablespace including datafile and contents?
    Thanks

    Hi,
    >>Can I just delete the file manually ...
    Yes, you can
    Cheers

  • Dropping datafiles

    Can I drop datafiles individually, or do I need to drop the entire tablespace? The ALTER TABLESPACE command doesn't appear to have a drop datafile clause. I've dropped enough objects in the tablespace to reduce the amount of space used to 1%, but there are still a dozen objects including tables and indexes. There are also references to and from these objects to objects in other tablespaces.
    Kevin Tyson

    ALTER DATABASE dbname
    DATAFILE filename OFFLINE DROP;
    Does not actually drop datafiles. It only takes them offline if the database is in noarchivelog mode.
    However, that section in the SQL reference goes on to say...
    "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. "
    Which answers my question.

Maybe you are looking for