How to drop datafile?

Hi, I tried to remove Users tablespace from SQL Developer 3 EA but could not because report an error stating: The tablespace contains materialized views and / or indexes, if I set the offline tablesapce not eliminate it.
Try this because I want to rebuild (re-create the tablespace) because in an insert of more than 1000000 of rows, the system increased the space (100 to 380 MB) but never insert operation completed successfully and that space increased is wasted.
Roberto
Edited by: rober584812 on Oct 17, 2010 3:08 PM

drop tablespace tt;drop tablespace tt
ошибка в строке 1:
ORA-01549: раздел не пуст, используйте опцию INCLUDING CONTENTS
drop tablespace tt including contents;Раздел удален.
ps
sorry for my NSL_LANG :)
Edited by: dimka9 on 18.10.2010 10:21

Similar Messages

  • How to drop datafiles and contents

    how to drop datafiles and contents without dropping tablespace?

    May be this helps,
    http://www.mydigitallife.info/2007/08/04/how-to-rename-or-move-oracle-tablespace-datafile-to-another-location/

  • How to drop datafiles in oracle 10g r2

    Hi all,
    Db :oracle 10.2.0.3
    os:solaris 10
    tablespace name: jllp_tabs01
    datafile:
    /ora/data001/jllp/jllp_tbs01_tbl_1.dbf
    /ora/data001/jllp/jllp_tbs01_tbl_2.dbf
    /ora/data001/jllp/jllp_tbs01_tbl_3.dbf
    /ora/data001/jllp/jllp_tbs01_tbl_4.dbf
    its has consisting of 4 datafiles, I need to drop the 2 of them perminently.
    the datafile are having data.
    how to drop the datafiles.
    please suggest me.

    There is no way to drop the datafiles once they are added to the tablespace. The command given by Asif , offline drop won't actually drop the datafile but would be an indication only to Oracle that you would be dropping the entire tablespace after issuing this command. In 11g, there is a command to drop the datafile but only if it's completely empty.
    HTH
    Aman....

  • 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

  • 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

  • How to online datafile of rollback segment of NO archive log available

    I set offline datafile of rool back segement and rename it
    but when I try to online , get error to recover
    I try to recover but unfortunately all archive log was deleted ( kind of cron job in unix aotu delete these file)
    Pls advice how can I set this data file online without the archive log ( while databse still up and running) Oracle version is 8i not possible to drop datafile by sql.
    in roll back segment I have 3 data files as below and the rb04.dbf is offline
    usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs01.dbf
    /usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs03.dbf
    /usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf
    sequence of what I did is below:
    SQL> alter database datafile '/usr/Systems/1354RM_1/databases/dbsnml/data/rbs04.dbf' offline;
    Database altered.
    SQL> alter tablespace RBS rename datafile '/usr/Systems/1354RM_1/databases/dbsnml/data/rbs04.dbf' to '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf';
    Tablespace altered.
    SQL> alter database datafile '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf' online;
    alter database datafile '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf' online
    ERROR at line 1:
    ORA-01113: file 13 needs media recovery
    ORA-01110: data file 13:
    '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf'
    SQL> recover datafile '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf';
    ORA-00279: change 71449081 generated at 12/23/2008 20:18:05 needed for thread 1
    ORA-00289: suggestion :
    /usr/Systems/1354RM_1_7.1_Master/OSRES/data/warm_repl/WarmArchive/arch_1_455922.
    arc
    ORA-00280: change 71449081 for thread 1 is in sequence #455922
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00308: cannot open archived log
    '/usr/Systems/1354RM_1_7.1_Master/OSRES/data/warm_repl/WarmArchive/arch_1_455922
    .arc'
    ORA-27037: unable to obtain file status
    HP-UX Error: 2: No such file or directory
    Additional information: 3

    SQL> alter tablespace RBS rename datafile '/usr/Systems/1354RM_1/databases/dbsnml/data/rbs04.dbf' to '/usr/Systems/1354RM_1_7.1_Master/databases/dbsnml/data/rbs04.dbf';Did you rename the file at OS level after you issued above command? Oracle will not rename the file at OS level.
    Other than that, if you plan to change rollback segment tablespace, better create a new one and create new rollback segment in new tablespace and drop the old one.

  • Recovering Dropped Datafile

    Hi,
    I have accidently dropped SYSAUX datafile... How can I recover it?
    I used " ALTER DATABASE DATAFILE ‘<datafile name with complete path>’ OFFLINE DROP;" to drop the datafile...
    Please suggest me...
    Thanks
    KSG

    The first question I would like to have been answerred is the fact if the datafile still exists on the filesystem ? The second question would be if you are running in archive log mode ? If so you could try the following approach, if no archive logs are there and no backup:
    - The alter database command has only removed the entry from the controlfile, so the datafile is only missing there as an administrative problem.
    - alter database backup controlfile to trace; (trace file containing the controlfile create script)
    - add in the script the dropped datafile.
    - Bring down the database with an shutdown immediate
    - make a backup from the whole database (just to have your start position always there !!)
    - run the create controlfile script.
    You could end up with a database which will not open due to recovery issues, but probably this is fixable.
    Regards, Gerwin

  • 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

  • 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 recover datafile.when control file auto backup is off

    hi friend
    i took hot backup of my database using following command
    rman>backup database;
    in my case controlfile auto backup is off.
    and i have lost my all controlfiles as well as datafiles except spfile.
    i have recovered control file using dbms_backup_restore package.
    know i am able to mount database using following command
    rman> startup mount;
    when i wrote following command
    rman> restore database;
    i got following error
    RMAN-06023: no backup or copy of datafile name found to restore
    enven i have backup of datbase.
    can anybody tell me how to recover datafiles in this case.
    thanking you
    sohail

    hi,
    I think you might have a problem here as the error from RMAN is described in the following metalink note
    Doc ID: Note:100565.1
    You should change you backup script to be something like
    rman {
    backup database include current controlfile;
    do you have any earlier backups of your database?
    regards
    Alan

  • How to add datafile in asm

    Hi,
    Can anybody let me know how to add datafile using ASM
    DB- ORACLE 10.2
    OS-RHEL

    SQL> select name from v$asm_diskgroup;
    NAME
    DATA1
    DATA
    Above we are having two asm diskgorup
    SQL> alter tablespace users add datafile ‘+data1′ size 5M;
    Tablespace altered.
    SQL> select name from v$datafile;
    NAME
    +DATA1/nonasmtoasm/datafile/system.259.721108803
    +DATA1/nonasmtoasm/datafile/undotbs1.261.721108865
    +DATA1/nonasmtoasm/datafile/sysaux.260.721108841
    +DATA1/nonasmtoasm/datafile/users.262.721108873
    +DATA1/nonasmtoasm/datafile/users.269.721187971                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to drop a schema and load another one?

    I have an interruption during installing the central instance of a SAP Netweaver 04s System. After I restarted the installation I found this message in the Log file.
    <b>ERROR 2006-08-16 16:17:04</b>
    CJS-30109 The Java load in database PDV/liesc1ddbw01 has already been configured. <p> SOLUTION: Drop the schema and load it with a new load before running this installation.
    <b>ERROR 2006-08-16 16:17:04</b>
    CJS-30109  The Java load in database PDV/liesc1ddbw01 has already been configured. <p> SOLUTION: Drop the schema and load it with a new load before running this installation.
    <b>ERROR 2006-08-16 16:17:04</b>
    FCO-00011  The step getJavaLoadType with step key |NW_Java_CI|ind|ind|ind|ind|0|0|NW_CI_Instance|ind|ind|ind|ind|10|0|getJavaLoadType was executed with status ERROR.
    QUESTION: How to drop a schema and load another one?

    Hello,
    I got the similar error....but i did reinstall from o.s. and done the installation again...it was worked successfully..
    if you find out alternate solution for that ...please let us know..
    Regards,

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

  • How to drop user giving error ORA-03113

    hello,
    I am trying to drop user as follows
    SQL> drop user jbponm_trf cascade;
    drop user jbponm_trf cascade
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    SQL>
    pls suggest me how to drop user.

    Hi Dear,
    Please reconnect from SYS and try again ,Looking there is some problem in your oracle connection or network problem.
    Best Regards
    Faheem latif
    Senior Database Architect
    Genie Technologies (Pvt.) Ltd.

  • How to recreate datafile in oracle 10g.

    pls tell me how to recreate datafile in oracle 10g...
    what are situation to recreate datafile
    Edited by: 898085 on Nov 18, 2011 9:16 PM

    898085 wrote:
    pls tell me how to recreate datafile in oracle 10g...
    what are situation to recreate datafile
    Edited by: 898085 on Nov 18, 2011 9:16 PMDid u mean create or recreate?
    if datafie is deleted then you may add it into existing tablespace.
    Try this : -
    1.)sqlplus sys/xx as sysdba
    2.)alter tablespace <tablespace_name> add datafile <datafile_name> size <give size>;
    HTH:-)

Maybe you are looking for

  • How do I transfer my purchased apps from my old ipad to my new ipad?  All with the same Apple ID and Itunes account.

    I just purchased a new Ipad with 4G yesterday and I am trying to transfer my purchased apps from my old Ipad to the new one.  We have one Apple ID and one Itunes account that we are using. 

  • Help in enlarging Database for CRM research

    Hello, My name is Oren and I`m a research assistance in Ariel University in Israel. We are leading a worldwide research about competitive advantage in CRM software. It will be very helpfull if anyone of you will fill a survey about using the CRM soft

  • Cant download creative cloud or other apps

    I tried to download the trial of Illustrator and it states "You are running an operating system that Illustrator no longer supports. Refer to the system requirements for a full list of supported platforms".  So I tried to download creative cloud and

  • Addressbook from MAcServer very slowly and crashing

    Hello we have a mac mini server here. I created a new user called publicab and put 2500 adresses in its adressbook. when using it from a client (wifi n, 300mbit), there are big poblems with efficiency. We can change few addresses, then the AB crashes

  • Como recupero los tonos comprados?

    tuve que formatear mi tlf y la copia de seguridad que tenia era muy vieja y no estaban los tonos nuevos comprados en itunes, los intente buscar de nuevo, pero la unica opcion que me aparece es volverlos a comprar, hay alguna forma de recuperarlos????