Temporary Tablespace and transactions

Hi.
I have a query regarding temp tablespace ,
I am on 10gR2 version. with ONE TEMP tablespace and having one tempfiles.
temp Tablespace TEMP1 = temp01.dbf (1 GB)
+ Let say I have executed a query-1 from Scott user , its runs for 30 min and let assume its consumed 900MB of tempspace during its completion .
+ And another query -2 from scott or another user fired ( let say Query 1 started earlier than Query 2 ) . and it needs around 500MB of tempspace
== MY Question is
Q .1 ) Will the Second Query waits until Query 1 completion ? As we have only one Temp file over here . IF both started executing both Queries will hit unable o extend temp space error .
- Please provide your inputs and corrections.
-Thanks.

TEMP Tablespace size : 1GB NO AutoExtend
First Query uses 900MB
Second Query starts using space and will eventually need 500MB space
Both queries will concurrently be allowed to use Temp Space
If the first query completes before the second query usage hits 100MB, it will release all 900MB for usage by the second query.
If the first query hasn't completed and is at 900MB, the second query will error out when it attempts to go beyond 100MB.
If the first query needs more than 900MB and the second query has used 100MB -- i.e. both are growing in usage -- any one of the two queries wil fail.
NOTE : If Resumable Space Allocation has been enabled either by setting RESUMABLE_TIMEOUT or by ALTER SESSION ENABLE RESUMABLE, the queries will not fail if the TEMP Tablespace is resized within the timeout period. Else, beyond the timeout, either of the queries will fail.
Hemant K Chitale
Edited by: Hemant K Chitale on Feb 13, 2013 4:17 PM
Added Note on Resumable Space Allocation

Similar Messages

  • Temporary tablespace and alert log

    If a temporary tablespace is actually filled and users get error when they are running some query, will it be updated in the alert log?
    Thanks

    It is ora-01652, and will be written to alert,
    Thanks

  • Swap, temporary tablespace and sort operations

    Hello.
    I have an Oracle 8.1.7 on Linux RH7.1. I see a very interesting situation: when users begin to execute large selects with many sorts operation swapping grows, but temporary tablespace does'nt grow. As I know, when Oracle has no memory to use as "sort_area_size" it uses temporary tablespace. But looks like that when Oracle ask for memory Linux begin to swap (in order to give memory for Oracle). I mean that Oracle don't use temporary tablespace but use swap instead of it. Is it true? Is it problem? Is it Oracle, Linux or my own configuration bug? Is it better to use swap or to use temporary tablespace? What is faster?
    Thanx for all advises and ideas. ANd sorry for pure English

    login to your database as DBA (SYS AS SYSDBA) and issue the following query:
    SQL> select name, value from v$parameter where name = 'sga_max_size' ;
    see the value defined for this parameter. If this is larger than what you have configured as your SGA size,
    Oracle will assume that it can expand the SGA to "sga_max_size" value, and will try to expand the SGA when
    required. This will result in Oracle asking more memory from the linux kernel and then linux starts to use
    the swap space.
    Try changing the value of this parameter and see if it helps.

  • Temporary tablespace and tempfile

    Hi,
    On one of our database, we have a temporary tablespace which is locally managed.
    This tablespace has 3 tempfiles.
    One query, which generate large sort, cause an Oracle error ORA-01652.
    But, when we see the date of tempfiles, it seems that there is only one tempfile which is use :
    rw-rw-rw-   1 iov816   fraud    31465472 Jun  6 18:10 temp2riskv5r.dbf
    -rw-rw-rw-   1 iov816   fraud    20979712 Jun  6 18:14 temp3riskv5r.dbf
    -rw-rw-rw-   1 riskv5r  fraud    152047616 Jun  8 14:47 tempriskv5r.dbf What happens exactly ? This database is a 8.1.6.0.
    Thanks for any explanations.
    Nicolas.

    When using OMF you do not not specify the file names. ASM does not really change the syntax any.
    SQL> create tablespace test_me
      2  datafile size 10m,
      3           size 10m
      4  extent management local uniform size 1m;
    Tablespace created.
    SQL> select file_name from dba_data_files where tablespace_name = 'TEST_ME';
    FILE_NAME
    +TESTDB/sandbox/datafile/test_me.1101.615385691
    +TESTDB/sandbox/datafile/test_me.1097.615385693
    SQL>

  • Can i change the temporary tablespace for schemas during the transactions??

    In My Prod database some of the tablespaces assigned system as Temporary tablespace. I want to change the temporary tablespace for these schemas and the default temporary tablespace of the database.
    Can I make this change while the users are accessing the database. Is there any impact If i make this change while the transactions are running.
    Below is the change i want to do........
    1. Change the users for SYSTEM to TEMP in the temporary tablespace by executing the following SQL
    statements:
    alter user SYSTEM temporary tablespace TEMP;
    alter user SYS temporary tablespace TEMP;
    alter user AD_MONITOR temporary tablespace TEMP;
    alter use SI_INFORMTN_SCHEMA temporary tablespace TEMP;
    alter user EM_MONITOR temporary tablespace TEMP;
    alter user ORDPLUGINS temporary tablespace TEMP;
    alter user TSMSYS temporary tablespace TEMP;
    alter user XDB     temporary tablespace TEMP;
    alter user SCOTT temporary tablespace TEMP;
    alter user DBSNMP temporary tablespace TEMP;
    alter user DIP     temporary tablespace TEMP;
    alter user OUTLN temporary tablespace TEMP;
    alter user ANONYMOUS temporary tablespace TEMP;
    alter user ORDSYS temporary tablespace TEMP;
    alter user MDDATA temporary tablespace TEMP;
    2. Set the default temporary tablespace to TEMP by executing the following SQL statement:
    alter DATABASE default temporary tablespace TEMP;

    user11829256 wrote:
    But if one transaction is using the old temporary tablespace and if i change the temporary tablespace of user will that transactions of that user fails which is using the old temp segment....It will continue to use the old one till the end of transaction.
    Here a quick test (hopefully readable) :
    -- session 1 as a dba user
    SQL> grant create session to nga identified by nga;
    Grant succeeded.
    SQL> alter user nga temporary tablespace tmp;
    User altered.
    SQL> select temporary_tablespace from dba_users where username='NGA';
    TEMPORARY_TABLESPACE
    TMP
    -- session 2 as NGA
    SQL> insert into gtt
      2  select * from (select * from all_objects union all select * from all_objects union all select * from all_objects);
    80559 rows created.
    -- session 1 as a dba user
    SQL> select tablespace from v$tempseg_usage where username='NGA';
    TABLESPACE
    TMP
    SQL> alter user nga temporary tablespace pstemp;
    User altered.
    SQL> select tablespace from v$tempseg_usage where username='NGA';
    TABLESPACE
    TMP
    SQL> select temporary_tablespace from dba_users where username='NGA';
    TEMPORARY_TABLESPACE
    PSTEMP
    -- session 2 as NGA
    80559 rows created.
    SQL> roll;
    Rollback complete.
    -- session 1 as a dba user
    SQL> select tablespace from v$tempseg_usage where username='NGA';
    no rows selected
    -- session 2 as NGA
    SQL> insert into gtt
      2  select * from (select * from all_objects union all select * from all_objects union all select * from all_objects);
    80559 rows created.
    -- session 1 as a dba user
    SQL> select tablespace from v$tempseg_usage where username='NGA';
    TABLESPACE
    PSTEMPNicolas.

  • Temporary Tablespace Sizing and SNOTE 164925

    Hi All,
    I am facing a dilemma when I look into the temporary tablespace setting.
    I have gone thru the SNOTE 164925, for the sizing parameters of PSAPTEMP.
    There is a calculation on the note for selecting initial extent next extent etc.....
    My PSAPTEMP is locally managed and having default initial extent value of 1 MB but as per the calculation given on SNOTE 164925 solution section.
    But the point is in the How Can I check the specified value section on the same note it says....
    "As of Oracle 8i, SAP recommends using the assignment of locally managed
    temporary tablespaces (see Notes 659946 and 662900). This means that when
    problems with a 'dictionary managed' temporary tablespace occur, you should
    change to a 'locally managed' temporary tablespace instead of optimizing
    the settings of the 'dictionary managed' temporary tablespace."
    Now my question is whther I should still go with the default value or with the new values as per the formula given in the same note.
    I am using Oracle 10g behind SAPR3 4.6D
    Regards,
    Soumen

    Hello Soumen,
    to be honest - i don't really understand your question / problem.
    Just use locally managed temporary tablespace and set an uniform size.
    The values initial, next and pctincrease doesn't matter in this case. Set the uniform size to 1 - 5 MB.
    As you told us you are using oracle 10g .. just check the documenation:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7003.htm#CJAIDDDB
    Specify LOCAL if you want the tablespace to be locally managed. Locally managed tablespaces have some part of the tablespace set aside for a bitmap. This is the default for permanent tablespaces. Temporary tablespaces are always automatically created with locally managed extents.
    AUTOALLOCATE specifies that the tablespace is system managed. Users cannot specify an extent size. You cannot specify AUTOALLOCATE for a temporary tablespace.
    UNIFORM specifies that the tablespace is managed with uniform extents of SIZE bytes.The default SIZE is 1 megabyte. All extents of temporary tablespaces are of uniform size, so this keyword is optional for a temporary tablespace. However, you must specify UNIFORM in order to specify SIZE. You cannot specify UNIFORM for an undo tablespace.
    Restriction on Dictionary-managed Tablespaces
    You cannot specify DICTIONARY if the SYSTEM tablespace of the database is locally managed or if you have specified the temporary_tablespace_clause.
    Regards
    Stefan

  • Parallel execution and temporary tablespaces

    I have a large long running (1 hour) data warehouse query in a materialized view.
    If I parallelize it using the parallel hint then I run out of temporary tablespace.
    I've tried creating a bunch of temporary tablespaces and putting them into a temp tablespace group but it still runs out of space. Parallel execution seems to use up way more temp tablespace than sequential execution.
    I know it is a very general question, but what are the tips for parallelizing a long running query with respect to temporary tablespace management?
    I've tried searching on the interwebs but I don't find anything that addresses this particular issue.

    And here is the parallel explain plan:
    PLAN_TABLE_OUTPUT
    Plan hash value: 1293981491
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 81M| 17G| | 19232 (2)| 00:00:01 | | | |
    | 1 | TABLE ACCESS BY INDEX ROWID | MART$SC_SCORES | 1 | 13 | | 3 (0)| 00:00:01 | | | |
    |* 2 | INDEX UNIQUE SCAN | SSCS_SDCC_FK_I | 1 | | | 2 (0)| 00:00:01 | | | |
    | 3 | PX COORDINATOR | | | | | | | | | |
    | 4 | PX SEND QC (RANDOM) | :TQ10017 | 81M| 17G| | 19232 (2)| 00:00:01 | Q1,17 | P->S | QC (RAND) |
    |* 5 | HASH JOIN RIGHT OUTER BUFFERED | | 81M| 17G| | 19232 (2)| 00:00:01 | Q1,17 | PCWP | |
    | 6 | PX RECEIVE | | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,17 | PCWP | |
    | 7 | PX SEND BROADCAST | :TQ10014 | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,14 | P->P | BROADCAST |
    | 8 | PX BLOCK ITERATOR | | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,14 | PCWC | |
    | 9 | INDEX FAST FULL SCAN | I_DWH_ZIP_ZIPCODE_EIDIID | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,14 | PCWP | |
    |* 10 | HASH JOIN | | 81M| 16G| | 19218 (2)| 00:00:01 | Q1,17 | PCWP | |
    | 11 | JOIN FILTER CREATE | :BF0000 | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,17 | PCWP | |
    | 12 | PX RECEIVE | | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,17 | PCWP | |
    | 13 | PX SEND HASH | :TQ10015 | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,15 | P->P | HASH |
    | 14 | PX BLOCK ITERATOR | | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,15 | PCWC | |
    |* 15 | INDEX FAST FULL SCAN | I_DWH_ADDRESS_COMB_ZIP | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,15 | PCWP | |
    | 16 | PX RECEIVE | | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,17 | PCWP | |
    | 17 | PX SEND HASH | :TQ10016 | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,16 | P->P | HASH |
    | 18 | JOIN FILTER USE | :BF0000 | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,16 | PCWP | |
    |* 19 | HASH JOIN RIGHT OUTER BUFFERED | | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,16 | PCWP | |
    | 20 | PX RECEIVE | | 42M| 409M| | 827 (2)| 00:00:01 | Q1,16 | PCWP | |
    | 21 | PX SEND HASH | :TQ10012 | 42M| 409M| | 827 (2)| 00:00:01 | Q1,12 | P->P | HASH |
    | 22 | PX BLOCK ITERATOR | | 42M| 409M| | 827 (2)| 00:00:01 | Q1,12 | PCWC | |
    | 23 | MAT_VIEW ACCESS FULL | MBI$CMN_ACTION_COST | 42M| 409M| | 827 (2)| 00:00:01 | Q1,12 | PCWP | |
    | 24 | PX RECEIVE | | 80M| 14G| | 17549 (1)| 00:00:01 | Q1,16 | PCWP | |
    | 25 | PX SEND HASH | :TQ10013 | 80M| 14G| | 17549 (1)| 00:00:01 | Q1,13 | P->P | HASH |
    |* 26 | HASH JOIN BUFFERED | | 80M| 14G| | 17549 (1)| 00:00:01 | Q1,13 | PCWP | |
    | 27 | PX RECEIVE | | 6312K| 794M| | 7519 (1)| 00:00:01 | Q1,13 | PCWP | |
    | 28 | PX SEND HASH | :TQ10010 | 6312K| 794M| | 7519 (1)| 00:00:01 | Q1,10 | P->P | HASH |
    |* 29 | HASH JOIN RIGHT OUTER BUFFERED | | 6312K| 794M| | 7519 (1)| 00:00:01 | Q1,10 | PCWP | |
    | 30 | VIEW | | 4443K| 80M| | 2125 (2)| 00:00:01 | Q1,10 | PCWP | |
    | 31 | HASH GROUP BY | | 4443K| 33M| 158M| 2125 (2)| 00:00:01 | Q1,10 | PCWP | |
    | 32 | PX RECEIVE | | 10M| 78M| | 950 (1)| 00:00:01 | Q1,10 | PCWP | |
    | 33 | PX SEND HASH | :TQ10007 | 10M| 78M| | 950 (1)| 00:00:01 | Q1,07 | P->P | HASH |
    | 34 | PX BLOCK ITERATOR | | 10M| 78M| | 950 (1)| 00:00:01 | Q1,07 | PCWC | |
    | 35 | TABLE ACCESS FULL | DWH$PHONE | 10M| 78M| | 950 (1)| 00:00:01 | Q1,07 | PCWP | |
    |* 36 | HASH JOIN | | 6312K| 680M| | 5392 (1)| 00:00:01 | Q1,10 | PCWP | |
    | 37 | PX RECEIVE | | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,10 | PCWP | |
    | 38 | PX SEND HASH | :TQ10008 | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,08 | P->P | HASH |
    | 39 | PX BLOCK ITERATOR | | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,08 | PCWC | |
    | 40 | INDEX FAST FULL SCAN | PK_DWH_DEBTOR | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,08 | PCWP | |
    | 41 | PX RECEIVE | | 6312K| 644M| | 5259 (1)| 00:00:01 | Q1,10 | PCWP | |
    | 42 | PX SEND HASH | :TQ10009 | 6312K| 644M| | 5259 (1)| 00:00:01 | Q1,09 | P->P | HASH |
    |* 43 | HASH JOIN RIGHT OUTER BUFFERED| | 6312K| 644M| | 5259 (1)| 00:00:01 | Q1,09 | PCWP | |
    | 44 | PX RECEIVE | | 3689K| 31M| | 4271 (1)| 00:00:01 | Q1,09 | PCWP | |
    | 45 | PX SEND HASH | :TQ10005 | 3689K| 31M| | 4271 (1)| 00:00:01 | Q1,05 | P->P | HASH |
    | 46 | VIEW | | 3689K| 31M| | 4271 (1)| 00:00:01 | Q1,05 | PCWP | |
    | 47 | HASH GROUP BY | | 3689K| 56M| 84M| 4271 (1)| 00:00:01 | Q1,05 | PCWP | |
    | 48 | PX RECEIVE | | 3689K| 56M| | 3653 (1)| 00:00:01 | Q1,05 | PCWP | |
    | 49 | PX SEND HASH | :TQ10003 | 3689K| 56M| | 3653 (1)| 00:00:01 | Q1,03 | P->P | HASH |
    |* 50 | HASH JOIN | | 3689K| 56M| | 3653 (1)| 00:00:01 | Q1,03 | PCWP | |
    | 51 | BUFFER SORT | | | | | | | Q1,03 | PCWC | |
    | 52 | PX RECEIVE | | 3 | 21 | | 1 (0)| 00:00:01 | Q1,03 | PCWP | |
    | 53 | PX SEND BROADCAST | :TQ10000 | 3 | 21 | | 1 (0)| 00:00:01 | | S->P | BROADCAST |
    | 54 | INLIST ITERATOR | | | | | | | | | |
    |* 55 | INDEX RANGE SCAN | I_DWH_PAYMENT_TYPE_EIDIID | 3 | 21 | | 1 (0)| 00:00:01 | | | |
    | 56 | PX BLOCK ITERATOR | | 28M| 242M| | 3648 (1)| 00:00:01 | Q1,03 | PCWC | |
    |* 57 | TABLE ACCESS FULL | DWH$PAYMENT | 28M| 242M| | 3648 (1)| 00:00:01 | Q1,03 | PCWP | |
    | 58 | PX RECEIVE | | 6312K| 589M| | 986 (2)| 00:00:01 | Q1,09 | PCWP | |
    | 59 | PX SEND HASH | :TQ10006 | 6312K| 589M| | 986 (2)| 00:00:01 | Q1,06 | P->P | HASH |
    |* 60 | HASH JOIN | | 6312K| 589M| | 986 (2)| 00:00:01 | Q1,06 | PCWP | |
    | 61 | PX RECEIVE | | 2937 | 172K| | 5 (20)| 00:00:01 | Q1,06 | PCWP | |
    | 62 | PX SEND BROADCAST | :TQ10004 | 2937 | 172K| | 5 (20)| 00:00:01 | Q1,04 | P->P | BROADCAST |
    |* 63 | HASH JOIN BUFFERED | | 2937 | 172K| | 5 (20)| 00:00:01 | Q1,04 | PCWP | |
    | 64 | PX RECEIVE | | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,04 | PCWP | |
    | 65 | PX SEND HASH | :TQ10001 | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,01 | P->P | HASH |
    | 66 | PX BLOCK ITERATOR | | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,01 | PCWC | |
    | 67 | TABLE ACCESS FULL | DWH$MANDATOR | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,01 | PCWP | |
    | 68 | PX RECEIVE | | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,04 | PCWP | |
    | 69 | PX SEND HASH | :TQ10002 | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,02 | P->P | HASH |
    | 70 | PX BLOCK ITERATOR | | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,02 | PCWC | |
    | 71 | TABLE ACCESS FULL | DWH$PACKAGE | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,02 | PCWP | |
    | 72 | PX BLOCK ITERATOR | | 6312K| 228M| | 980 (1)| 00:00:01 | Q1,06 | PCWC | |
    | 73 | TABLE ACCESS FULL | DWH$CASE | 6312K| 228M| | 980 (1)| 00:00:01 | Q1,06 | PCWP | |
    | 74 | PX RECEIVE | | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,13 | PCWP | |
    | 75 | PX SEND HASH | :TQ10011 | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,11 | P->P | HASH |
    | 76 | PX BLOCK ITERATOR | | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,11 | PCWC | |
    |* 77 | TABLE ACCESS FULL | DWH$ACTION | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,11 | PCWP | |
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • Online material for tablespace and backup

    Hi All,
    As i am a beginner, can anyone please suggest me any online link for better understanding about tablespace and backup for a beginner.
    Thanks in advance
    Arun

    Hi, follow down a resume did for me in my blog:
    Creating Tablespaces Permanent, Temporary and UNDO in ORACLE
    Tablespace Datafiles is a set that contains the physical structure of the data storage system Operacional.Sendo thus tablespace is an allocation of space used to store objects of a given user. To create a tablespace in a database, the user will have to have the grant (permission) of Tablespace and Create to create the SYSAUX tablespace (beside SYSTEM, are the most important database), should have the grant of SYSDBA. A tablespace is a logical unit of database and that is part of the following structure:
    Database> Tablespace (logical drive)> Datafile (physical file)> Segments (logical drive Example: Tables)> Extents (set of blocks, logical drives) >> Blocks Bank Data (logical unit, a smaller structure database)> Blocks Operating System.
    In this article we will be focused on the following types of tablespaces : The permanent tablespaces, the tablespace temporary tablespace and Undo. However, it also will be elucidated creating tablespace with multiple datafiles at once.
    - Permanent Tablespaces: Contains a user objects in a database. These objects are stored in physical structures called Datafiles.
    SQL> create tablespace TBSEXEBRUNORS
    logging
    datafile '/ dbbruno/datafiles/datafile1.dbf'
    size 64m
    autoextend on
    next 64m maxsize 2048m
    Local extent management uniform size 1m; 2 3 4 5 6 7
    Tablespace created.
    Creating a Tablespace with multiple Datafiles at once:
    SQL> create tablespace TBSMISCBRUNORS
    datafile '/ dbbruno/datafiles/datafile2.dbf' size 4M
    '/ Dbbruno/datafiles/datafile3.dbf' size 4M
    '/ Dbbruno/datafiles/datafile4.dbf' size 4M
    logging
    extent management site; 2 3 4 5 6
    Tablespace created.
    It follows a consultation in view DBA_TABLESPACES:
    SQL> SET PAGESIZE 180
    SQL> SET linesize 180
    SQL> SELECT * FROM WHERE DBA_TABLESPACES tablespace_name = 'TBSEXEMPLO' order by 1,2;
    Tablespace_name BLOCK_SIZE INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS MAX_SIZE PCT_INCREASE MIN_EXTLEN STATUS CONTENTS LOGGING FOR EXTENT_MAN
    ALLOCATIO PLU segments DEF_TAB_ RETENTION BIG PREDICA ENC COMPRESS_FOR
    TBSEXEMPLO 8192 65536 1 2147483645 2147483645 65536 ONLINE PERMANENT LOGGING NO LOCAL
    NO SYSTEM AUTO DISABLED NOT APPLY IN THE HOST
    - Clause for managing EXTENTS
    The autoallocate clause specifies that the tablespace is managed by ORACLE , and that users can not specify sizes. Moreover, this clause is not allowed to UNDO tablespaces or Temporary. However, the clause UNIFORM specifies that the tablespace is managed by a user (you can specify sizes) via byte sizes, the default 1M (megabyte) to use this clause. Already the LOCAL clause specifies that the tablespace is locally managed and some part of the tablespace is reserved for Bitmap, which is the DEFAULT option for the type of permanent tablespace. But the DICTIONARY clause specifies that you want the tablespace is managed using the data dictionary.
    - Management of SEGMENTS clause
    The AUTO clause specifies that you want the ORACLE control the free space of segments in the tablespace using BITMAPS. When making use of this option, ORACLE ignores any storage specification later this tablespace. ORACLE strongly recommends using this option. However, this option should only be used in permanent and never tablespaces in a tablespace SYSTEM. However, the clause MANUAL option is not recommended by Oracle, specifies that you want the ORACLE control the free space of segments in the tablespace using freelists (PCTUSED, FREELIST, FREELIST GROUPS).
    - Temporary Tablespaces: Contains temporary data for a given session for a given period of time. Furthermore, this type of tablespace tempfiles and have no, Datafiles. This tablespace is used when a user, to which was assigned temporary tablespace, begins operations. Thus, the tablespace temporary stores temporary data used in transactions of users.
    SQL> create temporary tablespace TEMPEXEBRUNORS
    tempfile '/ dbbruno/datafiles/tempfile1.dbf'
    size 128m
    autoextend on
    next 32m maxsize 2048m
    extent management site; 2 3 4 5 6
    Tablespace created.
    - UNDO Tablespaces or Tablespaces Undo: Tablespace used for operations redone, so that objects can not be created in this tablespace. When this tablespace is created, the ORACLE tablespace SYSTEM takes for you to make such operations. However, the default is to always create an UNDO tablespace when creating the database, so that it is in the mode of automatic undo management.
    SQL> create undo tablespace TBSUNDOBRUNORS
    datafile '/ dbbruno/datafiles/tbs_datafileundobrunors_1.dbf "
    size 200M; 2 3
    Tablespace created.
    It follows a consultation in view DBA_TABLESPACES:
    SQL> SET PAGESIZE 180
    SET linesize 180
    SELECT tablespace_name, STATUS, RETENTION, SEGMENT_SPACE_MANAGEMENT, EXTENT_MANAGEMENT, INITIAL_EXTENT DBA_TABLESPACES FROM WHERE tablespace_name = 'TBSUNDOBRUNORS' order by 1,2; SQL> SQL>
    STATUS tablespace_name RETENTION segments EXTENT_MAN INITIAL_EXTENT
    TBSUNDOBRUNORS NOGUARANTEE MANUAL ONLINE LOCAL 65,536
    - Clause for retaining segments
    The RETENTION GUARANTEE clause specifies that the data store should ORACLE undo expired, even though current operations return fails due to lack of space. This option can be useful in operations FLASHBACK (which is a "flashback" to obtain, for example, the value from a table that was deleted and it is necessary to know the value of that in a certain period). However, the provision RETENTION NOGUARANTEE (as above) specifies that the ORACLE data undo may replace expired undo by new data being processed due to the operations in the current environment, this being the provision pattern.
    I hope I helped, hugs!!
    References:
    http://brunors.com/?p=208

  • How do i know if my query using  SORT_AREA_SIZE   or temporary tablespace ?

    Good Morning  Everyone !
    My DB version is 10.2.0.1
    I have large table  exactly 3 million records.
    SQL> select count(*) from tab1;
    COUNT(*)
       300000
    SQL> select * from tab1 order by no DESC;
    sorting  ... in process
    300000 rows selected.
    in Terminal 2 : I tried to find  sorting details -   ( No rows  selected - why ? )
    SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage  ;
    no rows selected
    SQL> /
    no rows selected
    When i google i have seen this ;
    If  Oracle cannot do the sort in memory  (SORT_AREA_SIZE initialisation parameter), space will be allocated in a temporary tablespace for doing the sort operation.
    REF_LINK : TEMPORARY Tablespaces and TEMPFILES | Oracle FAQ
    MY DOUBT QUESTION :   How do i know if my query using  SORT_AREA_SIZE   or temporary tablespace ?
    Thanks in advance.

    @ JohnWatson
    I have seen some articles from ORA - FAQ. Good.
    SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage;
    USERNAME                       USER   TABLESPACE                      SQL_ID
       SCOTT                               SYS          TEMP                            fh9vqgyd6m0d1
    PGA management means that sorting only 300000 rows  may well occur in memory
                Is this (3 million rows) -  standard  value for 10g version ?
    Thanks JohnWatson

  • Shrinking a Locally Managed Temporary Tablespace

    So, even thoguh the documentation is pretty clear about how to use this feature, I cannot get it to do what I expect it to do for me.
    And that would be shrinking the tempfile ;)
    Now lets face it, I have a large tempfile and want to resize it without restarting the database:
    C:\Users\Administrator>sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.2.0 Production on Di Nov 20 05:49:59 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
    SQL> select file_name
    , ceil(bytes / 1024 / 1024) "size MB"
    from dba_temp_files
    FILE_NAME size MB
    R:\MXVC01\TEMP01.DBF 31,231
    SQL> select su.username
    , ses.sid
    , ses.serial#
    , su.tablespace
    , ceil((su.blocks * dt.block_size) / 1048576) MB
    from v$sort_usage su
    , dba_tablespaces dt
    , v$session ses
    where su.tablespace = dt.tablespace_name
    and su.session_addr = ses.saddr
    USERNAME SID SERIAL# TABLESPACE MB
    VPXADMIN 15 15 TEMP 14
    VPXADMIN 17 5 TEMP 1,203
    VPXADMIN 17 5 TEMP 1
    VPXADMIN 18 3 TEMP 7
    VPXADMIN 19 3 TEMP 1
    VPXADMIN 144 3 TEMP 1
    VUMADMIN 156 2597 TEMP 1
    7 rows selected.
    Or this one:
    SQL> select tablespace_size/1024/1024 "tablespace_size mb"
    , allocated_space/1024/1024 "allocated_space mb"
    , free_space/1024/1024 "free_space mb"
    from dba_temp_free_space
    tablespace_size mb allocated_space mb free_space mb
    31230,9922 1228,99219 30002
    Documetation from here: http://docs.oracle.com/cd/E11882_01/server.112/e25494/tspaces007.htm#ADMIN12353
    +"Shrinking a Locally Managed Temporary Tablespace+
    +Large sort operations performed by the database may result in a temporary tablespace growing and occupying a considerable amount of disk space. After the sort operation completes, the extra space is not released; it is just marked as free and available for reuse. Therefore, a single large sort operation might result in a large amount of allocated temporary space that remains unused after the sort operation is complete. For this reason, the database enables you to shrink locally managed temporary tablespaces and release unused space.+
    +You use the SHRINK SPACE clause of the ALTER TABLESPACE statement to shrink a temporary tablespace, or the SHRINK TEMPFILE clause of the ALTER TABLESPACE statement to shrink a specific tempfile of a temporary tablespace. Shrinking frees as much space as possible while maintaining the other attributes of the tablespace or tempfile. The optional KEEP clause defines a minimum size for the tablespace or tempfile.+
    +Shrinking is an online operation, which means that user sessions can continue to allocate sort extents if needed, and already-running queries are not affected.+
    +The following example shrinks the locally managed temporary tablespace lmtmp1 to a size of 20M.+
    +ALTER TABLESPACE lmtemp1 SHRINK SPACE KEEP 20M;+
    +The following example shrinks the tempfile lmtemp02.dbf of the locally managed temporary tablespace lmtmp2. Because the KEEP clause is omitted, the database attempts to shrink the tempfile to the minimum possible size.+
    +ALTER TABLESPACE lmtemp2 SHRINK TEMPFILE '/u02/oracle/data/lmtemp02.dbf';"+
    OK, lets do it:
    SQL> alter tablespace temp shrink tempfile 'R:\MXVC01\TEMP01.DBF';
    alter tablespace temp shrink tempfile 'R:\MXVC01\TEMP01.DBF'
    ERROR at line 1:
    ORA-03214: File Size specified is smaller than minimum required
    It seems there is a bug? Should I report it, or is it the expected behaviour?
    Now lets try this one:
    SQL> alter tablespace temp shrink tempfile 'R:\MXVC01\TEMP01.DBF' keep 2048M;
    Tablespace altered.
    SQL> select file_name
    , ceil(bytes / 1024 / 1024) "size MB"
    from dba_temp_files
    FILE_NAME size MB
    R:\MXVC01\TEMP01.DBF 31,231
    So .... this lasts about *10 minutes*, and nothing changes?
    It seems there is a bug? Should I report it, or is it the expected behaviour?
    Could someone enlighten me, what this SHRINK is actually doing?
    Is it worth to report this as bug, if not a software bug it is at least a documentation bug because it doesn't mention under which conditions it is working?
    P.S.: OMG the posting looks terrible, who's the one to blame for this forum software where it is not possible to use fixed size fonts, or format paragraphs as code, or what about the fact that the forum software is using default SQLPlus output as META for some graphical lines?
    Isn't this the forum for Oracle Database users?
    Edited by: Gerrit Haase on 20.11.2012 13:44

    So, you are kidding with me? No? Who are you?
    How can I block users here? Is there a moderator present at this forum?
    Maybe you read my initial post again?
    I didn't look at the wrong place.
    I reported you for general abuse.
    SQL> define
    DEFINE _DATE           = "20.11.12" (CHAR)
    DEFINE CONNECTIDENTIFIER = "MXVC01" (CHAR)
    DEFINE _USER           = "SYS" (CHAR)
    DEFINE _PRIVILEGE      = "AS SYSDBA" (CHAR)
    DEFINE SQLPLUSRELEASE = "1102000200" (CHAR)
    DEFINE _EDITOR         = "Notepad" (CHAR)
    DEFINE OVERSION = "Oracle Database 11g Release 11.2.0.2.0 - 64bit Production" (CHAR)
    DEFINE ORELEASE = "1102000200" (CHAR)
    SQL> SELECT * FROM dba_temp_free_space;
    TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
    TEMP 3,2748E+10 1306517504 3,1443E+10
    SQL> select TABLESPACE_SIZE/power(2,20), ALLOCATED_SPACE/power(2,20), FREE_SPACE/power(2,20) from dba_temp_free_space ;
    TABLESPACE_SIZE/POWER(2,20) ALLOCATED_SPACE/POWER(2,20) FREE_SPACE/POWER(2,20)
    31230,9922 1245,99219 29986
    SQL> ALTER TABLESPACE temp SHRINK SPACE;
    Tablespace altered.
    SQL> select TABLESPACE_SIZE/power(2,20), ALLOCATED_SPACE/power(2,20), FREE_SPACE/power(2,20) from dba_temp_free_space ;
    TABLESPACE_SIZE/POWER(2,20) ALLOCATED_SPACE/POWER(2,20) FREE_SPACE/POWER(2,20)
    31230,9922 1244,99219 *29986*
    R:\mxvc01>dir temp
    Volume in drive R is Disk_R
    Volume Serial Number is 248B-61D4
    Directory of R:\mxvc01
    20.11.2012 08:09 32.748.077.056 TEMP01.DBF
    1 File(s) 32.748.077.056 bytes
    0 Dir(s) 8.259.297.280 bytes free
    SQL> alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF';
    alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF'
    ERROR at line 1:
    ORA-03214: File Size specified is smaller than minimum required
    *It clearly says that there is 29986 MB Space FREE and the above shrink space changes nothing and so does shrink tempfile:*
    SQL> alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF';
    alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF'
    ERROR at line 1:
    ORA-03214: File Size specified is smaller than minimum required
    SQL> alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF' KEEP 20M;
    Tablespace altered.
    R:\mxvc01>dir temp
    Volume in drive R is Disk_R
    Volume Serial Number is 248B-61D4
    Directory of R:\mxvc01
    20.11.2012 08:24 32.748.077.056 TEMP01.DBF
    1 File(s) 32.748.077.056 bytes
    0 Dir(s) 8.259.280.896 bytes free
    *... nothing changes, the tempfile isn't smaller now ...*

  • Bigfile Temporary Tablespace?

    Hi,
    --------------------------Oracle 11G Release 11.1.0.6.0, Windows XP 32------------------------------------
    I've tried to find out but not successful. Can I create BIGFILE TEMPORARY TABLESPACE like I've created normal BIGFILE TABLESPACE.
    Secondly, If it is not possible then will creating multiple temporary files will effect performance will doing the sorting?
    ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
    select inst_id, tablespace_name, total_blocks, used_blocks, free_blocks
          from gv$sort_segment;
       INST_ID TABLESPACE_NAME                 TOTAL_BLOCKS USED_BLOCKS FREE_BLOCKS
             1 TEMP                                12582144           0    12582144
    I've created 3 temp files of 30G each and get above error i.e unable to extend. adding a temp file will solve this issue, but I was thinking to create one bigfiel temporary file instead of adding files, that might decrease lot of performance.
    Thanks
    Regards

    kam555 wrote:
    Hi,
    --------------------------Oracle 11G Release 11.1.0.6.0, Windows XP 32------------------------------------
    I've tried to find out but not successful. Can I create BIGFILE TEMPORARY TABLESPACE like I've created normal BIGFILE TABLESPACE.
    Secondly, If it is not possible then will creating multiple temporary files will effect performance will doing the sorting?
    ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
    select inst_id, tablespace_name, total_blocks, used_blocks, free_blocks
    from gv$sort_segment;
    INST_ID TABLESPACE_NAME                 TOTAL_BLOCKS USED_BLOCKS FREE_BLOCKS
    1 TEMP                                12582144           0    12582144I've created 3 temp files of 30G each and get above error i.e unable to extend. adding a temp file will solve this issue, but I was thinking to create one bigfiel temporary file instead of adding files, that might decrease lot of performance.
    Thanks
    RegardsBigfile tablespaces are supported only for locally managed tablespaces with automatic segment space management, with three exceptions: locally managed undo tablespaces, temporary tablespaces, and the SYSTEM tablespace.
    There is no performance overhead if you have multiple datafiles in a tablespace. That is structure of Oracle: Tablespace may consist of multiple datafiles.

  • 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

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

  • How to check temporary tablespace size in Oracle 7?

    Hi,
    Anyone still using Oracle 7 ? I would like to know the sql to check the temporary tablespace and its datafile size.
    Thank,
    Regards,
    Eye Gee

    http://www.oracle.com/technetwork/documentation/oracle7-091910.html

  • Temporary tablespace-Problem

    Hi,
    How to view the temporary tablespace usage?
    How to deallocate the used temporary tablespace segments/ resize temporary tablespace?
    I am running a query which is consuming 4GB temporary tablespace and failing.
    pga_aggregate_traget=500m;
    oracle -9.2.0.1.0
    OS:Windows 2003
    How to solve this?
    regards
    Mathew

    Hi,
    We are using the following View and it is fetchhing 46,56,00,000 rows.
    PGA=500m
    While running the query temporary tablespace is growing upto 4GB and query is failling.
    CREATE OR REPLACE FORCE VIEW MHUBADMIN.LOAN_PIPELINE_VIEW
    (LOAN_ID, USER_ID, FIRST_NAME, LAST_NAME, BORROWER_NAME,
    SSN, USERNAME, SELLERLOANNUMBER, LOANNUMBER, LOANAMOUNT,
    STATUS_DESC, LOAN_TYPE, LOCK_EXPIRE_DATE, ORG_NAME, ORG_PARENT_ID,
    ORG_CHILD_ID, NO_CASCADE_FLAG, PRODUCT_NAME, INT_RATE, UPDATE_DATE,
    UPDATE_DATE_STR, CURRENT_DATE, LOWER_FIRST_NAME, LOWER_LAST_NAME, LOWER_SSN,
    LOWER_STATUS_DESC, STATUS_ID, AMORTIZATION_TYPE, STREET1, LOCK_EXTEN_EXPIR_DATE,
    RELOCK_EXPIR_DATE, LOCK_RELOCK_COUNT, UNDERWRITE_FLAG, RECENT_EXPIR_DATE, STATUS_DATE)
    AS
    SELECT
    LOAN.loan_id,
    LOAN.user_id,
    PERSON.first_name,
    PERSON.last_name,
    PERSON.last_name||', '||PERSON.first_name AS Borrower_Name,
    PERSON.ssn,
    HUBUSER.username,
    LOAN.sellerloannumber,
    LOAN.loannumber,
    LOAN.loanamount,
    STATUS.status_desc,
    LOAN.loan_type,
    PRICE.lock_expire_date,
    ORGANIZATION.org_name,
    BUSINESS_RELATIONSHIP.org_parent_id,
    BUSINESS_RELATIONSHIP.org_child_id,
    BUSINESS_RELATIONSHIP.no_cascade_flag,
    product_name,
    PRICE.final_rate,
    LOAN.update_date,
    TO_CHAR (LOAN.update_date,
    'MM/DD/YYYY HH:MI:SS AM') update_date_str,
    sysdate,
    LOWER (PERSON.first_name),
    LOWER (PERSON.last_name),
    LOWER (PERSON.ssn),
    LOWER (STATUS.status_desc),
    STATUS.status_id,
    LOAN.amortization_type,
    ADDRESS.STREET1,
    PRICE.LOCK_EXTEN_EXPIR_DATE,
    PRICE.RELOCK_EXPIR_DATE,
    LOAN.LOCK_RELOCK_COUNT,
    LOAN.UNDERWRITE_FLAG,
    decode (status.STATUS_ID,
    22, PRICE.LOCK_EXTEN_EXPIR_DATE,
              23, PRICE.lock_expire_date,
              13, PRICE.lock_expire_date,
              24, PRICE.RELOCK_EXPIR_DATE,
              PRICE.lock_expire_date) RECENT_EXPIR_DATE,
              LOAN_STATUS_HISTORY.STATUS_DATE
    FROM
    LOAN,
    HUBUSER,
    ORGANIZATION,
    BUSINESS_RELATIONSHIP,
    BORROWER,
    PERSON,
    STATUS,
    PRICE,
    product,
    PROPERTY,
    ADDRESS,
    LOAN_STATUS_HISTORY
    WHERE
    ORGANIZATION.org_id = BUSINESS_RELATIONSHIP.org_child_id AND
    LOAN.org_id = BUSINESS_RELATIONSHIP.org_child_id AND
    LOAN.loan_id = BORROWER.loan_id AND
    LOAN.registration_loan_status_id = STATUS.status_id AND
    LOAN.price_id = PRICE.price_id AND
    BORROWER.primaryborrower = 'T' AND
    PERSON.person_id = BORROWER.person_id AND
    LOAN.product_id = product.product_id AND
    LOAN.PROPERTY_ID = PROPERTY.PROPERTY_ID AND
    PROPERTY.ADDRESS_ID = ADDRESS.ADDRESS_ID AND
    LOAN.user_id = HUBUSER.user_id (+);
    Any one know how to tune this query?
    regards
    Mathew

Maybe you are looking for

  • 10.6.8... problems with Safari and others

    So last night, on Apple's advice, I updated my 10.6.8 for security et al. Now when I try to open Safari or iPhoto or GarageBand or a few other Apple-based programs, I get this weird message: Process:     Safari [615] Path:        /Applications/Safari

  • Capturing from old camcorder...

    I've seen posts around this forum and others that people often use smaller consumer camcorders as miniDV "decks" as opposed to using their regular cameras, as it can wear down the tape heads. I have a project now where I was hoping to do the same thi

  • HT201210 I can't update my iPad 2 to IOS 6, it downloaded in my Mac, but I don get pass the firmware step....Helpppp

    A couple of days ago I downloaded the new IOS 6 into my Mac, when I hooked up my Ipad 2 it won't update it and can't do anything with oit now. It gets to the firmware part of the update and then, nothing but the unability to now use my iPad. Can anyo

  • Import data thru php

    hi, i have a text file and i want to import this file to data base table, how i can do that thru php? any solution will be appriciated. thanks Noman ul haq

  • Can i blue tooth exchange files between a macbkpro and a pc laptop?

    hi i have a mac book pro which bluetooth file exchange with my nokia mobile phone ok....when i try to link to a pc laptop and do so....doesnt communicate..they both see each other and the mac even generated a bluetooth pin code but alas they still do