How do I empty TEMP tablespace in Oracle8.1.7.4

Hi,
I need to empty the temp tbl using Oracle8.1.7.4
Any advice will be appreciated.
Kind Regards,

It is normal to see the temp tablespace full. Oracle finds it the most efficient way to allocate an extent and mange it rather than allocate - deallocate.

Similar Messages

  • How could I extend temp tablespace safely ?

    I am beginner of Oracle DB.
    We are making DEV environment of Oracle Insight.
    How could I extend temp tablespace safely ?

    It is normal to see the temp tablespace full. Oracle finds it the most efficient way to allocate an extent and mange it rather than allocate - deallocate.

  • Droping TEMP tablespace

    hi folks,
    i have a production database in a high traffic environment base on oracle 8.1.7.0.0
    i lost TEMP tablespace's datafile because of that i just offlined the tablespace ( just one datafile per tablespace TEMP ) but i can not drop or add a datafile to this tablespace.
    i just added a TEMPX tablespace and changed TEMPORARY TABLESPACE of users to use this new temporary tablespace.
    really how can i renew TEMP tablespace?
    thanks in advanced

    Well, the tablespace's offline. ok. Is it a TEMPORARY TABLESPACE or a PERMANENT with TEMPORARY option?
    Can you issue the queries:select tablespace_name,file_name from dba_temp_files where tablespace_name='TEMP';
    select tablespace_name,file_name from dba_data_files where tablespace_name='TEMP';to check this?
    OEM show the used space because it checks in some data dictionary views which still contains info about the TEMP tablespace.
    You should really try dropping the datafile/tempfile first via "ALTER DATABASE DATAFILE 'filename' OFFLINE DROP" before dropping the tablespace.
    You should also check the status of the session in which you drop the tablespace before cancelling. It may take some time to complete.

  • TEMP tablespace status

    You can see NO against TEMP tablespace. How con i bring TEMP tablespace in YES state.
    SQL> select * from v$tablespace;
           TS# NAME                  INC BIG FLA ENC
          0 SYSTEM                 YES NO  YES
          1 SYSAUX                 YES NO  YES
          2 UNDOTBS1            YES NO  YES
          4 USERS                 YES NO  YES
          6 EOBI                  YES NO  YES
          3 TEMP                  NO  NO  YES
    6 rows selected.Edited by: malhi on May 18, 2011 2:56 AM

    I was giving following command, which generate error below. Then i give select * from v$tablespace; and because of that NO, i was thinking that there is some relationship between error and NO. I am thank full for your help. Can you please help in rectifying error below.
    ALTER TABLESPACE TEMP ADD TEMPFILE '/home/oracle/oradata/data_D-TBDB_I-1592716922_TS-TEMP_FNO-1_06mckhmi'
         SIZE 20971520  AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;ERROR
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06553: PLS-801: internal error [56327]
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06553: PLS-801: internal error [56327]

  • How to create temp files in temp tablespace

    Dear all,
    Due to outage of our SAN, we our out of production for the
    last 3 days. By the grace of Almighty we have restored production by
    database recovery from our standby backup. Since temp tablespace and
    temp data files do not taken as backup for standby, now after recovery
    we are getting abap dumps asking for temp_1 and temp_2 datafiles.
    Please guide us how to create temp files. v$tablespace is showing tablespace PSAPTEMP but datafile are not there
    Abap dumps are giving these errors as mentioned below
    ====================================================
    The exception must either be prevented, caught within the procedure            
    "DATA_SELECTION"                                                              
    "(FORM)", or declared in the procedure's RAISING clause.                       
    To prevent the exception, note the following:                                  
    Database error text........: "ORA-01157: cannot identify/lock data file 256 -  
    see DBWR trace file#ORA-01110: data file 256:                                 
    '/oracle/SD1/sapdata4/temp_2/temp.data2'"                                     
    Internal call code.........: "[RSQL/FTCH/MARA ]"                               
    ===================================================
    another one asking for 
    '/oracle/SD1/sapdata3/temp_1/temp.data1'"
    Best Regards
    Waqas

    if you want to add a new tempfile to your TEMP Tablespace,you can do like that.
    <i>ALTER TABLESPACE</i> <<b><u>name of TEMP Tablespace</u></b>> ADD TEMPFILE <<b><u><b><u>pfad to the file_and_file name</u></b></u></b>> <b>SIZE</b> <size>;
    You can use also the options <i>REUS</i>E <i>autoextend off</i> or <i>on</i> .
    e.g:
    <i>alter tablespace</i> <u><b>PSAPTEMP</b></u> add <i>tempfile</i> <b><u>'/oracle/SD1/sapdata4/temp_2/temp.data2'</u></b> <i>SIZE 1000K</i> <i>REUSE</i>;
    The directory <b><u>temp_2</u></b> should exist.
    Or you can use the BR*Tools to create a new datafile. Enter brtools and follow the instructions or menu.
    More to TEMP Tablespaces see please following SAP notes:
    <u><b>659946</b></u> - FAQ: Temporary tablespaces
    <u><b>600513</b></u> - ORA-25153 after recovery due to missing tempfiles
    and the Oracle Note:
    <u><b>160426.1</b></u>: TEMPORARY Tablespaces : Tempfiles or Datafiles ?
    I hope it helps.

  • How to exclude UNDO and temp tablespace using monitoring template

    hi,
    as per MOS note id 816920.1 undo and temp tablespace is excluded from monitoring starting version 11G onwards.It says that thresholds will need to be explicitly set if undo and temp needs to be monitored
    we have grid 12C implemented now with monitoring templates which sets thresholds for all tablespaces. does it apply that thresholds to undo and temp too?? we are receiving alerts for undo and temp tablespaces and we wish to disable them. We have undo tablespaces with different names in many databases as per naming conventions for that line of business.
    How can i exclude undo and temp tablespaces from monitoring using grid 12C monitoring templates. is there a way through templates where i can set thresholds of permanent tablespaces only???

    In EM12c, go to the 'Enterprise' menu, then 'Job', then 'Library'. There should be an out-of-the-box job called "DISABLE TABLESPACE USED (%) ALERTS FOR UNDO AND TEMP TABLESPACES" that you can run against your database targets, and that job will disable database-generated alerts.
    If a previous admin has set up EM12c-generated alerts for undo and temp, then yes, a monitoring template will take care of disabling them. Either remove those alerts from the existing monitoring template and apply them to your targets, or create a new monitoring template based on one database's current settings, remove those warning/critical thresholds for your undo and temp tablespaces, and apply it to your targets.

  • How to monitor temp tablespace

    I server in 11gR2 and 10gR2.
    Is there a way to monitor its usage, like, who is using it, how much space a session is using, what are the objects crated, ie. temp tables.
    Thanks.

    Hi
    This might helpful
    select TABLESPACE_NAME, BYTES_USED, BYTES_FREE from V$TEMP_SPACE_HEADER;Also checkout the below link.
    http://blog.flimatech.com/2010/06/15/how-to-monitor-temp-tablespace-usage/
    Cheers
    Kanchana

  • How to add a datafile in the temp tablespace

    how i can add a datafile in the temp tablespace.
    becuase i am getting tyhe following error
    SQL> select aa.question_desc,a.answer_desc from answer a ,
    2 (select * from question_t where rownum <=100 order by dbms_random.random) aa
    3 where a.question_id = aa.question_id
    4 /
    select aa.question_desc,a.answer_desc from answer a ,
    ERROR at line 1:
    ORA-01652: unable to extend temp segment by 256 in tablespace TEMP

    select * from question_t where rownum <=100 order by dbms_random.random<br>After all the discussion about random select a random generated number... why don't you go for one of the suggestion like :<br>
    select *
    from (select * from question_t order by dbms_random.random)
    where rownum <=100 The result is different.<br>
    In your query, you take 100 rows and order randomly, in the second query, order randomly, and take 100 first rows...<br>
    As you can see above, with your last query, output row are always same, but in different order :<br>
    SCOTT@demo102> select ename from emp where rownum<=5 order by dbms_random.random;
    ENAME
    SMITH
    ALLEN
    MARTIN
    JONES
    WARD
    SCOTT@demo102> /
    ENAME
    MARTIN
    JONES
    SMITH
    ALLEN
    WARD
    SCOTT@demo102> /
    ENAME
    JONES
    ALLEN
    MARTIN
    SMITH
    WARD
    SCOTT@demo102> /
    ENAME
    ALLEN
    SMITH
    WARD
    MARTIN
    JONES
    SCOTT@demo102> <br>
    Anyway, I don't restart this discussion here.<br>
    For your actual problem, Pierre has already give you a suggestion.<br>
    <br>
    Nicolas.

  • How to identify temp tablespace user in the past

    hi,
    can anyone guide me on how to identify temp tablespace users and corresponding temp space amount they used in the past?
    we have this situation where in we need to identify the top temp tablespace user last jan 1 around a specific time.
    is this possible? do these get stored in one of the tables in the dictionary? any sql statement?
    thanks.

    900666 wrote:
    hi ckpt,
    thats unfortunate..=(
    anyways, any sql that can be used to capture current sessions with their used mb in temp tablespace? for future monitoring.
    thansk.Here is example
    SQL> SET LINESIZE 145
    SQL> SET PAGESIZE 9999
    SQL> SET VERIFY   off
    SQL>
    SQL> COLUMN tablespace_name       FORMAT a15               HEAD 'Tablespace Name'
    SQL> COLUMN username              FORMAT a15               HEAD 'Username'
    SQL> COLUMN sid                   FORMAT 99999             HEAD 'SID'
    SQL> COLUMN serial_id             FORMAT 99999999          HEAD 'Serial#'
    SQL> COLUMN contents              FORMAT a9                HEAD 'Contents'
    SQL> COLUMN extents               FORMAT 999,999           HEAD 'Extents'
    SQL> COLUMN blocks                FORMAT 999,999           HEAD 'Blocks'
    SQL> COLUMN bytes                 FORMAT 999,999,999       HEAD 'Bytes'
    SQL> COLUMN segtype               FORMAT a12               HEAD 'Segment Type'
    SQL>
    SQL> BREAK ON tablespace_name ON report
    COMPUTE SUM OF extents   ON report
    SQL> SQL> COMPUTE SUM OF blocks    ON report
    SQL> COMPUTE SUM OF bytes     ON report
    SQL>
    SQL>
    SQL> SELECT
      2      b.tablespace          tablespace_name
      3    , a.username            username
      4    , a.sid                 sid
      5    , a.serial#             serial_id
      6    , b.contents            contents
      7    , b.segtype             segtype
      8    , b.extents             extents
      , b.blocks              blocks
      9   10    , (b.blocks * c.value)  bytes
    FROM
    11   12      v$session     a
    13    , v$sort_usage  b
    14    , (select value from v$parameter
    15       where name = 'db_block_size') c
    16  WHERE
    17        a.saddr = b.session_addr
    18  /
    Tablespace Name Username           SID   Serial# Contents  Segment Type  Extents   Blocks        Bytes
    TEMP          SYSTEM            1333      4725 TEMPORARY LOB_DATA            1      128    1,048,576
                    SYSTEM            1562       444 TEMPORARY SORT               89   11,392   93,323,264
                    SYSADM            1602        80 TEMPORARY LOB_DATA            1      128    1,048,576
                    SYSTEM            1613     18693 TEMPORARY SORT               89   11,392   93,323,264
    sum                                                                          180   23,040  188,743,680
    SQL>

  • How to find the sessions/user consuming more temp tablespace

    Environment details
    IBM-AIX 64 bit
    Oracle 10.2.0.4.0
    Recently we encountered the issue of sudden peak in CPU utilization and temp tablespace usage. We are noticing this issue after Apr CPU 2009 patch and upgrade to 10.2.0.4.
    Recently temp space was full and we added 18 GB of space to temp tablespace, within few hours, they are also consumed.
    Application team is telling that they did not modify any code. ADDM report suggests most of the recommendations related to SQL tuning only
    not sure about the real issue. Can somebody tell me how I can find what are all sessions/user consuming high temp tablespace
    Edited by: user1368801 on Sep 1, 2009 5:32 PM

    Hi,
    Run below query to check if it is used by any session.
    select sum(a.BYTES_USED)/1024/1024 used_mb, sum(b.bytes)/1024/1024 total_mb,
    sum(a.BYTES_USED)/sum(b.bytes)*100 pct_used
    from V$TEMP_EXTENT_POOL a, v$tempfile b
    where a.file_id(+) = b.file#
    Check who is using it by the below query.
    SELECT s.sid,s.serial#,osuser,process,program,s.sql_hash_value,u.extents, u.blocks
    FROM v\$session s, v\$sort_usage u
    WHERE s.saddr = u.session_addr order by extents,blocks desc
    Hope this solves your issue.
    Regards
    Regards,
    Satishbabu Gunukula
    Click here to improve RMAN backup Performance using [Block change tracking in Oracle 10g|http://oracleracexpert.blogspot.com/2009/09/block-change-tracking-in-oracle-10g.html]
    http://oracleracexpert.blogspot.com

  • 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

  • Query using large(in GB) temp tablespace, how to tune it?

    Hi,
    Below query is using large Temp tablespace, please guide for tuning this query so that it can use minimal temp space.
    SELECT DISTINCT cust_alt.cust_acct_alt_id, cust_alt.cust_acct_alt_id_type_cd,
                    trans.legal_entity_id, trans.exchange_id,
                    trans.stamp_update_dtime, trans.book_alt_id,
                    trans_alt.trans_alt_id, trans_alt.trans_alt_vers_id,
                    trans_alt.src_sys_short_name, event.trans_event_sequence_id,
                    event.trans_event_type_cd, prod_alt.product_alt_id,
                    prod_alt.product_alt_id_type_cd, trans.buy_sell_cd,
                    trans.trade_date, item.setlmt_date, item.trans_price_amt,
                    item.price_yield_ind, item.trans_dirty_price_amt,
                    item.trans_qty, item.trans_item_type_cd,
                    event.trans_event_dtime,
                    DECODE (extnn.confirm_generation_elig_ind,
                            'Y', 'In Progress',
                            NULL, 'Not Processed',
                            'Confirm Ineligible'
                           ) confirm_status,
                    event_ref.trans_event_type_desc
               FROM ods_trans_event_type_ref event_ref,
                    ods_trans_type_ref trans_type,
                    ods_cust_acct_alt_id cust_alt,
                    ods_product_alt_id prod_alt,
                    ods_trans_item item,
                    ods_trans_alt_id trans_alt,
                    ods_trans trans,
                    ods_trans_extnn extnn,
                    ods_trans_event event
              WHERE event_ref.trans_event_type_cd = event.trans_event_type_cd
                AND trans_type.trans_type_id = trans.trans_type_id
                AND prod_alt.product_id = trans.product_id
                AND cust_alt.cust_acct_id = trans.cust_acct_id
                AND item.trans_vers_id = trans.trans_vers_id
                AND item.trans_id = trans.trans_id
                AND extnn.trans_vers_id(+) = trans.trans_vers_id
                AND extnn.trans_id(+) = trans.trans_id
                AND trans_alt.trans_link_reason_cd = 'FOID'
                AND trans_alt.trans_vers_id = trans.trans_vers_id
                AND trans_alt.trans_id = trans.trans_id
                AND trans.trans_vers_id = event.trans_vers_id
                AND trans.trans_id = event.trans_id
                AND item.trans_item_type_cd IN ('MAIN', '1', '2')
                AND cust_alt.cust_acct_alt_id != 'BOOKTOBOOK'
             order by trans_alt.trans_alt_id, event.trans_event_sequence_idThe Explain for this query is
    | Id  | Operation                                      | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                          |                             |    79 | 23384 |  1404   (1)| 00:00:17 |
    |   1 |  HASH UNIQUE                                   |                             |    79 | 23384 |  1404   (1)| 00:00:17 |
    |*  2 |   TABLE ACCESS BY INDEX ROWID        | ODS_TRANS_ITEM       |     1 |    53 |     4   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS                                |                             |    79 | 23384 |  1403   (1)| 00:00:17 |
    |   4 |     NESTED LOOPS OUTER                    |                             |    73 | 17739 |  1144   (1)| 00:00:14 |
    |   5 |      NESTED LOOPS                              |                             |    73 | 16717 |   965   (0)| 00:00:12 |
    |   6 |       NESTED LOOPS                             |                             |    73 | 15476 |   819   (0)| 00:00:10 |
    |   7 |        NESTED LOOPS                            |                             |    73 | 14089 |   673   (0)| 00:00:09 |
    |   8 |         NESTED LOOPS                           |                             |    73 | 10439 |   672   (0)| 00:00:09 |
    |   9 |          NESTED LOOPS                          |                             |    90 |  9810 |   312   (0)| 00:00:04 |
    |* 10 |           TABLE ACCESS BY INDEX ROWID| ODS_TRANS_ALT_ID            |    92 |  3680 |    52   (0)| 00:00:01 |
    |* 11 |            INDEX RANGE SCAN               | ODS_TRANS_ALT_ID_X1         |   119 |       |     5   (0)| 00:00:01 |
    |  12 |           TABLE ACCESS BY INDEX ROWID| ODS_TRANS                   |     1 |    69 |     3   (0)| 00:00:01 |
    |* 13 |            INDEX UNIQUE SCAN              | ODS_TRANS_PK                |     1 |       |     2   (0)| 00:00:01 |
    |  14 |          TABLE ACCESS BY INDEX ROWID | ODS_TRANS_EVENT             |     1 |    34 |     4   (0)| 00:00:01 |
    |* 15 |           INDEX RANGE SCAN                | ODS_TRANS_EVENT_PK          |     1 |       |     3   (0)| 00:00:01 |
    |  16 |         TABLE ACCESS BY INDEX ROWID  | ODS_TRANS_EVENT_TYPE_REF    |     1 |    50 |     1   (0)| 00:00:01 |
    |* 17 |          INDEX UNIQUE SCAN                | ODS_TRANS_EVENT_TYPE_REF_PK |     1 |       |     0   (0)| 00:00:01 |
    |  18 |        TABLE ACCESS BY INDEX ROWID   | ODS_PRODUCT_ALT_ID          |     1 |    19 |     2   (0)| 00:00:01 |
    |* 19 |         INDEX RANGE SCAN                  | ODS_PRODUCT_ALT_ID_PK       |     1 |       |     1   (0)| 00:00:01 |
    |* 20 |       TABLE ACCESS BY INDEX ROWID    | ODS_CUST_ACCT_ALT_ID        |     1 |    17 |     2   (0)| 00:00:01 |
    |* 21 |        INDEX RANGE SCAN                   | ODS_CUST_ACCT_ALT_ID_PK     |     1 |       |     1   (0)| 00:00:01 |
    |  22 |      TABLE ACCESS BY INDEX ROWID     | ODS_TRANS_EXTNN             |     1 |    14 |     3   (0)| 00:00:01 |
    |* 23 |       INDEX UNIQUE SCAN                   | SYS_C0026927                |     1 |       |     2   (0)| 00:00:01 |
    |* 24 |     INDEX RANGE SCAN                      | ODS_TRANS_ITEM_PK           |     1 |       |     3   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------------------------Cant avoid the order by and distinct clauses. Cant avoid Outer joins. Indexes are used properly.

    Just to add on to Mark's excellent points--
    1) The Oracle optimizer is estimating that your query is only going to return 79 rows. If it is using a great deal of TEMP space, that estimate would seem to be wildly incorrect which implies that you have a problem with your statistics.
    2) Are you certain that you need the DISTINCT? Lots of people either throw DISTINCT clauses into their queries "just in case" or throw in a distinct when they are unexpectedly getting duplicate rows because they are missing a join condition. If that's the case here, removing the DISTINCT and figuring out which join condition is missing (if applicable) would cause much less TEMP space to be used.
    Justin

  • Oracle 9i TEMP tablespace backup problem using RMAN!

    Oracle8/8i whole backup is ok for our backup software(using RMAN without RC database), but for Oracle 9i, I get following error messages when backing up temp tablespace.
    1. RMAN-20202: tablespace not found in the recovery catalog
    2. RMAN-06019: could not translate tablespace name "TEMP"
    I check some views of Oracle9i, and know some changes happen for temp tablespace in 9i, but how to deal with this problem. Any idea, please!

    In 9i RMAN does not restore temporary datafiles. Instead, you should create them after your restore. I believe that Oracle is going to make a change to this in the next release of 9i and have RMAN create the temporary files. You can view the temporary datafiles @ v$tempfile.
    I believe RMAN doesn't restore temporary files because they are locally managed and not in the control files. RMAN reads the controlfile of the target database to obtain info about backups, datafiles, etc.
    Hope this helps.

  • 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 컬럼이 안들어가서
    수정하였습니다. 죄송합니다.

  • How to delete empty pages in in-design document?

    Hi All,
           How to delete empty page which may contains text frame with no contents, or may be no text frame...
    Plz provide me the script...
    Thanks in advance,
    Vel....

    Indesign CS5.
    My script is,
    doc=app.activeDocument;
    pageObj=doc.pages.item(0);
    txtObj=pageObj.textFrames.item(0);
    var temp=doc.pages.length;
    for(var i=0;i<temp;i++)
        if(doc.pages[i].textFrames.item(0)!=null)
                if(doc.pages[i].textFrames[0].contents!=null) // here, i used "contents" instead of "lines". but also not working well...
                    alert(doc.pages[i].textFrames[0].contents);
                    alert("True");
                else
                    doc.pages[i].remove();
                    i=i-1;
                    temp--;
        else
          alert("False");
          doc.pages[i].remove();
          i=i-1;
          temp--;
    I've a sample document which contains a empty page without a text frame and another empty page with text frame with no contents on it... but my script remove only the empty page and not the empty page with txt frame...
    pLZ HELP JONGWARE...

Maybe you are looking for

  • Iphone 5S HD Voice

    Does the 5S support HD Voice Calls ?

  • IPhone not removing played podcasts during sync(using the unplayed feature)

    Hi folks, I listen to a lot of podcasts. When I used an iPod the sync unplayed option. Once I listened to a podcast it was removed (saving space for more podcasts). With my iPhone I've got the options set up correctly (i.e. set at Sync Unplayed) but

  • How do I change the name of my network?

    Hi, I know this has been answered before, but I get to a certain point and am stuck. I click on the airport, go to wireless, put in the new name, then I get this message:  This AirPort base station is set up to allow SNMP on the Ethernet WAN port, wh

  • How to monitor the size of message payload processed

    Hi all, where could i find the size of the message payload processed in monitor? i want to check the volumn of the payload, such as how much kb thanks in advance

  • Ipod to itunes music transfer... possible?

    I want to move music from my ipod, to my new computer, a powerbook. I dont want to liise the 1100 songs on my ipod, but i dont want to hook up my ipod to the computer whenever i want music... i know i could do it on my old computer, a dell... and i t