Drop temp tbs

Hi,
I'm in 8i and I want to drop TEMP tablespace. (I have already given another TEMP1 created to users).How can I see if any user uses TEMP1 ?
Many thanks.

861100 wrote:
HI ,
oracle 11g ASM RAC under OEL 5.6 ,
i have temporary tablespace with size more than 100 GB so i create new one and make the new one as a default
and then i drop the first one but it take more time and i change the default for temporary since 2 days ago
so there is no data in old temp but when i execute the drop command it take more time ?
SQL> select temporary_tablespace from dba_users;
TEMPORARY_TABLESPACE
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TEMPORARY_TABLESPACE
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
TMP
21 rows selected.
SQL> select name from v$tablespace;
NAME
SYSTEM
SYSAUX
UNDOTBS1
TMP
UNDOTBS2
USERS
ABS_MID
ABS_MID_IND
TEMP
9 rows selected.
SQL> set time on
16:44:18 SQL> drop tablespace TEMP including contents and datafiles;
^Cdrop tablespace TEMP including contents and datafiles
ERROR at line 1:
ORA-01013: user requested cancel of current operation
16:53:00 SQL>
16:53:01 SQL>please advise why it take more time ?you could do as below prior to doing DROP TABLESPACE
ALTER SESSION SET SQL_TRACE=TRUE;
content of trace file will show what occurs during the DROP command

Similar Messages

  • Drop temp tbs without end

    Hi,
    Database is Oracle 8.1.7.4 about Windows NT.
    I have a temporary tablespace with a datafile wich take more than 2Go.
    I would like to create another temp tablespace locally managed with a tempfile to replace the first.
    When I drop the old temp tablespace (with a datafile) this take more than 30 minutes, and I didn't wait more, I killed this session.
    Why this one take to many time ? How can I make to make this quickly ?
    Nicolas.

    To run your database you need one temporary tablespace available and the method which you can use is that first create a temporary tablespace first and then make it your default temporary tablespace bounce your database in mount position and then make your newly created tablespace your default temporary tablespace and then open the database and drop the old one.

  • Drop TEMP (1 out of 2) datafile without dropping tbs?

    I added a datafile to TEMP tbs as i ran out temp space last week while running the payroll - Now i want to get rid of extra datafile from TEMP tbs. Can i do that in 10.2.0.2 without dropping the whole tablespace and re-creating?
    Please post your thoughts!

    If I were you , i would :-
    1. re create a new temp tablespace
    2. make that the default temporary tablespace
    3. drop this old tablespace in it's entirety.
    OR
    RESIZE the temporary datafile to the lowest file size posible.
    ALTER DATABASE TEMPFILE 1 RESIZE 1M;
    If you are adventurous
    http://www.psoug.org/reference/database.html
    ALTER DATABASE TEMPFILE <file_name | file_number> DROP;
    Use it at your own discretion.

  • Drop temp tables

    how to drop temp tables if i created with same name in different sessions 
    create table #temp(id int)
    (with same in different sessions)

    In addition to Olaf's, if you create temp table in two different sessions, you will find the 2 #test in the TempDB.sys.tables.
    CREATE TABLE #test (id int);
    Either the different object_ids or the "same" names indicate they are
    different temp tables. The same named local temp tables created in different sessions are traced with a 12 suffix in the tempdb.sys.tables. That's why when creating temp tables, maximum length can be of 116 characters only, while creating a
    table, the maximum is 128.
    The fragment referenced from the BOL
    You can create local and global temporary tables. Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions.
    All local temporary tables are dropped automatically at the end of the current session.
    You can read more from the below link.
    https://technet.microsoft.com/en-us/library/aa258255(v=sql.80).aspx
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Oracle dbsonsole not running after drop temp files

    before drop temp tablespace
    i was create temp2 tablespace as default temp tablespace
    after that
    i have droppped temp files last to first
    temp4.dbf ..3..2
    when i have clicked to delete temp table space in dbconsole
    after a few time dbconsole not running
    in iexplore
    i have tired to start db control again with emctl start dbconsole
    it was already running
    then i have command
    emctl status dbconsole
    is not running
    i have looked log file i see temp file warning
    now what can i do to start dbconsole again

    Dbconsole doesn't work proper without temp files. So you should create temp file for temporary tablespace in some other tool.

  • TEMP TBS platzt...

    Hallo,
    habe ein Problem mit meinem TEMP TBS...
    Ich mache ein "CREATE TABLE AS SELECT". Das SELECT geht auf eine VIEW mit ca. 3.000.000 Datensätzen.
    Während das SELECT läuft kann man sehen, wie der TEMP TBS voll läuft und irgendwann abschmiert.
    Wenn ich das Ganze auf einer Test-DB (8.1) mache, läuft die Kiste und das mit einem TEMP TBS mit nur 2.5GB!!!
    Der einzige Unterschied (den ich jetzt so sehe) ist, dass die TBS in der Test-DB DICTIONARY MANAGT sind und auf der anderen DB (9.2) LOCALY MANAGT. Auch kann ich die TBS auf der 9er nicht DICTIONARY MANAGT anlegen. Ist das unter 9.2 nicht mehr möglich?
    Mein TEMP ist so angelegt:
    CREATE TEMPORARY TABLESPACE temp
    TEMPFILE '/home/loc/TIS_Daten/dbs1/plmtst/temp01.dbf' SIZE 1000M,
    '/home/loc/TIS_Daten/dbs1/plmtst/temp02.dbf' SIZE 1000M,
    '/home/loc/TIS_Daten/dbs1/plmtst/temp03.dbf' SIZE 1000M,
    '/home/loc/TIS_Daten/dbs1/plmtst/temp04.dbf' SIZE 1000M
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
    Danke!!!

    Auch kann ich die TBS auf der 9er nicht DICTIONARY MANAGT anlegen. Ist das unter 9.2 nicht mehr möglich?Hi,
    If I well understand you (with remember my german school training), you cannot create a dictionnary managed tablespace whenever your system tablespace is locally managed.
    But to have more chance to find a help, as Yogesh said, try to reformulate your question in english.
    HTH,
    Nicolas.

  • Drop temp tablespace goes forever

    Hi,
    Trying to drop temp tablespace.
    I made new default temp tablespace and that part went fine. I can see system using it immediately.
    Then I tried to drop the old one.
    drop tablespace temp including contents and datafiles;
    .... no go .... altough content is gone now. Tablespace was full before this now it's empty.
    My command still hangs in sqlplus.
    Any idea?
    Oracle 10.2.0.1 on Linux x86.

    You either wait until it's finish. Or kill the session that held it.
    SELECT s.sid,
           s.serial#,
           s.osuser,
           s.program
    FROM   v$session s;
    ALTER SYSTEM KILL SESSION 'sid,serial#'

  • Drop Temp tablespace hangs...

    I have created a new TEMP tablespace and made it default TEMP one.
    Now I want to drop TEMP3 tablespace, because it has become fulll...
    when I drop it through EM, it hangs...
    Once a tablespace has been dropped, the objects and data in it will no longer be available. To recover them can be a time consuming process. Oracle recommends a backup before and after dropping a tablespace.
    Are you sure you want to delete Tablespace TEMP3?
    Delete associated datafiles from the OS
    When I checked at EM, there are locks too..
    SMON has locked the system
    What should I do now?

    The_Rock wrote:
    I have created a new TEMP tablespace and made it default TEMP one.
    Now I want to drop TEMP3 tablespace, because it has become fulll...
    when I drop it through EM, it hangs...
    Once a tablespace has been dropped, the objects and data in it will no longer be available. To recover them can be a time consuming process. Oracle recommends a backup before and after dropping a tablespace.
    Are you sure you want to delete Tablespace TEMP3?
    Delete associated datafiles from the OS
    When I checked at EM, there are locks too..
    SMON has locked the system
    What should I do now?Refer
    Drop Temp Tablespace Command Hangs [ID 214371.1]
    How to Drop Temporary Tablespace Having Enteries in V$SORT_USAGE [ID 285993.1]

  • Drop Temp Tablespace

    DB 10.2.0.4
    AIX 5.2
    PROD
    I am trying to drop temp tablespace as below command. It is running since nine hours I am not understand why it is taking too much time. FYI I have created a new temp and assigned to default temporary tablespace. Even I connected with new session and run “drop tablespace temp” it is also running since one hour. Suggest me.
    DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;
    Thanks

    user11969485 wrote:
    FYI Holder session is "oracle@devdb (SMON)"
    Edited by: user11969485 on Jan 7, 2012 12:49 AMYes, Looks like you hitting a BUG.
    Check this note Bug 3833893: SMON GETS "TT ENQUEUE" OF TEMP IF DATEFILE OF TEMP DOESN'T EXIST
    It saying to drop files from mount status. Lets try :)
    Keep Close the Threads, So it meaningful as those answered.
    user11969485      Newbie
    Handle:      user11969485
    Status Level:      Newbie (10)
    Registered:      Oct 27, 2009
    Total Posts:      302
    Total Questions:      66 (57 unresolved)
    Edited by: CKPT on Jan 7, 2012 2:36 PM

  • Dropping Temp Tables

    We are currently converting our student information system from Sybase to Oracle. My task is to convert our existing sql scripts. A number of them use temp tables and I have successfully got them to run except that I cannot drop the tables at the end of the script because they are still in use *[Error Code: 14452, SQL State: 72000] ORA-14452: attempt to create, alter or drop an index on temporary table already in use*. For example:
    /* Oracle Version */
    -- Select Cactus ID ------------------------------------------------------------
    CREATE GLOBAL TEMPORARY TABLE tch1
    (name Varchar(45), tid Int, CactusID Varchar(12))
    ON COMMIT PRESERVE ROWS;
    INSERT INTO tch1
    SELECT
    t.lastfirst,
    t.id teacherid,
    c.value
    FROM
    teachers t
    INNER JOIN customvarchars c ON t.id = c.KeyNo
    AND fieldno = 148;
    -- Select Core Codes ---------------------------------------------------------------
    CREATE GLOBAL TEMPORARY TABLE crs1
    (name Varchar(45), cid Int, CactusCd Varchar(12))
    ON COMMIT PRESERVE ROWS;
    INSERT INTO crs1
    SELECT
    cs.course_name,
    cs.id courseid,
    c.value
    FROM
    Courses cs
    INNER JOIN customvarchars c ON cs.id = c.KeyNo
    AND fieldno = 146;
    -- Put it all together ---------------------------------------------------------
    SELECT
    t.lastfirst AS Teacher,
    ct.CactusID,
    s.schoolid AS Sch#,
    s.TermID,
    c.course_number AS Crs#,
    s.section_number AS Sec#,
    c.course_name AS Course,
    cr.CactusCd,
    COUNT(*) AS Enroll
    FROM
    cc
    INNER JOIN sections s ON cc.sectionid = s.id
    INNER JOIN courses c ON s.course_number = c.course_number
    LEFT JOIN crs1 cr ON c.id = cr.cid
    INNER JOIN teachers t ON s.teacher = t.id
    LEFT JOIN tch1 ct ON t.id = ct.tid
    WHERE s.schoolid NOT IN (701,711)
    GROUP BY
    s.schoolid,
    t.lastfirst,
    ct.CactusID,
    c.course_number,
    s.section_number,
    c.course_name,
    cr.CactusCd,
    s.TermID
    ORDER BY
    s.schoolid,
    t.lastfirst,
    ct.CactusID,
    c.course_number,
    s.section_number,
    c.course_name,
    cr.CactusCd,
    s.TermID;
    -- Drop Tables -----------------------
    DROP TABLE tch1;
    DROP TABLE crs1;
    I have an Oracle PL/SQL reference guide at hand, but I don't see any mention of dropping the tables when completed. I'm also curious if I'm using the terminator (;) correctly. MS SQL Server and Sybase did not require one.
    Thanks.

    Christopher Soza wrote:
    you need to issue a
    COMMIT;
    prior to issueing the drop table commands
    COMMIT will not help since GTT is ON COMMIT PRESERVE ROWS:
    Session 1:
    SQL> CREATE GLOBAL TEMPORARY TABLE tch1
      2  (name Varchar(45), tid Int, CactusID Varchar(12))
      3  ON COMMIT PRESERVE ROWS;
    Table created.
    SQL> insert into tch1 values('A',1,'B');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> Session 2:
    SQL> drop table tch1;
    drop table tch1
    ERROR at line 1:
    ORA-14452: attempt to create, alter or drop an index on temporary table already
    in use
    SQL> SY.

  • Scheduled job that drops temp tables.

    Hi, I have a 3rd party app that creats temp tables and never drops them. I need to come up with a scrip that I can run every thirty days and clean them up. Here is the select I run to find them. I just don't know how to format the drop statement.
    select owner, object_name, created from dba_objects where object_name like 'DWTEMP%' and created > '01-MAY-11' and object_type='TABLE';
    Thanks
    Bryan

    It sounds like you want something like
    BEGIN
      FOR tbl IN (select owner, object_name, created
                    from dba_objects
                   where object_name like 'DWTEMP%'
                     and created BETWEEN trunc(sysdate) - 30 AND trunc(sysdate)
                     and object_type='TABLE')
      LOOP
        EXECUTE IMMEDIATE 'DROP TABLE ' || tbl.owner || '.' || tbl.object_name || ' PURGE';
      END LOOP;
    END;or
    BEGIN
      FOR tbl IN (select owner, object_name, created
                    from dba_objects
                   where object_name like 'DWTEMP%'
                     and created BETWEEN add_months(trunc(sysdate), -1) AND trunc(sysdate)
                     and object_type='TABLE')
      LOOP
        EXECUTE IMMEDIATE 'DROP TABLE ' || tbl.owner || '.' || tbl.object_name || ' PURGE';
      END LOOP;
    END;depending on whether you want to go back 30 days or 1 month.
    Justin

  • How can drop TEMP tablespace

    Hi,
    Please help me

    1) Create new temporary tablespcae
    2) Chechk new temp tablespace in default
    3) Drop tem pablespace
    CREATE TEMPORARY TABLESPACE TEMP2 TEMPFILE’C:\ORACLE\10.2\ORADATA\PROD\temp2_01.dbf’ SIZE 100M AUTOEXTEND ON NEXT 256K
    MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
    ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP2;
    DROP TABLESPACE temp INCLUDING CONTENTS AND datafiles

  • How can I know which queries run in the TEMP tbs (Oracle 9i and 10g) ?

    Dear friends, do you have a query which can shows which statements are running currenly in the TEMP tablespace?
    Many Thanks in advance, Marcelo.

    Marcelo,
    you can check DBMS_XPLAN.DISPLAY_CURSOR - if you find a column TempSpc there, it's using Temp space.
    select source from sys.source$ order by source;
    select * from table(dbms_xplan.display_cursor(NULL, NULL, NULL));
    PLAN_TABLE_OUTPUT
    SQL_ID  5ywbw0z6gupwk, child number 0
    select source from sys.source$ where rownum < 555555 order by source
    Plan hash value: 1381731087
    | Id  | Operation           | Name    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |         |       |       |       | 11492 (100)|          |
    |   1 |  SORT ORDER BY      |         |   555K|    37M|    87M| 11492   (1)| 00:02:18 |
    |*  2 |   COUNT STOPKEY     |         |       |       |       |            |          |
    |   3 |    TABLE ACCESS FULL| SOURCE$ |   572K|    38M|       |  1834   (1)| 00:00:23 |
    ---------------------------------------------------------------------------------------or for all your statements currently available:
    SELECT t2.*
    FROM v$sql s, table(DBMS_XPLAN.DISPLAY_CURSOR(s.sql_id, s.child_number)) t ,
         table(DBMS_XPLAN.DISPLAY_CURSOR(s.sql_id, s.child_number)) t2
    WHERE t.PLAN_TABLE_OUTPUT like '%TempSpc%';Edit: Sorry, I didn't see you are also asking for 9i. DISPLAY_CURSOR is only available in 10g+ - but Tom Kyte and others have shown WorkArounds to use DBMS_XPLAN.DISPLAY from 9i to show the information for all available SQLs.
    2nd Edit:
    TempSpc only shows the estimation the optimizer makes.
    You can check V$SQL_PLAN_STATISTICS_ALL for the columns max_tempseg_size and tempseg_size. In Addition please have also a look on [http://antognini.ch/about/] Blog [http://antognini.ch/2009/05/wrong-information-about-temporary-space-usage/] .
    I used:
    select PARENT_ID, ID, DEPTH, POSITION,
           MAX_TEMPSEG_SIZE, LAST_TEMPSEG_SIZE
    from v$SQL_PLAN_STATISTICS_ALL
    where MAX_TEMPSEG_SIZE > 0;hth,
    Martin
    Edited by: berx on Jun 17, 2009 4:11 AM
    Edited by: berx on Jun 17, 2009 6:18 AM

  • Not able to drop Temp tables in staging schema

    Dear All,
    I am facing some issue with the temporary tables in my interface; i am using ODI 11g,
    Getting following error;
    Message:
    ODI-1228: Task FEED_NL_STEP_UPDATE_DATA_TO_XML_WS (Integration) fails on the target XML connection XML_DS_NL_LISTOFACTIVITY.
    Caused By: java.sql.SQLException: ORA-00942: table or view does not exist
    Code:
    Drop Table: C$_ACTIVITY
    I heard that there is some known bug in ODI with respect this error.
    Please help me to find workaround for the same..
    Thanks and Regards
    San

    well,
    When I check my staging schema where this table is supposed to be created, I see the table.
    But ODI is thorwing error saying 'ODI-1228: Task FEED_NL_STEP_UPDATE_DATA_TO_XML_WS (Export) fails on the target XML connection XML_DS_NL_LISTOFACTIVITY.
    Caused By: java.sql.SQLException: ORA-00942: table or view does not exist'
    Even though the table exists physically, ODI is not able to detect is somehow. so need to know why this is happening and how to resolve this.
    Thanks
    San

  • SMON is blocking temp tablespace drop

    Hi all,
    My TEMP TBS became 47G and I want to get rid of that monster. I created the second TEMP TBS, switched default TBS and wanted to drop the huge one, but it hangs there for ever... When I look on the database to see what's going on i see the following:
    09:47:33 db_manager@odsp8> @blocking
    BLOCKING_STATUS
    @bla-bla-bla-bla ( SID=329 ) is blocking SYS@bla-bla-bla-bla ( SID=301 )
    09:55:42 db_manager@odsp8> @whois
    Enter value for sid: 329
    old 3: where sid=&sid
    new 3: where sid=329
    USERNAME STATUS OSUSER MACHINE PROGRAM
    ACTIVE oracle bla-bla-bla-bla oracle@bla-bla-bla-bla *(SMON)*
    Definitely, am not gonna kill SMON, but I also need to throw this big TEMP away ASAP.
    Does anybody know how to do that and overcome the lock?
    Thanks in advance.
    M
    PS: Oracle 10.2.0.4 RHEL4 64bit
    Edited by: MarGur on Jul 20, 2010 9:04 AM

    >
    sqlplus
    / as sysdba
    shutdown immediate
    startup mountAnd then ??
    As soon as you open the database, SMON will pick up where it left .
    Even with another temp tablespace set to as default, SMON will continue cleaning up (coalescing) the extents.
    If I remember correctly, we had this also some years ago, we issued:
    ALTER DATABASE DATAFILE 'your tempfile' OFFLINE DROP;Then shutdown and restart the database in mount mode and drop the tablespace.
    After that open the database for use.
    This was then our last - most dirty - solution, while we had waited for 3 days for SMON to finish.
    HTH,
    FJFranken
    My Blog: http://managingoracle.blogspot.com
    P.S. If this answers your question, please set the thread to answered and award the points. It is appreciated

Maybe you are looking for