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

Similar Messages

  • 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 drop the multi columns?????

    how to drop the multi columns in oracle
    Like
    alter table drop column a,b;
    is it possible.

    how to drop the multi columns in oracle
    Like
    alter table drop column a,b;
    is it possible.Yes, it is possible.
    RTFM:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#i2124702
    pratz

  • How to defragment the datafile hwm in EBS R12 database

    Hi All,
    We are on 1204 E-biziness instance on 11gR2 database.
    We have deleted(purged some EGO data and got the huge space in dba_segments. it was around 2.5 gb after purging activity we got
    SQL> select sum(bytes/1024/1024/1024) from dba_segments;
    SUM(BYTES/1024/1024/1024)
    734.867561
    SQL>
    SQL> select sum(bytes/1024/1024/1024) from dba_data_files;
    SUM(BYTES/1024/1024/1024)
    2456.70493
    SQL>
    But in datafile the HWM is not reduced, i checked by moving the big tables, even though i am not getting the space in datafile level, i need to resize my datafile size to 1TB , take backup and clone the target which is having 1TB space.
    For example in apps_ts_tx_data we have only 243Gb segments but the datafiles size it is having 1000GB, we have to reduce the datafile size to that 300Gb, how to do it?
    =======
    SQL> select sum(bytes/1024/1024/1024) from dba_segments where tablespace_name='APPS_TS_TX_DATA';
    SUM(BYTES/1024/1024/1024)
    243.981201
    SQL> select sum(bytes/1024/1024/1024) from dba_data_files where tablespace_name='APPS_TS_TX_DATA';
    SUM(BYTES/1024/1024/1024)
    1070.2343
    SQL>
    ==========
    I thought of creating one tablespace of 300GB and move all objects into new tablespace , drop old tablespace and rename new tablespace to 'APPS_TS_TX_DATA', but we have objects like below, Pl guide me what is the best method of doing this and reduce my database size to 1TB. so that i can accomplish my task
    ====
    SQL> select DISTINCT SEGMENT_TYPE,count(*) FROM DBA_SEGMENTS where tablespace_name='APPS_TS_TX_DATA' group by SEGMENT_TYPE;
    SEGMENT_TYPE COUNT(*)
    INDEX 275
    INDEX PARTITION 509
    INDEX SUBPARTITION 96
    LOB PARTITION 8
    LOB SUBPARTITION 96
    LOBINDEX 460
    LOBSEGMENT 460
    TABLE 14615
    TABLE PARTITION 2079
    TABLE SUBPARTITION 96
    10 rows selected.
    ====
    Thanks in advance..

    Please see these docs.
    How to Reorganize INV Schema / Reclaim the High Watermark [ID 555058.1]     
    Optimizing Database disk space using Alter table shrink space/move compress [ID 1173241.1]
    Why is no space released after an ALTER TABLE ... SHRINK? [ID 820043.1]
    Various Aspects of Fragmentation [ID 186826.1]
    Thanks,
    Hussein

  • How to reduce the size of Temporary Tablespace - URGENT

    Hi all,
    I need your help urgently. I have one Default Temporary Tablespace TEMP in my Oracle 9i database. There are two files in the tablespace each of size 32GB. I need to reduce the size or if possible i need to remove on datafile from the tablespace.
    Could you please provide me with the solution of this?
    This is really very urgent.
    Thanks in advance
    Himanshu

    Add a new temporary tablespace.
    Set this to default database temp tablespace.
    Then you can drop the old TS when all the pending transactions are complete if they are using temp space.
    Also, you need to investigate as to why your temp tablespace files were 32 GB in size. Looks like your application is doing too much sorting.

  • How to reduce the size of SYSTEM tablespace?

    * Solaris
    * Oracle 9.2.0.4.0
    * Locally managed database (since SYSTEM is locally managed TS)
    I have a Oracle 9i database with is around 7 months old. Over the 7 months it had around 400 schema’s at most and SYSTEM tablespace was increased to 850MB. Now it only has around 120 schema’s and size of the SYSTEM tablespace still 850MB and it’s 99% used.
    How can I get more free space on system tablespace?
    * I have made sure that non-sys(tem) user don’t have objects on SYSTEM tablespace.
    * I understand that dropping schema does not give you all the space back, since objects are store as row in System tables etc.
    Increasing disk is not an option for me. Any tips to free space on system welcome.
    Thanks,
    Nazrul Islam

    Thanks Joel Pérez for trying to help.
    SQL> select segment_name, owner from
    dba_segments
    where owner not in
    ('SYS','SYSTEM','OUTLN','MDSYS','ORDSYS','WMSYS')
    and
    TABLESPACE_NAME='SYSTEM';
    SEGMENT_NAME                   OWNER
    TOAD_PLAN_SQL                  TOAD
    TOAD_PLAN_TABLE                TOAD
    PLSQL_PROFILER_RUNS            TOAD
    PLSQL_PROFILER_UNITS           TOAD
    PLSQL_PROFILER_DATA            TOAD
    TPSQL_IDX                      TOAD
    TPTBL_IDX                      TOAD
    SYS_C006895561                 TOAD
    SYS_C006895563                 TOAD
    SYS_C006895566                 TOAD
    10 rows selected.
    SQL> select owner from dba_segments where
    tablespace_name='SYSTEM'
    group by owner;
    OWNER
    OUTLN
    SYS
    SYSTEM
    TOAD
    WMSYSHere is my query (to show TOAD is taking very little
    space):r.- That is true, the space used by TOAD is little
    >
    SQL> select owner, SUM(bytes)/1048576 AS "TOTAL
    (MB)"
    from dba_segments
    where tablespace_name = 'SYSTEM'
    group by owner order by "TOTAL (MB)" desc;
    OWNER                 TOTAL (MB)
    SYS                     820.4375
    SYSTEM                      20.5
    WMSYS                     3.6875
    TOAD                       .6875
    OUTLN                       .375Looks like, I have to grow system. Or since I have a
    fixed number of schema now, I think I will have to
    recreate a DB to reduce SYSTEM size.
    Joel one other info that might explain why
    this happening. Part of our build process is to drop
    4 schemas and roles and recreate them.
    e.g.
    drop user nislam cascade;
    create user nislam ....And we do many builds a day. Maybe Oracle uses more
    space in doing that since new userid, better might be
    drop objects from the schema. WHAT do you
    say?
    r.- In theorical lines. Both must give the same results but... I would recommend you to carry out some intensive test about it in a test enviroment testing both methods to monitor the behavior of the growth of the tablespace system. As you said, perhaps dropping the user objects will get better results.
    >
    Regards,
    Nazrul IslamJoel Pérez
    http://otn.oracle.com/experts

  • Draft Proposal: How to drop the Fx Prefix

    A draft proposal has been posted to the Flex Open Source Wiki documenting how we will adjust the packages, namespaces, and class names in Gumbo to allow us to drop the Fx class prefixes.  Please read and add your comments here:
    http://opensource.adobe.com/wiki/display/flexsdk/Dropping+the+Fx+Prefix
    Note that this page does not cover the necessary changes to CSS, which are documented on the forums at
    http://www.adobeforums.com/webx/.59b802c9
    Looking forward to your comments and suggestions,
    Ely.

    Hi Uri..
    Yes, thats what i have read but i still have ten temp tables with same prefix and different session code at the end . I am sure there are no open/active sessions tied to them .want to know if there is a bug with SQL server 2005 SP2 version  ?
    I am executing the stored proc using SQL Agent job so when it fails does it end the session ? if not how do i do it ?
    if i add the below query to the proc does it drop rest of the old temp tables ?
    IF EXISTS (
    SELECT *
    FROM sys.tables
    WHERE name LIKE '#temp%')
    DROP TABLE #temp
    Thanks, Sri The journey is what brings us happiness not the destination―Dan Millman

  • How to drop the last diskgroup in ASM 11g?

    Hello,
    I installed an ASM instance and created a DATA diskgroup using the Oracle installer. I would like to drop the diskgroup and re-create it using partitions instead of disk devices in order to use ASMLib.
    I have not found a way to get rid of the DATA diskgroup yet. How do I get rid of it?
    [+ASM@asm]$ sqlplus / as sysasm
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Sep 3 20:12:05 2010
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Automatic Storage Management option
    SQL> DROP DISKGROUP data INCLUDING CONTENTS;
    DROP DISKGROUP data INCLUDING CONTENTS
    ERROR at line 1:
    ORA-15039: diskgroup not dropped
    ORA-15027: active use of diskgroup "DATA" precludes its dismountI used the following for data_0000 - data_0005, thinking it would be a good idea to drop each disk before dropping the diskgroup - which worked, although I had to use force for data_0000;
    SQL> alter diskgroup data drop disk data_0006;
    ... etc...
    SQL> alter diskgroup data drop disk data_0000 force;It all looks a bit weired now:
    SQL> select name, header_status, path from v$asm_disk;
                        MEMBER        /dev/sda
    _DROPPED_0000_DATA  UNKNOWN
    DATA_0001   MEMBER        /dev/sdb
    DATA_0002   MEMBER        /dev/sdc
    DATA_0003   MEMBER        /dev/sdd
    DATA_0004  MEMBER         /dev/sde
    DATA_0005   MEMBER        /dev/sdf
    SQL> alter diskgroup data dismount force;
    Diskgroup altered.
    SQL> alter diskgroup data mount;
    Diskgroup altered.
    SQL>

    Thanks for the reply.
    Unfortunately I cannot use EM since I do not have any database installed that uses the ASM instance yet, and to my knowledge ASM alone does not provide a web console.
    Anyway, I finally just manged to drop the diskgroup. Normally a diskgroup needs to be mountedto be dropped, but the force clause can be used for a diskgroup that is dismounted. So I tried it with the diskgroup dismounted... and it worked.
    SQL> alter diskgroup data dismount force;
    SQL> drop diskgroup data force including contents;
    Diskgroup dropped.
    Thanks!
    Edited by: Markus Waldorf on Sep 3, 2010 6:13 PM

  • How to drop the tables (articles) in subscription database MERGE replication.

    We have configured the merge replication from publication server to subscription server,
    Here I mistakenly selecting few tables (articles) in publication,
    Now I need to remove those mistakenly selected tables in subscription server database . 
    Note: I am trying to below way but unable to remove those tables in subscription server.
    1<sup>st</sup> I unselected those tables (articles) in publication, but not working.
    Could please tell me the how to remove those tables in subscription database.

    Ok that is normal, dont worry, if you mistakenly  chosen few tables, just add the new tables
    that you forgot it, just make click on the publication, you only have to Re-run the snapshot agent, i mean you must generate another snapshot and then synchronice with your suscriber, and then you will not need DROP the tables on the suscriber, if you have
    troubles yet, please post imagens to help you more !
    Thanks and regards.

  • How to define the datafile output_Name when output a report as spreatsheet

    Hi,
    in 10gR2 env. with AS 10 g / Reports work with RWSERVLET
    i do output a Report as a SPREADSHEET, that works fine,
    but
    to save this file there is a file_name like 'getjobid1234.xls'
    I tried to work with the report - title with boilerplate B_OR$REPORT_TITLE placed in margin ,
    but it doesn't work, no change in output_file_name
    and : how to change the B_OR$REPORT_TITLE dynamic while runtime ?
    any Help ?
    Norbert

    i use
    Desformat= SPREADSHEET
    Destype= CACHE
    web.show_document(/reports/rwservlet/getjobid<jobid>?server=ReportServer,_blank);
    with a 'name' as getjobid<jobid>
    desname doesn't work in CACHE - Mode ?
    with
    Desformat= SPREADSHEET
    Destype= FILE
    Desname= my_variable_report_name.xls
    there is the file my_variable_report_namet.xls saved on host-file-system
    ok, but can I call this with my_variable_report_name from cache without to save it everytime on server before ?

  • How to import the datafiles from one database to another

    Hi,
    I have got some datafiles from the existing database(Consider it as Database A), but it has been removed as of now.
    I am having the datafiles and control files of it.
    I have freshly installed one oracle Database(database B), I am planning to load those datafiles in the newly installed
    database.
    Is it possible, if so wat is the procedure.
    Both the databses are Oracle 11g.
    Help me out of this.
    Thanks.
    Regards
    Gatha

    Hi,
    As you said that you have data files and Control files, then using import quite no possbile, but you need to do it manually (as it exits in the Source System in same path).
    Initially, you copy these files from the Source System to Destination System that is
    Data Files and Control Files
    Next, you will get the DBID from the controlfile backup is you have Example :-
    CTL_SP_BAK_C-1507972899-20070228-00, then " 1507972899" is the DBID,
    Try to use the RMAN for this
    example :-
    Open the rman
    set dbid 1507972899
    then you need to build the initilizaition file to start an instance based on the Configuration
    or Copy the spfile from the back from source system if exits.
    Startup the DB in mount mode.
    You might get the error
    ORA-01078: failure in processing system parameters
    Now restore spfile from 'backup path' where you have copied files
    startup force nomount
    Now the instance is started
    connect to DB as sysdba
    check the control file parameter values and online redo Log files paths (Log_Archive_dest)
    Restore the old control file from backup, since the new instance must the know where the files are located
    restore controlfile from 'backup path'
    then shutdown the DB
    start in mount mode
    restore the DB - restore database
    Note: Recovery is dependent on the available archived (and online) redo logs.
    Final step will be Alter database open resetlogs;
    - Pavan Kumar N

  • How to drop the text in to the af:richTextEditor

    Hi All
    I am using Jdeveloper 11.1.1.4.0.
    I ahve a requrment like there is one af:table & af:richTextEditor. I want to drag & drop the table cell informationin af:richTextEditor.
    <af:table var="row" value="#{beanDnD.ValueSet}"
    id="t1" summary="collection drag source"
    rowSelection="single" contentDelivery="immediate"
    autoHeightRows="5">
    <af:column headerText="Product" id="c3">
    <af:outputText value="#{row.product}" id="ot1">
    <af:attributeDragSource attribute="value"/>
    </af:outputText>
    </af:column>
    <af:column headerText="Cost" id="c4">
    <af:outputText value="#{row.cost}" id="ot2"/>
    </af:column>
    </af:table>
    <af:richTextEditor label="Label 1" id="rte1" valueChangeListener="#{beanDnD.valuechange}"
    autoSubmit="true"
    binding="#{beanDnD.textBinding}"
    value="IceCream">
    <af:attributeDropTarget attribute="value"/>
    <af:attributeDropTarget attribute="invisible"/>
    </af:richTextEditor>
    Bean value chnage code
    public void valuechange(ValueChangeEvent valueChangeEvent) {
    // Add event code here...
    System.out.println(valueChangeEvent.getOldValue());
    String s1 = valueChangeEvent.getOldValue().toString();
    System.out.println(valueChangeEvent.getNewValue());
    String s2 = valueChangeEvent.getNewValue().toString();
    textBinding.setValue(s1+s2);
    AdfFacesContext.getCurrentInstance().addPartialTarget(textBinding);
    but its not working :(
    I did same with af:inputText & its working properly.Pz suggest me waht should i do?any help would be appriciated.
    Thanks
    Charu

    Hi Charu,
    I know this was a long time ago but do you remember if you ever found a solution for this?
    Dave

  • How to drop the contents on an internal table?

    Dear all,
    can some one suggest me the code to drop the content of an internal table.
    VJ

    Following are the different ways of DELETIONS from ITAB, DTAB and FILE:
    DELETE FROM dbtab       WHERE cond.
    DELETE FROM (dbtabname) WHERE cond.
    - DELETE dbtab.
    DELETE *dbtab.
    DELETE (dbtabname) ... .
    - DELETE dbtab       FROM TABLE itab.
    DELETE (dbtabname) FROM TABLE itab.
    - DELETE dbtab  VERSION vers.
    DELETE *dbtab VERSION vers.
    Delete from an internal table
    - DELETE itab.
    - DELETE itab INDEX idx.
    - DELETE itab FROM idx1 TO idx2.
    - DELETE itab WHERE cond.
    - DELETE ADJACENT DUPLICATES FROM itab.
    Delete a program
    - DELETE REPORT prog.
    Delete text elements
    - DELETE TEXTPOOL prog LANGUAGE lg.
    Delete a data cluster from a database table
    - DELETE FROM DATABASE dbtab(ar) ...ID key.
    Delete a data cluster from the cross-transaction application buffer
    - DELETE FROM SHARED BUFFER dbtab(ar) ...ID key.
    Delete a file
    - DELETE DATASET dsn.
    Delete a screen
    - DELETE DYNPRO f.
    Thanks,
    Santosh

  • How to reduce the size of UNDO tablespace?

    Hello,
    I was doing client copy from my production system to quality for which I increased
    the UNDO tablespace.Now i want to reduce the size of UNDO tablespace so that i can use the
    free space for other purpose.
    Thanks in advance

    [Here we go!|Procedure to delete and create PSAPUNDO;
    Reagrds,

  • How to play the datafile generated by cdrdao

    the command cdrdao --device /dev/cdrom --datafile fichier fichier.toc produce a datafile and a toc from an audio cd that can be used to burn a copy of the cd (again with cdrdao, no problem here). I would like to know if it is possible to play the datafile without burning it. Does any one what format it is? There must exists mplayer options to play it but I am lost.
    I have just found the solution. In case someone is interested, sox can play it:
    play -t cdda <datafile>
    Last edited by olive (2009-09-09 07:09:22)

    Hi zhoudeng,
    Would it be possible please for you to provide some more information.
    What kind of robot is it that you are using? Do you having any LabVIEW coding that you could attach please?
    It would be benefitial to attach your coding that generates the A star plan as well as what you're currently trying to do.
    Thanks,
    Tori
    Student

Maybe you are looking for