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#'

Similar Messages

  • 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

  • Temp Tablespace Goes Berzerk using XMLGEN

    The following procedure seems to maxout my temporary tablespace (2G!!!!)
    I use this procedure to pump XML to a client given a sql statement and a few parameters.
    I am using the plxmlparser_v1_0_2 release and the XSU12_ver1_2_1 release.
    There seems to be some discussion concerning this in other threads but no soloution seems to be forth coming. Any advice?
    PS I am also having a problem with XMLGEN returning XML datasets >90k. Methinks the two issues are related.
    Regards
    James Crockart
    [email protected]
    procedure createDynamicXML(
    sql_string varchar2,
    result_name varchar2 default 'results',
    row_name varchar2 default 'row',
    error_name varchar2 default 'error_results',
    rowid_name varchar2 default null,
    rowid_col varchar2 default null,
    useLowerCase boolean default true,
    useNullAttrib boolean default false)
    is
    no_sql exception;
    --XML Variables
    xmlString CLOB := null;
    amount integer:= 255;
    position integer := 1;
    charString varchar2(255);
    begin
    if sql_string is null then
    raise no_sql;
    end if;
    --Set XML preferences
    xmlgen.resetOptions;
    xmlgen.setErrorTag(error_name);
    xmlgen.setRowsetTag(result_name);
    xmlgen.setRowTag(row_name);
    if rowid_name is not null then
    xmlgen.setRowIdAttrName(rowid_name);
    end if;
    if rowid_col is not null then
    xmlgen.setRowIdColumn(rowid_col);
    end if;
    if useLowerCase then
    xmlgen.useLowerCaseTagNames();
    end if;
    xmlgen.useNullAttributeIndicator(useNullAttrib);
    --Set mime header
    --owa_util.mime_header('text/xml');
    --Generate XML
    xmlString := xmlgen.getXML(sql_string);
    --Output XML
    dbms_lob.open(xmlString,DBMS_LOB.LOB_READONLY);
    loop
    dbms_lob.read(xmlString,amount,position,charString);
    htp.prn(charString);
    position := position + amount;
    end loop;
    dbms_lob.close(xmlString);
    dbms_lob.freetemporary(xmlString);
    exception
    when no_data_found then
    dbms_lob.close(xmlString);
    dbms_lob.freetemporary(xmlString);
    end createDynamicXML;
    null

    The user the xml sdk was installed in and its privs is:
    CREATE USER "XML" PROFILE "DEFAULT"
    DEFAULT TABLESPACE "USERS"
    TEMPORARY TABLESPACE "TEMP"
    ACCOUNT UNLOCK;
    grant connect to XML;
    grant resource to XML;
    grant javauserpriv to XML;
    grant javasyspriv to XML;
    I suppose I can give the XML user it's own temp tablespace to save the rest of the production environment from going down.
    But does not solve the problem :(
    -James
    null

  • 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

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

  • 10g temp tablespace

    how to drop temp tablespace group and temp tablespace in 10g

    Am example1.
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    WHENEVER SQLERROR EXIT FAILURE ROLLBACK
    SPOOL recreate_temp_tablespaces_LOG
    SET FEEDBACK ON
    SET ECHO ON
    SET TRIMSPOOL ON
    SET PAGESIZE 0
    SET LINESIZE 30000
    CREATE TEMPORARY TABLESPACE xyzzy_dummy
    TEMPFILE '/data/oracle/misa/xyzzy_dummy01.dbf'
    SIZE 100M REUSE
    AUTOEXTEND ON
    NEXT 100M
    MAXSIZE 1000M
    EXTENT MANAGEMENT LOCAL;
    ALTER DATABASE DEFAULT TEMPORARY TABLESPACE xyzzy_dummy;
    DROP TABLESPACE TEMP;
    CREATE TEMPORARY TABLESPACE TEMP
    TEMPFILE '/data/oracle/misa/temp01.dbf'
    SIZE 3788800K REUSE
    AUTOEXTEND ON
    NEXT 640K
    MAXSIZE 4096000K
    ALTER DATABASE DEFAULT TEMPORARY TABLESPACE TEMP
    DROP TABLESPACE xyzzy_dummy INCLUDING CONTENTS AND DATAFILES
    EXIT;
    V.

  • 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

  • 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

  • DROP and RECREATE TEMP TABLESPACE

    Hey,
    is it ok just to drop the TEMP tablespace and recreate it?
    Will data get lost? Will developers kill me if I do? ;o)
    Can i reuse the datafile?
    Is it possible to change name on the tablespace?
    Thanks
    Kjersti

    Hey there is absolutely no problem. Only ensure that only system is logged on and no other user is using the database. Best thing is to shut down the database and restart in restricted session and then create the temp tablespace. give tempfile instead of datafile.

  • Temp tablespace drop 관련 질문임다!

    temp tablespace가 거의 100%사용이어서, db shutdown하고 다시 살렸는데도
    줄지 않아서 (사실 이것도 왜 안주는지 궁금하거등요~!)
    우선 old_temp tablespace를 new_temp tablespace를 만들었습니다.
    즉,,,제가 한작업들을 개략 적어보면요
    1) create temporary tablespace new_temp tempfile~~~~;
    2) drop tablespace old_temp;
    3) alter database default temporary tablespace new_temp;
    하고 나서 모든 유저에 지정되어있는 temporary tablespace를 new_temp로 지정
    해줘야 하쟎아요
    즉, alter user scott temporary tablespace new_temp; 이렇게요...
    근데 이걸 안해줬는데도 에러없이 scott유저는 소트를 수행하드라구요...
    이거...정상인건가요????
    ***추가질문~!
    그리고 템프싸이즈가 줄지않고 계속늘어날때의 원인과 체크포인트좀 부탁드립니다.

    8i에서는 tempfile이란 개념은 있었으나 default temporary tablespace라는
    개념은 없었습니다. 그래서 유저에게 직접 default tablespace를 지정해주어야
    했었습니다.
    하지만.. 9i부터는 alter database default temporary tablespace new_temp;
    명령을 하기만 하면 모든 유저의 default temporary tablespace가 default로
    지정되어 있지 않으면 new_temp로 됩니다.
    물론 이 경우에도 수동으로 temp를 지정할 수 있으니 실제로 유저가
    temp공간을 어디에 사용하는지는..
    select username, temporary_tablespace from dba_users; 를 통해서
    확인해야 합니다.
    scott유저는 default temporary tablespace로 지정되어서 그 쪽 temp를
    사용하게 되니, 에러가 나지 않겠죠.
    default temporary tablespace가 무엇으로 지정되어 있는지는,
    select * from database_properties; 또는 select * from sys.props$; 로 조회하면
    temporary tablespace라는 이름으로 어떤 값이 들어가 있는지 보입니다.
    그리고 temp는 DB를 내렸다가 올리면 smon프로세스가 clear시켜줍니다.
    temp는 아시다 싶이 당연히 sort를 해서 발생하는 것이구요. 그렇다면..
    temp가 계속해서 full이 난다면.. temp를 사용하는 세션을 확인하고
    temp를 사용하는 세션의 쿼리를 뽑아낸다면 쉽게 해결이 되겠죠.
    아래는 제가 경험해서 처리한 것입니다.
    저는 temporary tablespace가 full 났는데 도대체 쿼리를 못잡는 것이었습니다.
    그래서 어떻게 했을까요? Secure CRT에 세션로그를 걸어두고 모니터링을 했죠.
    vi stat.sh
    interval=30 # Sleep interval in seconds
    reps=1000000 # n times
    j=1 # Loop variable
    while [ $j -le ${reps} ]
    do
    echo " ----cycle ${j} / ${reps} --------"
    sqlplus -s system/패스워드<<EOF
    @sw.sql ${j}
    exit
    EOF
    cat sess_${j}.dat >> sw.dat
    rm sess_${j}.dat
    sleep ${interval}
    j=`expr ${j} + 1`
    done
    exit 0
    vi sw.sql
    set line 150
    set concat "+"
    col username format a10
    col osuser format a10
    col tablespace format a15
    spool sess_&1.dat
    SELECT b.tablespace,
    b.segfile#,
    b.segblk#,
    b.blocks,
    a.sid,
    a.serial#,
    c.spid,
    a.username,
    a.osuser,
    a.status,
    a.sql_hash_value
    FROM v$session a,
    v$sort_usage b,
    v$process c
    WHERE a.saddr = b.session_addr and a.paddr=c.addr
    ORDER BY b.tablespace, b.segfile#, b.segblk#, b.blocks;
    spool off
    stats.sh 를 수행하고 PC킨 상태로 그냥두고 다음날 왔더니 아래처럼 temp를
    계속 쓰는 넘이 나온거죠..
    딱걸렸습니다.ㅎㅎ
    TEMP 93 2550817 13824 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1792 / 1000000 --------
    TEMP 93 2550817 43008 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1793 / 1000000 --------
    TEMP 93 2550817 72192 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1794 / 1000000 --------
    TEMP 93 2550817 101376 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1795 / 1000000 --------
    TEMP 93 2550817 131072 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1796 / 1000000 --------
    TEMP 93 2416673 18944 123 5171 3197 PVB oracle ACTIVE 1126923165
    TEMP 93 2550817 159744 92 58284 3193 PVB oracle ACTIVE 1126923165
    ----cycle 1797 / 1000000 --------
    TEMP 93 2416673 48128 123 5171 3197 PVB oracle ACTIVE 1126923165
    TEMP
    sql_hash_value값이 1126923165 이니 아래 쿼리에다가 넣으면 full 쿼리가 나오죠..
    결국엔 개발자가 모든 소스코드에서 변경을 했어야 했는데.. 그렇게 하지 않아서
    일부 웹서버에서의 쿼리가 이상하게 where조건없이 수행되었고 그래서 temp가
    full 났던 것이랍니다.
    vi sidhashsql.sql
    set pages 1000
    col sql_text format a120
    select sql_text from v$sqltext_with_newlines
    where hash_value=&hash_value order by piece;
    SQL> @sidhashsql
    Enter value for hash_value: 1126923165
    old 2: where hash_value=&hash_value order by piece
    new 2: where hash_value=1126923165 order by piece
    SQL_TEXT
    boan~~~~!!
    아래 너무 자세하게 나와있죠?
    No. 18484
    TEMPORARY TABLESPACE에서 TEMPFILE 과 DATAFILE의 차이점 (8.1.X ~ 9I)
    ============================================================
    PURPOSE
    이 문서에서는 Oracle 7.3부터 사용되어 오던 create tablespace ... temporary
    형태와, 8i부터 사용되는 create temporary tablespace... 의 차이점을 정리해
    본다.
    tablespace의 temporay type과 permanent type에 대한 비교는 <Bulletin#: 11938>
    를 참조하도록 하고 여기에서는 permanent에 대해서는 논외로 한다.
    Explanation
    temporary segment가 생성 가능한 tablespace의 type과 temporary tablesapce에서
    datafile과 tempfile의 차이점을 설명한다.
    1. temporary segment를 생성가능한 tablespace type 정리
    temporary tablespace의 tempfile과 datafile을 비교하기 전에, tablespace의
    type들을 확인해 보고, 이 중 temporary segment가 생성될 수 있는 tablespace
    type을 version별로 정리해본다.
    tablespace는 7.2까지는 permanent type으로 dictionary managed방식으로
    space를 할당/해제하던 방식만이 존재했다. db user의 temporary tablespace로
    임의의 tablespace를 지정가능하였고, 해당 db user의 sort operation은
    지정된 tablespace에서 발생하며, 다른 tablespace와 특별히 구분되는 것은
    없었다.
    이후, 7.3에 temporary type이 추가되고, 8i에서 locally managed type과 일반
    datafile이 아닌 tempfile이 소개되면서 8i를 기준으로 기본적으로 다음과 같이
    4가지 형태의 tablespace 형태가 가능하다.
    이중 (1) ~ (3)번까지는 일반 datafile형태이고, (4)번의 경우는 이 문서에서
    자세히 살펴볼 tempfile이다.
    (locally managed와 dictionary managed의 차이점 및 사용 방법은
    <Bulletin #: 18261>과 <Bulletin #: 11860> 참조)
    (1) permanent-dictionary managed
    (2) permanent-locally managed
    (3) temporary-dictionary managed
    (4) tempfile-locally managed
    [주의] 위의 종류에 temporary datafile에 locally managed 형태의 tablespace는
    없는것에 주의한다.
    그리고 만약 system tablespace가 locally managed로 이미 생성된 경우에는
    이후 모든 tablespace는 locally managed로 생성이 가능하고, dictionary
    managed 형태는 생성하면 ORA-12913 (Cannot create dictionary managed
    tablespace) 오류가 발생하게 된다.
    이러한 여러가지 type의 tablespace중 temporary segment를 생성할 수 있는
    tablespace에 제약이 존재한다.
    - 8i: 어떠한 형태의 tablespace라도 db user의 temporary tablespace로 지정
    가능하다. 단, permanent-locally managed 형태의 tablespace에 sort가
    발생하게 되면 ORA-3212 (Temporary Segment cannot be created in
    locally-managed tablespace) 오류가 발생하게 된다.
    SQL> alter user scott temporary tablespace PERM_LOCAL;
    User altered.
    connect scott/tiger
    SQL> select * from dept order by 1;
    ORA-03212: Temporary Segment cannot be created in locally-managed
    tablespace
    - 9i: db user의 default temporary tablespace 지정 자체가 다음 두 가지
    type만이 가능한다.
    -temporary-dictionary managed
    -tempile-locally managed
    만약 permanent type의 tablespace를 db user의 tempoary tablespace로
    지정하면, ORA-12911 (permanent tablespace cannot be temporary tablespace)
    오류가 발생한다.
    2. tempfile과 datafile의 비교
    아래에서 tablespace지정시 tempfile과 datafile형태를 비교하게 되는데,
    단, datafile형태의 경우 permanent type에 대해서는 언급하지 않는다.
    (1) tempile의 특징
    Oracle7.3에서 tablespace에 생성시 temporary option을 이용하여 생성되는
    tablespace를 구성하는 화일은 datafile이다. 단지 이것이 기존의 permanent
    type과 구별되는것은 이 tablespace에 생성되는 segment들이 매번 sort
    operation마다 별도로 생성되는 대신, 하나의 segment로 만들어지면서
    다른 session에서의 sort operation이 같은 segment를 공유하는 것이다.
    (자세한 것은 <Bulletin#: 11938> 참조)
    Oracle8.1부터 추가된 tempfile형태의 중요한 특징은 tempfile에 발생하는
    변경사항은 redo log file에 기록되지 않는다는 것이다. tempfile에
    checkpoint정보도 기록하지 않고 이에 따라 datafile recovery시에도
    tempfile에 대해서는 recovery가 필요없게 된다.
    이와 같은 이유로 standby database에서 read-only mode로 open하고
    조회시 sort가 발생하여 tempfile이 변경되는것은 문제가 되지 않아
    사용이 가능하다.
    그리고 이미 앞에서 설명한 것과 같이 tempfile은 항상 locally managed
    type으로만 생성이 되며, datafile형태의 temporary tablespace는 다음과
    같이 locally managed type으로 생성 자체가 불가능하다.
    SQL> create tablespace temp_datafile_local
    2 DATAFILE '/ora/oradata/V920/temp_data.dbf' size 100M
    3 TEMPORARY
    4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
    ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
    (2) temporary tablespace 생성 방법 비교
    - tempfile형태의 경우
    tempfile로 temporary tablespace를 생성하는 경우는 다음과 같이
    생성하여야 하며, 반드시 locally managed 형태로만 생성 가능하다.
    SQL> create TEMPORARY tablespace temp_tempfile_local
    2 TEMPFILE '/ora/V920/temp_temp.dbf' size 100M
    3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
    아래 명령어에서 3번 line을 제거하고 생성하여도 default로 locally
    managed로 생성이 되며, dictionary managed 형태로 생성하고자
    3번 line대신 storage option을 추가하면
    ORA-2180 (invalid option for CREATE TABLESPACE) 오류가 발생한다.
    - datafile형태의 경우
    다음과 같은 형태로 생성하게 되면, dictionary managed type의
    temporary datafile형태로 tablespace가 만들어진다. 단, 9i의 경우
    이미 앞에서 언급한대로 system tablespace가 locally managed인 경우에는
    이와 같은 dictionary managed tablespace 생성은 ORA-12913이 발생하면서
    불가능하게 된다.
    SQL> create tablespace temp_datafile_dict
    2 datafile '/ora/oradata/V920/temp_data.dbf' size 100M
    3 TEMPORARY;
    (3) dictionary view 의 차이
    먼저 dba_tablespaces를 통해
    SQL> select tablespace_name, contents, extent_management,
    allocation_type from dba_tablespaces;
    TABLESPACE_NAME CONTENTS EXTENT_MAN ALLOCATIO
    TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL UNIFORM
    TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
    - tempfile의 경우
    SQL> select STATUS, ENABLED, NAME from v$tempfile;
    STATUS ENABLED NAME
    ONLINE READ WRITE /ora/V920/temp_temp.dbf
    SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
    FILE_NAME TABLESPACE_NAME
    /ora/V920/temp_temp.dbf TEMP_TEMPFILE_LOCAL
    - datafile 형태의 경우
    다음과 같이 v$datafile과 dba_data_files를 통해 조회한다.
    SQL> select STATUS, ENABLED, NAME from v$datafile;
    STATUS ENABLED NAME
    ONLINE READ WRITE /ora/oradata/V920/temp_data.dbf
    SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
    FILE_NAME TABLESPACE_NAME
    /ora/oradata/V920/temp_data.dbf TEMP_DATAFILE_DICT
    (4) tempfile의 삭제에 대해서
    datafile의 경우 tablespace를 삭제하지 않고 datafile만 삭제하는 방법은
    존재하지 않는다. 물론 alter database datafile 'filename' offline drop;
    과 같은 command가 있지만 이것도 datafile을 데이타베이스에서 지워주는
    것이 아니며 이렇게 offline drop된 datafile을 포함하는 tablespace는
    recovery가 불가능한 경우라면 tablespace자체를 삭제해야 한다.
    그런데 tempfile의 경우는 temporary tablespace는 그대로 유지한 채,
    tempfile만 삭제하는 것이 가능하다.
    SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
    2 drop;
    8i의 경우라면 이와 같은 명령어 후 실제 directory로 이동하여 직접
    tmep_temp01.dbf를 삭제하여야 한다.
    9i에서는 drop뒤에 including datafiles 라는 option을 추가하여 tempfile의
    drop시 바로 os상에서도 삭제되도록 할 수 있다.
    SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
    2 drop including contents;
    만약 이러한 방법으로, tempfile을 해당 temporary tablespace에서 모두
    삭제한 경우, 실제 해당 tablespace에 disk sort가 필요하게 되면,
    그때는 ORA-25153 (Temporary Tablespace is Empty) 오류가 발생하게 된다.
    이때는 다음과 같이 임의의 tempfile을 다시 추가할 수 있다.
    SQL> alter tablespace TEMP_TEMPFILE_LOCAL
    2 add tempfile '/oradata/V817/temp_temp02.dbf';
    Reference Documents
    <Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles ?
    글 수정:
    민천사 (민연홍)
    글 수정:
    민천사 (민연홍)
    가장 중요한 v$session의 sql_hash_value 컬럼이 안들어가서
    수정하였습니다. 죄송합니다.

  • Dropping Undo Tablespace 9i

    Hey Folks,
    I really need some help here.
    I'm trying to drop/recreate the undo tablespace (currently 25gig) Oracle 9i
    When I try to drop the undo tablespace 'UNDOTBS1' I get the following error:
    “ORA-01548: active rollback segment '_SYSSMU1$' found, terminate dropping tablespace”
    Here's what I have tried so far:
    - Bounced the DB several times hoping to get rid of the reference to the active rollback segment. No luck.
    - Created a new undo table space
    - Tried 'Alter system set undo_tablespace=new_one' (noticed that 10 new rollback segs were created '_SYSMU11$..SYSMU20$' pointing to the new undo tablespace)
    - I then performed an offline drop of the undo tablespace data file. After the offline drop, the system rollback segs SYSMU01$..SYSMU10$ went offline as would be expected.
    - Even with the new undo tablespace, all other application tablespaces still use the old undo which due to the offline drop, no inserts, deletes, etc. will work.
    After all the above, I still get the same error when trying to drop the undo tablespace.
    Any ideas? Ideally I would like to be able to drop the undo tablespace and recreate it, but at this point I'd be happy to bring back the undo tablespace datafile so we can at least use the database again.
    Thanks in advance!!
    Colin

    SQL> show parameters undo
    undo_retention integer
    10800
    undo_suppress_errors boolean
    FALSE
    undo_tablespace string
    UNDOTBS03
    r.- The undo tablespace which the database is looking for is this one ( UNDOTBS03 )
    What is strange about the lines above is that I have
    all those params above commented out in my
    \pfile\init.ora file (and have bounced the db).
    I’m not sure why they are still showing up.
    r.- Perhaps your instance is started with the spfile instead of the init file
    Here's what we did after the UNDOTBS1 tablespace
    caused the disk to run out of space during a large
    import (from now on we are going to use commit = y):
    1. Created a new undo tablespace UNDOTBS03 - got
    errors so instead we to created it as a temp
    tablespace UNDOTBS03 which worked. r.- Yes, but that tablespace was created as a UNDO TABLESPACE ?
    2. Tried to drop UNDOTBS1 got the following error
    msg:
    ORA-01548: active rollback segment '_SYSSMU1$' found,
    terminate dropping tablespacer.- Of course, the database did not allow to drop it beacause there were pending transactions
    3. SQL> alter system set undo_tablespace =
    'UNDOTBS03' scope = both. Tried dropping UNDOTBS1.
    Same error as in #2 above.r.- There were still pending transactions with the older undo tablespace
    4. We then offline dropped the datafile associated
    with UNDOTBS1 hoping that would then allow us to drop
    UNDOTBS1. Same error as #2.r.- That was the worst you did. You can not drop a tablespace so...
    5. Then tried creating a undo tablespace again:
    Create UNDO tablespace undo_temp
    datafile 'D:\oracle\oradata\usbperf\undo_temp.DBF'
    size 25m autoextend on;
    Error on line 0
    Create UNDO Tablespace undo_temp
    datafile 'D:\oracle\oradata\usbperf\undo_temp.
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00376: file 2 cannot be read at this time
    ORA-01110: data file 2:
    'D:\ORACLE\ORADATA\USBPERF\UNDOTBS01.DBF'
    So that’s where we are. I'm guessing that the
    original undo tablespace corrupted when it tried to
    extend and ran of disk space?
    Thanks again for the help.
    Colin ok I can guide to solve this but you have to do what I am going to tell you step by step. Is this a production database ?
    Joel Pérez
    http://www.oracle.com/technology/experts

  • TEMP tablespace increasing

    I have a problem with storage space of my default temporary table space.
    For my application, I specified the default table space as "DEFTBSPACE" with size 4000MB and temporary table space as "TEMP" with size 14486MB. Now, my usage of my temporary table space is increasing rapidly (Now, the used temp tablespace is 14485MB almost 99.99%). What could be the reason..? Is there any thing going into TEMP tablespace by mistake?.
    Please help.
    Reagrds,
    Satish.

    Can we deallocate manually the data file or a part of the datafile so that the usage space is reduced. What's the solution to reduce the usage space of this TEMP tablespace.If you bounce the db, you will get all used space.
    I heared, dropping and recreating the TEMP tablespace is the only the solution for this..??Is it true?
    Yes it is absolutely true.
    Create another temp tabelspace and set as default temp tablespace and drop the previous one. However, make sure no one is currently using that temp tablespace.
    The reason that you haven't get any result query v$sort_usge is that no one is using temp currently.
    You can also use v$tempseg_usage.
    Jaffar
    OCP DBA

  • Creating a Global Temporary Table on non-default TEMP tablespace.

    Hello ,
    I am using Oracle 11g.
    I have a procedure which create global temporary tables for its functionality. As the data which is going in the global temporary table , mean the data which is going in the default TEMP tablesapce is too huge ..... billions of rows..
    So what i want to do is , I want to create the global temporary table in another TEMP2 tablespace ( which is not the default one) so the load of billions of rows of data will be shifted to TEMP2. The default TEMP tablespace will not be affected and it can be used for other transactions.
    Is this possible. Can i shift the global temporary table from TEMP( Default temp tablespace) to TEMP2 ( the non-default temp tablespace) ????
    Please guide me with proper solutions and examples ....
    Thanks in advance ..

    DBA4 wrote:
    Hello ,
    I am using Oracle 11g.
    I have a procedure which create global temporary tables for its functionality. As the data which is going in the global temporary table , mean the data which is going in the default TEMP tablesapce is too huge ..... billions of rows..
    So what i want to do is , I want to create the global temporary table in another TEMP2 tablespace ( which is not the default one) so the load of billions of rows of data will be shifted to TEMP2. The default TEMP tablespace will not be affected and it can be used for other transactions.
    Is this possible. Can i shift the global temporary table from TEMP( Default temp tablespace) to TEMP2 ( the non-default temp tablespace) ????
    Global temporary tables are instantiated in the temporary tablespace of the schema that inserts the data - not into "the default" temporary tablespace.
    Assume Schema1 creates a GTT and grants all on that table to schema2
    Assume schema1 also creates a procedure (authid owner, the default) to insert data into the GTT and grants execute on the procedure to schema2
    If schema2 executes: insert into schema1.gtt, the data will appear in the temporary tablespace of schema2
    If schema2 executes: execute schema1.procedure, the data will appear in the temporary tablespace of schema1
    So if you want to protect the "normal" temporary tablespace, you could just create a special temporary tablespace for the owner of the procedure.
    Regards
    Jonathan Lewis

  • TEMP tablespace getting full while inserting a CLOB in Trigger

    We have a Oracle 10g (10.2.0.4.0) DB on a Solaris 9 box which also runs our J2EE web-service application on Weblogic 8sp6 server.
    We get around 220K web-service requests from upstream callers daily to insert data in the main table, say TABLE1, which has daily partitions on a date column. This table has around 21 columns out of which 1 is a CLOB column.
    Now this table has an AFTER INSERT trigger which calls a package procedure to insert the same record into another table, say TABLE2.
    From Java application insert statement in executed in below format using a weblogic jdbc connection pool :
    INSERT INTO TABLE1(COLUMN1, COLUMN2, ........., CLOB_COLUMN,........, COLUMN21) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20);
    Clob object is prepared in application using ojdbc14.jar.
    We are observing a strange issue here. The TEMP tablespace utilization keeps on growing as more and more inserts are executed by application and after ~125K inserts the TEMP tablespace gets full and we start getting ORA-01652 error.
    On further analysis we could see that there are only 7-10 session being maintained but as more and more inserts happen TEMP tablespace utilization goes on increasing for each of these sessions.
    When we tried with inserting just few records and then watching the session details in v$session_wait then we could see that it is in INACTIVE state and waiting for the event ‘SQL*Net message from client’. This does not seem correct as the session has successfully inserted the data and committed the transaction and we can see the data in the tables as well.
    The confusing thing here is when we modify the trigger to pass blank string('' ) instead of the CLOB column to TABLE2 then this issue does not occur. All 200K records are inserted properly and TEMP tablespace utilization also keep always below 1%.
    Can you please help us in solving this issue. Is this related to any oracle issue?
    Inside the package we have tried using DBMS_COPY statement to copy the CLOB column after insert but still same result.
    Code for reference:
    Trigger:
    =====================================
    CREATE OR REPLACE TRIGGER trg
    AFTER INSERT OR UPDATE
    ON TABLE1
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    IF (:NEW.date_col > SYSDATE - 2)
    THEN
    IF (:NEW.cat IN (1001, 1002))
    THEN
    pkg.process_change
         (:NEW.COLUMN1,
              :NEW.COLUMN2,
              :NEW.CLOB_COLUMN,
    FLAG
    END IF;
    END IF;
    END;
    =====================================
    Package:
    =====================================
    procedure PKG.Process_change(
    p_COLUMN1 number,
    p_COLUMN2 varchar2,
    p_CLOB_COLUMN clob,
    flag boolean
    ) is
    v_watermark pls_integer;
    v_type varchar2(1);
    begin
    if (flag) then
    v_type := 'U';
    else
    v_type := 'I';
    end if;
    select t_seq.nextval into v_watermark from dual;
    insert into TABLE2(
    COLUMN1 number,
    COLUMN2 varchar2,
    CLOB_COLUMN clob,
    watermark,
    dml_type
    )values (
    p_COLUMN1 number,
    p_COLUMN2 varchar2,
    p_CLOB_COLUMN clob,
    v_watermark,
    v_dml_type
    end;
    =====================================

    My first thought on reading your post is that not only are you using a database version that is now so old it is in extended support and even then not even the most recent patchset for it.
    The first thing I would do is move to 11gR2 and if you can't do that at least get to 10.2.0.5 and apply CLOB relevant patches as well.
    Same goes for your operating system. Solaris 9 is ancient: So move to 10 which has vastly improved memory management.
    To help you further it would be really valuable to know the table layout. For example is this a heap table or an IOT? Is it partitioned? Is this RAC? What size are the CLOBs? Are they stored in-line? Chunk size? etc.
    This page should start you down the right road:
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#sthref204
    But I am also wondering why you would use a trigger to, as you say, "insert the same record into another table." This description is a poster child for "bad design."

Maybe you are looking for