Drop a temporary tablespace

Hi all
I have created a temporary tablespace temp01 and assign it as the default temporary tablespace for the database (10.0.2.0)
How can I drop it without changing the default temporary tablespace?
thanks for help

phaeus wrote:
Hello,
create a new temporary tablespace. Make it to your default database temp tablespace and then you can drop the old one.
A couple of thoughts I'd want to check on that - based on memories of problems in the dim and distant past.
If you take this approach, do you still have to worry about users who have already got the dropped tablespace associated with their temp tablespace in dba_users ? Memory says they'll either get an error message, or they'll fall back to SYSTEM despite there being a new default.
One of the reasons for creating tablespace groups for temporary tablespaces is that you can assign a tablespace group to a user, and then invisibly create and drop temporary tablespaces in that group without having to adjust the users' details. But there used to be a bug that resulted in excessive hits on dc_tablespaces if you did this, and extreme numbers of executions of a query against ts$ (or maybe file$).
Regards
Jonathan Lewis

Similar Messages

  • ORA-00600 Error, when Dropping one temporary tablespace

    Hi,
    I am using Oracle 10.1.0.2.0 on WinXPP, after I created a new temp tablespace and assigned one user to it as its temp tablespace, then trying to drop the old temp tablespace , I am getting the following Error . Can anybody pl. explain the reason.
    Steps I followed as...
    SYSTEM@orcl>create temporary tablespace checkup_tmp tempfile 'c:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL \CHECKUP_Tmp.dat' size 500M;
    Tablespace created.
    SYSTEM@orcl> alter user checkup temporary tablespace checkup_tmp;
    User altered.
    SYSTEM@orcl> drop tablespace CHECKUP_TEMP including contents;
    drop tablespace CHECKUP_TEMP including contents
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [krf_gen_drop_tablespace-1], [], [],
    SYSTEM@orcl> drop tablespace CHECKUP_TEMP ;
    drop tablespace CHECKUP_TEMP
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [krf_gen_drop_tablespace-1], [], [],
    Thanks in advance

    this is the bug 3984486
    consider upgrading.
    the workaround seems to flashback the DB...

  • Dropping default temporary tablespace

    Hi
    (regarding Oracle 9i)
    I am getting two conflicting messages. The first one says you cannot drop a default temporary tablespace, and the second one says you can and that SYSTEM then becomes the default temporary tablespace. Which one is correct?
    http://www.idevelopment.info/data/Oracle/DBA_tips/Tablespaces/TBS_12.shtml says: The DBA cannot drop a default temporary tablespace, but it is possible to assign a new default temporary tablespace and then drop the old one. You also cannot change a default temporary tablespace to a permanent tablespace, nor can you take a default temporary tablespace offline.
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c04space.htm#1945 says: If you drop the default temporary tablespace, then the SYSTEM tablespace is used as the default temporary tablespace
    Which one is correct?!?!
    thanks

    select * from database_properties where property_name='DEFAULT_TEMP_TABLESPACE';
    PROPERTY_NAME
    PROPERTY_VALUE
    DESCRIPTION
    DEFAULT_TEMP_TABLESPACE
    TEMP
    Name of default temporary tablespace
    drop tablespace temp;
    drop tablespace temp
    ERROR at line 1:
    ORA-12906: cannot drop default temporary tablespaceBut as your earlier quotations make clear, there is nothing stopping from creating a NEW temporary tablespace, making that the default, and then dropping TEMP, the original-but-no-longer default.
    The principle is logical: a default's not much of a default if it can cease to exist. For a default to be meaningful, it has to be protected from being gotten rid of.
    The other thing you hinted at: the default default temporary tablespace is still SYSTEM, because it's the only tablespace that HAS to exist from the moment a database exists (though 10g elevates SYSAUX to almost the same status). So if you choose to create your database manually, using syntax of the form 'create database XXX....', it is allowed NOT to create a temporary tablespace. And if you choose to do that, then SYSTEM will be used as the default temporary tablespace.

  • When can I safely drop a temporary tablespace?

    I have a temporary tablespace in my database that I would like to get ride of.
    It was created with a statement similar to this:
    CREATE TEMPORARY TABLESPACE "TEMP"
    blah blah blah. . .
    I have checked dba_users and dba_extents. It is not used in either places.
    Is there anywhere else I should check prior to executing a "DROP TABLESPACE" command?
    Thank you,
    -Kris

    Query V$SORT_SEGMENT to check CURRENT_USERS for that TABLESPACE_NAME.
    If CURRENT_USERS is 0, it is not in use currently.
    Of course, query DBA_USERS to check TEMPORARY_TABLESPACE to see if it has been defined as the Temporary Tablespace for any user.
    If you have only created a Temporary Tablespace but not assigned it as the DEFAULT TEMPORARY TABLESPACE at the Database level or any user's Temporary Tablespace with an ALTER USER command, then it wouldn't be in use !
    Oracle starts using a Temporary Tablespace if either
    a. It is the DEFAULT TEMPORARY TABLESPACE
    b. It has been assigned as a User's Temporary Tablespace
    c. It is part of a Temporary Tablespace Group that has been assigned
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • About Temporary Tablespace

    Hi DBA Guru(s),
    I have a general query about Temporary Tablespace that,
    if we drop the temporary tablespace then out database will run or not and
    also what will be the impact on database.
    Please suggest.
    Regards,
    Rajeev Kumar

    970371 wrote:
    Hi DBA Guru(s),
    I have a general query about Temporary Tablespace that,
    if we drop the temporary tablespace then out database will run or not and
    also what will be the impact on database.
    Please suggest.
    Regards,
    Rajeev KumarDatabase can start without Temp Tablespace but it will not be good idea since because the system tbs is used for sort segment.

  • Drop Temporary Tablespace!

    Hi All,
    I have tried dropping my old temporary tablespace TEMP after making new TEMP2 as default.
    All the users (checked in dba_users) are using TEMP2 as default temporary tablespace.
    Now, issue is when I am trying to take TEMP offline and dropping it some of the users are not able to open the forms.
    Please suggest, is it necessary that I must do this activity after taking a proper downtime or I can do it in business hours.
    Thanks,
    Anchorage

    It's done now!!!
    Actually issue was
    You cannot drop a tablespace if it contains any rollback segments holding active transactions.*
    Try to check whether any one using the temp segments or not on query "v$sort_usage"*
    If it returns the rows, the sessions are using the temp tablespace. Once the Sessions Closes then the the command execution will be completed, else you and go head and kill the session with respect to session Id.*
    Which was been explained to me by Pavan in General Database Forum!
    I have killed the active session and it was success!
    Anchorage

  • Script for temporary tablespace in 8.1.7.4.0

    Hi,
    I am working in oracle 8.1.7.4.0 and HP-UX os.I need a shell script which is to do the following tasks,
    1. create a new temporary tablespace
    2.assign the new temp tablespace to the database user level
    3.drop the old temp tablespace
    4. then create a temp tablespace with the old name
    5. then assign the new temp tablespace to the database user level
    6.drop the new temp tablespace
    Kindly provide me the script for oracle 8.1.7.4.0
    Rgds..

    here is one I prepared earlier (just like a TV chef)
    set echo on
    -- Create a New TEMP TEMP
    create temporary tablespace temp2
    tempfile 'dir/temp2.dbf' size 5M
    autoextend on next 1M maxsize unlimited extent management local uniform size 1M;
    -- Make the TEMP2 tablespace temp
    alter database default temporary tablespace temp2;
    -- Drop the orginal to recreate with new size
    drop tablespace temp including contents and datafiles;
    CREATE TEMPORARY TABLESPACE TEMP
    TEMPFILE 'dir/temp01.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 30000M
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 2M;
    alter database default temporary tablespace temp;
    drop tablespace temp2 including contents and datafiles;

  • FIXED     ORA-02180 when Creating a Temporary Tablespace

    I am using Oracle 9i on a Win 2003 machine.
    I have just performed a recovery of all my datafiles and have successfully opened the database using ALTER DATABASE OPEN;
    I have been using THIS as a guide and am now at the stage of creating a new temp tablespace and dropping the old one (step 8.).
    I use the following SQL,
    CREATE TEMPORARY TABLESPACE temp02 TEMPFILE 'c:\oracle\oradata\bcs\temp02.dbf' SIZE 100mb AUTOEXTEND OFF EXTENT MANAGEMENT LOCAL;
    However it returns the following error:
    ERROR at line 1:
    ORA-02180: invalid option for CREATE TABLESPACE
    Having googled the error it just says to make sure I am specifying a vaild option such as a datafile. I thought that is what I am doing!?
    Could anyone please point out where I am going wrong and suggest a solution. It would be greatly appreciated.
    Regards
    Toby
    Message was edited by:
    redeye

    Hi,
    CREATE TEMPORARY TABLESPACE temp02 >TEMPFILE 'c:\oracle\oradata\bcs\temp02.dbf' SIZE 100mb AUTOEXTEND OFF
    EXTENT MANAGEMENT LOCAL;i think above creating temporary tablespace syntax may be wrong
    why r u using AUTOEXTEND OFF?
    plz try the following syntax
    CREATE TEMPORARY TABLESPACE temp02 TEMPFILE 'c:\oracle\oradata\bcs\temp02.dbf' SIZE 100mb
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10m;
    Regards ...

  • Temporary tablespace groups - all available temp files not used

    We have a temporary tablespace group TEMP_GROUP made of the following pre-existing temp files. I have placed the size in MB in brackets. Names have been changed to protect our privacy. NLS is spanish
    SQL> select * from dba_tablespace_groups;
    TEMP_GROUP TEMP1 --(1024)     
    TEMP_GROUP TEMP2 --(2000)
    TEMP_GROUP TEMP3 --(8048)
    This tablespace group is the default temp tablespace of this database, and is the default temp tablespace of sys in the example that follows
    connect sys/password
    alter INDEX schema1.idx1 rebuild
    ERROR en línea 1:
    ORA-01652: no se ha podido ampliar el segmento temporal con 128 en el tablespace TEMP1
    -- this coinicdes with the TEMP1 showing 100% used
    NOTE that the message refers to the tempfile TEMP1 and not the TEMP_GROUP, which has 11GB of space available
    The size of the index is small enough to be handled by this TEMP_GROUP, although quite large to be handled by TEMP1 on its own.
    SQL> SELECT sum(bytes)/1048576 Megs, segment_name
    2 FROM dba_extents
    3 WHERE segment_name = 'IDX1'
    4 GROUP BY segment_name
    5 /
    MEGS SEGMENT_NAME
    840 IDX1
    What appears to be happening is that when the rebuild index has used all the space available in TEMP1 tempfile, it does not go on to use the space available in the other two tempfiles that make up the TEMP_GROUP. This seems to be contrary to the very idea of having set up a TEMP_GROUP.
    This suposition is born out by the repitition of the operation using the owner of the index, whose default temp file is not TEMP_GROUP as a whole, but the component tempfile TEMP_3 which has 8048MB available
    connect schema1/password
    SQL> alter INDEX schema1.idx1 rebuild
    Índice modificado.
    -- This time the index does get rebuilt, pesumably because there is space available in TEMP_3 to carry out the rebuild.
    My questions are
    1. ¿Why does the original operation fail out when it has reached the limit of tempfile TEMP1 instead of using the further space availbel within TEMP_GROUP? ¿Isn´t the point of temporary tablespace groups the explicit avoidance of this type of issue?
    2. Depending on the answer to #1, and asuming that the behaviour is normal (ie, that a rebuild index should not be expected to take place using more than one temp file), does anyone have any idea ¿what dicatates the order of usage of the component temp files in a group?. ¿Is it alphabetical order of tempfile name?, ¿file create time? or ¿something else?
    3. As I mentioned the group was created out of existing tempfiles, rather than creating some temp file specifically to form the group. ¿Could this fact explain the inability of the operation to move onto the next temp file, once the first is exhausted. There is nothing in the documentation to suggest that there should be any difference in behaviour between a temp group created with new temp files, or the inclusion of existing temp files when creating a temp group.
    As you can see, we have worked round this problem, but it is an issue of importance given that it may affect other operations that leverage this temp file group. Any information or pointers to documented instances of similar occurances would be greatly appreciated. Thank you.
    Edited by: user602617 on 06-may-2009 0:57

    Half solved. This thread seems to suggest that there should be n expectation that a sort operation will begin to use the n+1 member of a temp tablespace group once it has exhausted member n.
    TEMP Tablespace Groups
    But this does not answer my secondary question as to how to determine which temp tablespace member is used first. I guess the solution would be to drop the the group and recreate it with three adequatly sized temp tablespaces.

  • Cleaning up temporary tablespace

    Hi,
    I am facing a problem where temporary tablespace of the production database has grown to 23GB.The instance cannot be bounced and there is very little space left for the rest of the database.I want to free up the excess space.I know I can do it by creating a new temp tablespace,assigning it as default and dropping the old one.But I want to know how I can resize the existing temp tablespace.when I try the following command:
    alter database datafile '/d02/oradata/<SID>/temp01.dbf' resize 1G;
    it gives the following error:
    file contains used data beyond requested RESIZE value.
    How can I get around the above problem.there is no session using TEMP tablespace.Plz suggest a solution as I really want to know how this can be done.

    First of all, You can't resize the temp tablespace datafiles size as once the temp tbs allocate extents, after the operation finishes, oracle won't deallocate them as it keep them for future requirements and usage.
    What you can do in your case, as you cant bounce the db, create another temp tablespace and assign it as default temp tbs and drop the old one.
    Also, dont keep its datafiles for auto extend and if you see any error message in alter log file like 'unable to extend temp tablespace' then increase the size. If you feel your queries may fail due to this, you can also use resumable option and investigate why does it requred 20+G for temp?
    SJH
    OCP DBA

  • Group temporary tablespace

    Greetings,
    oracle 10.2.0.4
    suse linux 9
    we have a group temporary tablespace called ATEMP which contains 9 tablespaces ATEMP01 - ATEMP09
    but the in the alert log we have this warning
    WARNING: the following temporary tablespaces contain no files.
    this condition can occur when a backup controlfile has been restored.
    it may be necessary to add files to these tablespace. that can be done using SQL.....
    alternatively, if these temporary tablesapces are no longer needed, then
    they can be dropped. Empty temporary tablespace: ATEMP
    then I was confirmed on this forum after a question that...in this case oracle is using SYSTEM tablespace
    as a temporary tablespace and this has a performance impact and the system may hung if SYSTEM tbs gets
    full. which I totally agree according to oracle documentation
    and my question for today is
    how can I show to somebody that the current temp segments are in SYSTEM tablesapce because as I run
    the query
    SELECT TABLESPACE_NAME,BYTES_USED,BYTES_FREE FROM V$TEMP_SPACE_HEADER;
    the return show the tablespaces are ATEMP01,ATEMP02....instead of SYSTEM which was my expectation.
    thanks

    thank you
    I just passed the query to the view
    select tablespace,contents from v$tempseg_usage
    and what I found is
    ATEMP02 and TEMPORARY
    now what is contradicting for me is that...the alert log is showing as if ATEMP which is a temporary
    tablespace group is not having a file and we need to add files to it ...which implies that SYSTEM tablespace
    is being used as a residing place for the temp segments but the query returns ATEMP02 as the temporary
    tablesapce where temp segment is residing
    can you help me reconsile this seemingly confusing scenario

  • Cleanup Temporary Tablespace

    Our programmer has me increasing the size of our temporary tablespace due to a materialized view he is having trouble with. The error message he is getting says he is running out of temp space, so he has had me create 4 temp spaces on the C drive(temp01,temp02,temp03,temp04) so far. Three with 2000mb each and one with 2500mb.
    He now has had me create one temp space on another larger drive with 14000mb. And, he wants me to cleanup the temp spaces on the C drive. Can that be done? How?
    Grateful!

    If I understand correctly you have 4 TEMP tablespaces temp01,temp02,temp03,temp04 and then you created another. To clean out the old temp, I would first suggest you shink the datafile to something small using the command: alter database datafile '<filename>' resize 50k; Then if you do not want the tablespaces anymore just drop them.
    [email protected]

  • Help!!! Temporary tablespace issue

    Hi,
    10g
    I had 2 tablespaces temp1 and temp2
    temp1 was created as a normal tablespace as temporary.
    temp2 was created as a temporary tablespace.
    I queried and found out that the temporary tablespace for all the users are temp1(including system)
    and hence I saw the error ORA-25153: Temporary Tablespace is Empty
    So what I did is I drop the tablespace temp1 and tried assigning the users to temp2.
    I am getting error
    Now I am not able to create anything the database.
    Please see below example
    SQL> drop user test;
    User dropped.
    SQL> create user test identified by test;
    create user test identified by test
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00959: tablespace 'TEMP1' does not exist
    I did a restart of database but still the users are assigned to temp1 which is not there
    Please help !!!!!!!!!!!!!!!!!!

    PROPERTY_NAME
    PROPERTY_VALUE
    DESCRIPTION
    DEFAULT_TEMP_TABLESPACE
    TEMP2
    Name of default temporary tablespace
    SQL> SQL>
    PROPERTY_NAME
    PROPERTY_VALUE
    DESCRIPTION
    DEFAULT_TEMP_TABLESPACE
    TEMP2
    Name of default temporary tablespace
    ====================================================
    SQL> SQL>
    TABLESPACE_NAME
    FILE_NAME
    BYTES/1024/1024 MAXBYTES/1024/1024 AUT
    TEMP2
    /db08/oracle/bricry1/TEMP02.DBF
    500 0 NO
    TEMP2
    /db08/oracle/bricry1/TEMP02_2.DBF
    500 0 NO
    TABLESPACE_NAME
    FILE_NAME
    BYTES/1024/1024 MAXBYTES/1024/1024 AUT
    TIVOLIORTEMPTS
    /db08/oracle/bricry1/tivoliortempts_01.dbf
    25 0 NO
    =========================================
    SQL> SQL>
    TEMPORARY_TABLESPACE
    TIVOLIORTEMPTS
    TEMP2
    TEMP1
    SQL> SQL>
    SQL>

  • TEMPORARY TABLESPACE에서, TEMPFILE을 사용할지, DATAFILE을 사용 할지 결정에 필요한 지침

    제품 : ORACLE SERVER
    작성날짜 : 2003-02-24
    TEMPORARY TABLESPACE에서, 임시 파일을 사용할지, 데이터파일을 사용 할지 결정에 필요한 지침
    ===========================================================================================
    PURPOSE
    이 문서는, TEMPORARY TABLESPACE에서 임시 파일과 데이터파일의 차이점을
    소개하는 데 목적이 있다.
    Explanation
    | TEMPORARY | Tablespace |
    | tablespace | TEMPORARY |
    | Locally | Dictionary |
    | managed | managed |
    | Datafiles | impossible | Y |
    | Tempfiles | Y | impossible |
    ------------------------------------------+
    다른 조합은 허용되지 않는다.
    1. TEMPORARY Tablespace / Tablespace TEMPORARY 와 PERMANENT tablespace 비교
    1) Tablespace TEMPORARY는 오라클 7.3 이상 버젼에서 사용가능하다.
    => Tablespace TEMPORARY는 다음과 같은 명령을 사용하여 생성한다.
    CREATE TABLESPACE .. TEMPORARY
    이 경우 데이터파일만을 사용한다.
    2) TEMPORARY tablespac는 오라클 8i 이상 버젼에서 사용 가능하다
    => TEMPORARY tablespace는 다음과 같은 명령을 사용하여 생성한다
    CREATE TEMPORARY TABLESPACE .. TEMPFILE
    이 경우 tempfile만 사용할 수 있다.
    3) Tablespace TEMPORARY/TEMPORARY tablespace는 DBA_TABLESPACES의
    CONTENTS 값이 TEMPORARY로 나타난다.
    4) Tablespace TEMPORARY/TEMPORARY tablespace 는 PERMANENT
    tablespace와 다르며 (DBA_TABLESPACES.CONTENTS 값이 PERMANENT임)
    permanent segment를 생성 할 수 없다. 예를 들어, permanent table이나
    index, cluster, rollback segment등을 Tablespace TEMPORARY/TEMPORARY
    tablespace에 생성할 수 없다.
    5) Tablespace TEMPORARY/TEMPORARY tablespace 에서는, 단일한
    temporary segment를 제공하며, 이 세그먼트는 다음과 같은
    요구사항을 가진 모든 사용자에 의해 공유된다.
    => sort 작업에 따른 sort extents를 필요로 하는 사용자
    => GLOBAL TEMPORARY TABLE에 필요한 temporary extents
    이와 같은 고유한 temporary segment는 동시에 많은 양의 sort 작업이
    수행되거나, 여러 트랜잭션이 동일한 temporary table을 사용할 때,
    permanent tablespace에서 작업하는 overhead를 피하고, 오라클의
    공간 관리 작업의 부하를 피하는데 도움을 준다.
    6) Temporary segment는 인스턴스 구동후 사용자가 sort extent나
    sort run, 또는 global temporary table 생성등의 요청에 따라
    자동적으로 생성된다.
    7) Temporary segment는 인스턴스 shutdown시 자동적으로 drop 된다.
    8) Temporary Content를 저장하는 테이블스페이스에 대한
    세그먼트의 공간 할당/할당 해제 관련 정보는 V$SORT_SEGMENT와
    V$SORT_USAGE 뷰를 사용하여 확인해 볼 수 있으며, sort segment
    등에 현재 sort를 진행하는 사용 정보를 보여준다.
    9) 위와 같은 작업을 수행하는데 PERMANENT tablespace 보다는
    tablespace TEMPORARY를 사용하는 것이 유리한 점은 <Bulletin No:
    11938>에 자세히 기술되어 있따.
    10) 오라클 8i에서는, 사용자별 default temporary tablespace가 어떤
    종류라도 상관이 없으나, PERMANENT locally managed 방식의 테이블
    스페이스는 지정할 수 없다. 다음은 PERMANENT locally managed 방식의
    테이블스페이스를 default temporary tablespace로 지정하여 발생하는
    에러이다.
    SQL> alter user x temporary tablespace PERM_LOCAL;
    User altered.
    SQL> select * from dba_tables order by 3,2,6,4,7,9,1,5;
    select * from dba_tables order by 3,2,6,4,7,9,1,5
    ERROR at line 1:
    ORA-03212: Temporary Segment cannot be created in locally-managed tablespace
    오라클 9i에서는 사용자별 default temporary tablespace가
    어떤 TEMPORARY 타입이라도 무방하다.
    => TEMPORARY tablespace locally managed
    => tablespace TEMPORARY dictionary managed
    PERMANENT locally-managed 타입의 테이블스페이스를 사용자의
    TEMPORARY tablespace으로 지정할 때 다음과 같은 에러가 발생한다.
    SQL> alter user x temporary tablespace PERM_LOCAL;
    alter user x temporary tablespace PERM_LOCAL
    ERROR at line 1:
    ORA-12911: permanent tablespace cannot be temporary tablespace
    2. TEMPORARY Tablespace/Tempfiles 대비 Tablespace TEMPORARY/Datafile
    1) 공간관리
    공간 관리는, locally managed tablespace에서 훨씬 단순하고, 또
    효율적이기 때문에, TEMPORARY tablespace를 사용하는 것이
    바람직하다. Local managedment 방식에서 사용 가능한 유일한
    방식이 temporary tablespace 방식이다.
    SQL> create tablespace temp1
    2 DATAFILE '/ora/ora817/32/oradata/V817/temp1.dbf' size 100M
    3 TEMPORARY
    4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
    create tablespace temp1
    ERROR at line 1:
    ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
    Dictionary-managed tablespace 대비 locally-managed tableapce의 장점은
    <Bulletin No: 18261>에 자세히 기술되어 있다.
    오라클 8i에서는, sort segment가 locally managed permanent tablespace에
    생성될 수 없으므로, locally managed TEMPORARY tablespace를 사용하여야
    한다.
    Locally managed temporary tablespace는 tempfile을 사용하며, temporary
    tablespace 바깥 데이터에 전혀 영향을 주지 않으면서, temporary tablespace
    관련 데이터에 대한 redo정보가 생성되지 않는다.
    이 테이블스페이스는, standby database나 read-only database에서도
    사용 가능하다.
    2) View
    TEMPORARY tablespace 와 연관된 파일 목록은 V$TEMPFILE 과
    DBA_TEMP_FILES 뷰를 통해 확인할 수 있다.
    SQL> select * from dba_tablespaces;
    TABLESPACE_NAME CONTENTS EXTENT_MAN
    TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL
    TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
    SQL> select STATUS, ENABLED, NAME from v$tempfile;
    STATUS ENABLED NAME
    ONLINE READ WRITE /tcase/oradata/V901/temp_temp01.dbf
    SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
    FILE_NAME TABLESPACE_NAME
    /tcase/oradata/V901/temp_temp01.dbf TEMP_TEMPFILE_LOCAL
    위 내용은 tablespace TEMPORARY 환경에서 V$DATAFILE 와
    DBA_DATA_FILES를 사용하는 것에 비길 수 있다.
    SQL> select STATUS, ENABLED, NAME from v$datafile;
    STATUS ENABLED NAME
    ONLINE READ WRITE /tcase/oradata/V901/temp_data01.dbf
    SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
    FILE_NAME TABLESPACE_NAME
    /tcase/oradata/V901/temp_data01.dbf TEMP_DATAFILE_DICT
    3) 권한
    Temporary tablespace 또는 tablespace temporary 생성을 위해서는
    CREATE TABLESPACE system privilege가 필요하다.
    4) TEMPORARY Tablespace 생성
    SQL> create TEMPORARY tablespace temp_tempfile_local
    2 TEMPFILE '/ora/V817/temp_temp.dbf' size 100M
    3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
    참고: 일부 OS에서는 tempfile block이 실제 액세스 되기
    전 까지 tempfile이 실제로 생성되지 않는다. 이와 같은
    파일 생성 작업이 지체되어 처리 되는 것은, tempfile의
    생성과 크기 조정이 신속하게 처리되는데 도움이 된다.
    그러나, tempfile이 나중에 생성되더라도, 생성 가능한
    충분한 디스크 공간이 있어야 하겠다.
    사용중인 O/S에서 tempfile이 실제 생성되는 시점은
    플랫폼별 매뉴얼에 기술되어 있다.
    Tablespace TEMPORARY의 생성
    SQL> create tablespace TEMP_DATAFILE_DICT
    2 datafile '/tcase/oradata/V901/temp_data.dbf' size 100M
    3 TEMPORARY;
    Tablespace created.
    5) Tempfile/Datafile 제거
    a. 테이블스페이스를 drop 하기 전까지 테이블스페이스의 datafile을
    제거할 수 없다.
    참고: 오라클 9i에서 DROP TABLESPACE 명령에 추가된
    INCLUDING CONTENTS AND DATAFILES 절을 사용하면, OS로 부터
    관련 데이터파일도 삭제하는 작업을 자동화 할 수 있다.
    b. Temporary tablespace로 부터 tempfile을 삭제하고, 논리 구조를
    비어 있는 상태로 유지할 수 있다.
    => 오라클 8i:
    SQL> alter tablespace TEMP_TEMPFILE_LOCAL
    2 add tempfile '/oradata/V817/temp_temp01.dbf';
    Tablespace altered.
    SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
    2 drop;
    Database altered.
    SQL> !ls /oradata/V817/temp_temp01.dbf
    /oradata/V817/temp_temp01.dbf
    위 명령을 수행 한 후, tempfile을 시스템으로 부터 삭제하고,
    나중에 다시 추가 시킬 수 있다.
    SQL> alter tablespace TEMP_TEMPFILE_LOCAL
    2 add tempfile '/oradata/V817/temp_temp01.dbf';
    Tablespace altered.
    => 오라클 9i: OS 파일을 삭제 하기 위해 INCLUDING DATAFILES
    절을 사용할 수 있다.
    SQL> alter database tempfile '/oradata/V901/temp_temp01.dbf'
    2 drop including datafiles;
    Database altered.
    SQL> !ls /oradata/V901/temp_temp01.dbf
    /oradata/V901/temp_temp01.dbf not found
    Temporary tablespace로 부터 모든 tempfile을 삭제하면,
    다음과 같은 에러가 발생할 수 있다.
    SQL> alter table olap.test add primary key (c);
    alter table olap.test add primary key (c)
    ERROR at line 1:
    ORA-25153: Temporary Tablespace is Empty
    ORA-25153
    25153, 00000, "Temporary Tablespace is Empty"
    // *Cause: An attempt was made to use space in a temporary tablespace with
    // no files.
    // *Action: Add files to the tablespace using ADD TEMPFILE command.
    이 에러 메시지는 동시 작업 수행시 디스크를 실제 액세스 하여야
    할 경우 발생하게 된다.
    Example
    Reference Documents
    <Note:132663.1> ORA-03296 Resizing Temporary Locally Managed Tablespace
    <Note:131769.1> ORA-03212 at Instance Startup
    <Note:102339.1> Temporary Segments: What Happens When a Sort Occurs
    <Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles

  • Problem shrinking a temporary tablespace

    I have a temporary tablespace in 10.1.0.3 I need to shrink. I need to shrink the database.
    1. I change all users that user that temporary tablespace to a new temporary tablespace
    2. Tried to shrink it but got
    ERROR at line 1:
    ORA-03297: file contains used data beyond requested RESIZE value
    I take this to mean there are open transactions using this temporary tablespace? How do I find who currently is using this temporary tablespace? do i need to kill those sessions?

    Hi,
    There may be one issue, if there are transactions open and the old temp tbsp is currently used (for sorting, etc), you will not be able to drop it without crashing the sessions. It will be nice if you check which user sessions are using the old temp and either gracefully abort the session (by asking them) or wait until they are done. Otherwise you may create the new temp and make it default (tablespace as well as user's temp tablespace name) so that no new user session will connect to the old temp and you can monitor it to stop its usage.
    Thanks

Maybe you are looking for

  • Imac freezes

    case # 453372541 imac 2.7 ghz intel core i5 12gb 1333 mhz ddr3 memory graphics amd radeon hd 6770m 512 mb mac osx lion 10.7.5 ( 11g630 ) no third party hardware added to computer computer went to sleep came home after afew hours and system would not

  • Optical drives ejects any and all forms of discs!

    Just as the title says, on my Macbook Pro which i bought somewhere around july of '06, my optical drive will no longer read any form of disk. DVD, CD, CD-R, DVD-R...nothing. All it does is let it spin for about 30-45 seconds and spits it back out. Is

  • Minimum zoom level

    In landscape format in continuous scroll mode, why can't you decrease the zoom level to less than page width? On tablets, page width as the minimum level makes the text appear too large in some documents. It would be better if you could further decre

  • Baseline Offset Bug for Inline Figures

    I reported this for Pages 2.0 but it was not fixed in Pages 2.01. It would be good if some others could duplicate and also report this bug. Maybe then Apple will fix it. My application is with inline figures, mainly, math expressions imported from Ma

  • I am receiving calls from other phones on my iCloud account, and handoff is turned off on both phones. Please help.

    Handoff is turned off on both phones and both phones only have their own number checked under send and receive from. Please help.