Rapid and Huge growth of of used space of temporary tablespace

Hi,
Have a query (select) that run quick (no more than 10 seconds).
As soon I insert the data into a temporary table or even on physical table, the temporary table used space starts to growth very fast. The used space is totally used and the query crash since e reach the limit (65GB), or even more if I add more table files to temporary tablespace!
The problem also happen only if the period (dates) is one year (2013). If the period is the first trimestre of 2013 (same amount of data), the problem does not happen!!
I also confirm that on another instance ( a test one), even with less resources this ORACLE behavior do not happen. I confirm differente execution plan queries, between the two instances .
What I really do not understant is the behavior of the ORACLE with the huge and rapid growth!!!
Any one experiment such a similiar situation?
Thanks in advance,Rui
Plan
INSERT STATEMENT ALL_ROWSCost: 15.776 Bytes: 269 Cardinality: 1
28 LOAD TABLE CONVENTIONAL MIDIALOG_OLAP.MED_INVCOMP_FACTTMP_BEFGROUPBY
27 FILTER
26 NESTED LOOPS
24 NESTED LOOPS Cost: 15.776 Bytes: 269 Cardinality: 1
22 NESTED LOOPS Cost: 15.775 Bytes: 255 Cardinality: 1
19 NESTED LOOPS Cost: 15.774 Bytes: 205 Cardinality: 1
17 NESTED LOOPS Cost: 15.773 Bytes: 197 Cardinality: 1
14 NESTED LOOPS Cost: 15.770 Bytes: 180 Cardinality: 1
11 NESTED LOOPS Cost: 15.767 Bytes: 108 Cardinality: 1
9 HASH JOIN Cost: 15.757 Bytes: 8.346.500 Cardinality: 83.465
7 HASH JOIN Cost: 13.407 Bytes: 6.345.012 Cardinality: 83.487
5 HASH JOIN Cost: 11.163 Bytes: 5.010.550 Cardinality: 100.211
3 HASH JOIN Cost: 5.642 Bytes: 801.288 Cardinality: 22.258
1 INDEX RANGE SCAN INDEX MIDIALOG.IX_INSCOMP_DTCEIDICIDLCPECIDOP Cost: 120 Bytes: 489.676 Cardinality: 22.258
2 INDEX FAST FULL SCAN INDEX (UNIQUE) MIDIALOG.IX_LINHACOMPRADA_IDLCIDOPSEQ Cost: 5.463 Bytes: 123.975.530 Cardinality: 8.855.395
4 INDEX FAST FULL SCAN INDEX (UNIQUE) MIDIALOG.IX_LINHACOMPRADA_IDLCIDOPSEQ Cost: 5.463 Bytes: 123.975.530 Cardinality: 8.855.395
6 TABLE ACCESS FULL TABLE MIDIALOG.ITEM_AV Cost: 1.569 Bytes: 6.963.736 Cardinality: 267.836
8 TABLE ACCESS FULL TABLE MIDIALOG.ITEM_AV Cost: 1.572 Bytes: 7.713.672 Cardinality: 321.403
10 INDEX UNIQUE SCAN INDEX (UNIQUE) MIDIALOG.IX_BOFINALBO_IDBOIDFINALBO Cost: 0 Bytes: 8 Cardinality: 1
13 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.INSERCAO_COMPRADA Cost: 3 Bytes: 72 Cardinality: 1
12 INDEX RANGE SCAN INDEX (UNIQUE) MIDIALOG.IX_INSCOMPRADA_IDLCDATAPECAINS Cost: 2 Cardinality: 1
16 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.INSERCAO_ITEMFACTURA Cost: 3 Bytes: 17 Cardinality: 1
15 INDEX RANGE SCAN INDEX MIDIALOG.IX_INSITFACT_INSCOMPRADA Cost: 2 Cardinality: 1
18 INDEX RANGE SCAN INDEX (UNIQUE) MIDIALOG.UQ_ITEMFACTURA_IDITF_IDFACT Cost: 1 Bytes: 8 Cardinality: 1
21 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.FATURA Cost: 1 Bytes: 50 Cardinality: 1
20 INDEX UNIQUE SCAN INDEX (UNIQUE) MIDIALOG.PK_FATURA Cost: 0 Cardinality: 1
23 INDEX UNIQUE SCAN INDEX (UNIQUE) MIDIALOG.PK_TIPO_ESTADO Cost: 0 Cardinality: 1
25 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.TIPO_ESTADO Cost: 1 Bytes: 14 Cardinality: 1
Edited by: rr**** on 19/Fev/2013 15:25

I run the select with sucess, no more that 1 minute from on year of data. Few temporary used space used.
As soon I plug the insert (global temporary table, also experiment with physical table) the used space of temporary table space start to grow crazy!!
insert into midialog_olap.med_invcomp_facttmp_befgroupby
select fac.numefatura,
fac.codpessoa,
fac.dtemiss,
tef.nome as estado_factura,
opsorig.demid,
opsorig.anoplano,
opsorig.numplano,
opsorig.numplanilha,
ops.nome as ordem_publicidade,
ops.external_number as numero_externo,
ops.estado,
lic.seq,
inc.data,
inc.peca,
fac.id_versao_plano,
fac.ano_proforma || '.' || fac.numrf as num_proforma,
iif.tipo_facturacao,
opsorig.codveiculo as id_veiculo,
opsorig.codfm as id_fornecedor_media,
icorig.chkestado as id_estado_checking,
0 as percentagem_comissao_agencia,
0 as valor_pbv,
0 as valor_stxtv,
0 as valor_ptv,
0 as valor_odbv,
0 as valor_pbbv,
0 as valor_dnv,
0 as valor_pbnv,
0 as valor_stxv,
0 as valor_pbtv,
0 as valor_dav,
0 as valor_plv,
0 as valor_odlv,
0 as valor_pllv,
0 as valor_ca,
0 as valor_trv,
0 as valor_txv,
0 as valor_base_facturacao,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pb_compra * fac.percentagem_facturada / 100))
as valor_pbc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_stxt_compra * fac.percentagem_facturada / 100))
as valor_stxtc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pt_compra * fac.percentagem_facturada / 100))
as valor_ptc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_odb_compra * fac.percentagem_facturada / 100))
as valor_odbc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pbb_compra * fac.percentagem_facturada / 100))
as valor_pbbc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_dn_compra * fac.percentagem_facturada / 100))
as valor_dnc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pbn_compra * fac.percentagem_facturada / 100))
as valor_pbnc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_stx_compra * fac.percentagem_facturada / 100))
as valor_stxc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pbt_compra * fac.percentagem_facturada / 100))
as valor_pbtc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_da_compra * fac.percentagem_facturada / 100))
as valor_dac,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pl_compra * fac.percentagem_facturada / 100))
as valor_plc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_odl_compra * fac.percentagem_facturada / 100))
as valor_odlc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pll_compra * fac.percentagem_facturada / 100))
as valor_pllc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_transcricoes * fac.percentagem_facturada / 100))
as valor_trc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_tx_compra * fac.percentagem_facturada / 100))
as valor_txc,
--nvl((select cfm.total_comprado
-- from fin_custos_facturados_media cfm
-- where cfm.id_factura = fac.id_factura and
- -- cfm.id_op = ops.id_op
-- ), 0) / opsorig.number_of_bought_insertions as custos_associados,
0 as custos_associados,
fac.iss as percentagem_iva,
fac.percentagem_facturada,
fac.currency_exchange as taxa_cambio,
iif.associated_code as insertions_associated_code
from fatura fac, item_fatura itf, insercao_itemfactura iif,
insercao_comprada icorig, linha_comprada lcorig, item_av opsorig,
med_bookingorder_finalbo opfin,
insercao_comprada inc,
linha_comprada lic, item_av ops,
--veiculo vei,
tipo_estado tef
where fac.id_factura = itf.id_factura and
itf.id_itemfactura = iif.id_itemfactura and
iif.id_ic = icorig.id_ic and
icorig.id_lc = lcorig.id_lc and
lcorig.id_op = opsorig.id_op and
opsorig.id_op = opfin.id_booking_order and
opsorig.number_of_bought_insertions > 0 and
opfin.id_final_booking_order = ops.id_op and
-- ops.id_op = (
-- select max(ops.id_op)
-- from item_av ops
-- start with ops.id_op = opsorig.id_op
-- connect by prior ops.id_opsubstituicao = ops.id_op) and
ops.id_op = lic.id_op and
lic.seq = lcorig.seq and
lic.id_op = inc.id_op and
lic.id_lc = inc.id_lc and
inc.data = icorig.data and
inc.peca = icorig.peca and
--opsorig.codveiculo = vei.codveiculo and
fac.estado = tef.estado and
fac.estado != 305 and
ops.estado != 223 and
iif.tipo_facturacao != 'SO_CA' and
icorig.data between :dtBeginDate and :dtEndDate and
(fac.codagenciafat = :iIdAgency or :iIdAgency is null);

Similar Messages

  • 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

  • Look for a progarm that will let me have 2 moniters but one will lock on and will not change when using spaces

    look for a progarm that will let me have 2 moniters but one will lock on and will not change when using spaces

    ok so i have one moniter to the right of me and i want to keep my google chrome on that one but still be abel to use space on the many monter. cuz when you go to spaces it movies both moniter i hope that help and i hope that you can help me.

  • How to view what is using up the temporary tablespace

    Hi all
    I am running into a problem - my temporary tablespace is being completely used up.
    How would i find out what is using up this? Technically it has enough space to function properly but now we are getting 0 bytes free.
    thanks!

    There is nothing wrong if a temporary tablespace appears as full. It is very normal. I
    For more information about temporary tablespace usage query V$SORT_USAGE and V$SORT_SEGMENT .
    For more information go to this link
    http://asktom.oracle.com/pls/ask/f?p=4950:8:14327914180898764224::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:374218170986

  • Archive and File area empty, but used space full

    Hi,
    I have a problem with the File area. I loaded files on my 20GB space. Later I deleted them by putting them in the archive. No file were shown in the archive. I tried several times. The Creative Cloud Mac application tells me now that my space is full, but nothing appears either in the Files or in the Archive section. I also emptied the local folders, nothing.
    Thanks for help
    Nino

    Have replied to your initial post here http://forums.adobe.com/message/5841255#5841255.

  • How can free + used space tbs size, can someone explain

    Hi Gurus
    Can someone explain this, How can free + used space in a tablespace can be greater than size of a tablespace. What am I missing here . Thanks a lot .
    I am on 10.2.0.1, HP-UX
    14:38:52 SQL> select owner,sum(bytes), sum(BYTES) /1024/1024 "MB" from dba_segments where tablespace
    name='USERDB1ADATA' group by owner;
    OWNER SUM(BYTES) MB
    USERDB1A 839680000 800.78125
    1 row selected.
    14:40:42 SQL> select bytes, BYTES /1024/1024 "MB" from dba_data_files where tablespace_name='USERDB1
    A_DATA';
    BYTES MB
    3758096384 3584
    1 row selected.
    14:40:42 SQL> select sum(bytes) , sum(BYTES) /1024/1024 "MB"from dba_free_space where tablespace_nam
    e='USERDB1A_DATA';
    SUM(BYTES) MB
    3067412480 2925.3125
    1 row selected.
    14:40:43 SQL> select 839680000 + 3067412480 "used + free space" from dual;
    used + free space
    3907092480
    1 row selected.
    New DBA

    Good point, Howard, about the recycle bin. So I cleaned up, recreated the table, filled it, dropped it but did not purge it, and ...
    SQL> create table test.x tablespace test as select * from dba_objects where 1=2;
    Table created.
    SQL> insert into test.x select * from dba_objects;
    12617 rows created.
    SQL> commit;
    Commit complete.
    SQL> drop table test.x;
    Table dropped.
    SQL> with
      2  dbf_size as (select sum(bytes) size_
      3                 from dba_data_files where tablespace_name='TEST'),
      4  dbf_free as (select sum(bytes) free_
      5                 from dba_free_space where tablespace_name='TEST'),
      6  dbf_used as (select sum(bytes) used_
      7                 from dba_segments where tablespace_name='TEST')
      8  select size_, free_, used_, (size_ - free_ - used_) left_
      9         from dbf_size, dbf_free, dbf_used
    10  /
         SIZE_      FREE_      USED_      LEFT_
       5242880    5177344    2162688   -2097152
    SQL>and then I played around with my SQL and came up with
    WITH
    dbf_size AS (SELECT SUM(bytes) size_
                   FROM dba_data_files
                  WHERE tablespace_name='TEST'),
    dbf_free AS (SELECT SUM(bytes) free_
                   FROM dba_free_space
                  WHERE tablespace_name='TEST'),
    dbf_used AS (SELECT SUM(bytes) used_
                   FROM dba_segments
                  WHERE tablespace_name='TEST'),
    dbf_fbin AS (SELECT SUM(bytes) fbin_
                   FROM dba_segments
                  INNER JOIN
                        dba_recyclebin
                     ON (tablespace_name=ts_name
                         AND segment_name=object_name)
                  WHERE tablespace_name='TEST')
    SELECT      size_, -- tablespace size
         free_, -- free space reported
         used_, -- segment space used
         fbin_, -- segment space in recycle bin
         (size_ - free_ - used_ + fbin_) left_ -- 64K overhead per data file
      FROM      dbf_size, dbf_free, dbf_used, dbf_fbin
    /which does
    SQL> WITH
      2  dbf_size AS (SELECT SUM(bytes) size_
      3                 FROM dba_data_files
      4                WHERE tablespace_name='TEST'),
      5  dbf_free AS (SELECT SUM(bytes) free_
      6                 FROM dba_free_space
      7                WHERE tablespace_name='TEST'),
      8  dbf_used AS (SELECT SUM(bytes) used_
      9                 FROM dba_segments
    10                WHERE tablespace_name='TEST'),
    11  dbf_fbin AS (SELECT SUM(bytes) fbin_
    12                 FROM dba_segments
    13                INNER JOIN
    14                      dba_recyclebin
    15                   ON (tablespace_name=ts_name
    16                       AND segment_name=object_name)
    17                WHERE tablespace_name='TEST')
    18  SELECT     size_,
    19     free_,
    20     used_,
    21     fbin_,
    22     (size_ - free_ - used_ + fbin_) left_
    23    FROM     dbf_size, dbf_free, dbf_used, dbf_fbin
    24  /
         SIZE_      FREE_      USED_      FBIN_      LEFT_
       5242880    5177344    2162688    2162688      65536
    SQL> alter tablespace test add datafile 'C:\ORACLE\ORADATA\XE\TEST2.DBF' size 5m;
    Tablespace altered.
    SQL> WITH
      2  dbf_size AS (SELECT SUM(bytes) size_
      3                 FROM dba_data_files
      4                WHERE tablespace_name='TEST'),
      5  dbf_free AS (SELECT SUM(bytes) free_
      6                 FROM dba_free_space
      7                WHERE tablespace_name='TEST'),
      8  dbf_used AS (SELECT SUM(bytes) used_
      9                 FROM dba_segments
    10                WHERE tablespace_name='TEST'),
    11  dbf_fbin AS (SELECT SUM(bytes) fbin_
    12                 FROM dba_segments
    13                INNER JOIN
    14                      dba_recyclebin
    15                   ON (tablespace_name=ts_name
    16                       AND segment_name=object_name)
    17                WHERE tablespace_name='TEST')
    18  SELECT     size_, -- tablespace size
    19     free_, -- free space reported
    20     used_, -- segment space used
    21     fbin_, -- segment space used in recycle bin
    22     (size_ - free_ - used_ + fbin_) left_
    23    FROM     dbf_size, dbf_free, dbf_used, dbf_fbin
    24  /
         SIZE_      FREE_      USED_      FBIN_      LEFT_
      10485760   10354688    2162688    2162688     131072Message was edited by:
    Hans Forbrich
    Cleaned up the script and tested with second data file added to verify LMT overhead.

  • Delete ccmcache used space

    Hi All
    I have a question regarding client cache removal using a powershell script calling a com object
    My C drive contains 18 GB free space
    Total CCM Cache in c:\windows\ccmcache size is 10240
    Free Space = 8713  and used space = 1527
    I used the following powershell script to remove used space by using DeleteCacheElement function
    Though all folders were removed in cache but I still see used space even after using the script
    May I know the reason and how to delete the used space
    $UIResourceMgr = New-Object -ComObject UIResource.UIResourceMgr
    $Cache = $UIResourceMgr.GetCacheInfo()
    $CacheElements = $Cache.GetCacheElements()
    foreach ($Element in $CacheElements)
            Write-Host "Deleting CacheElement with PackageID $($Element.ContentID)"
            Write-Host "in folder location $($Element.Location)"
     If (!(Test-Path $($Element.Location)))
       md $($Element.Location)
           $Cache.DeleteCacheElement($Element.CacheElementID)
    $Cache = $UIResourceMgr.GetCacheInfo()
    Write-Host "The total Cache size = $($Cache.TotalSize)"
    Write-Host "The total Cache free size after execution of script= $($Cache.FreeSize)"
    Write-Host "The total Cache used size after execution of script = $(($Cache.TotalSize) -($Cache.FreeSize))"

    Though all folders were removed in cache but I still see used space even after using the script
    How? Are you talking about this line of the script? Write-Host "The total Cache free size after
    execution of script= $($Cache.FreeSize)"
    Torsten Meringer | http://www.mssccmfaq.de

  • Monitoring Used (%) space for tablespaces

    Hi everyone,
    I am currently using:
    Redhat Linux ES 5 2.6.18 and also
    Oracle 10g Release 2 for Linux x86 R10.2.0.3
    While monitoring my Tablespaces using OEM Database Control, I notice that two tablespaces were almost full.
    [SYSAUX] - Size: 290MB , Used 283MB (97% full)
    [SYSTEM] - Size: 320MB, Used 313MB (98% full)
    When I try to locate the datafiles of both tablespaces in its directory (/home/dba/oracle/oradata/oracle), it shows the allocated size (290MB for sysaux01.dbf & 320MB for system01.dbf) and not the used space.
    I got three questions to ask over here:
    1st- Why there isn't any warnings or alarms even though the tablespaces exceeds the critical size?
    2nd- How come the datafiles shows the allocated size of the tablespaces and not the Used space?]
    3rd- How can I find & monitor the actual used space of the tablespaces?
    4th- I have enabled the AutoExtend function but I am worry whether is there any other concern?
    I am still very new here.
    Please pardon me for anything that is improper.
    Looking forward for your expertise, guidance & help.
    Thanks for your attention.
    -Regards-
    ++ Kef Lim ++

    Hi,
    Here you have some scripts:
    TABLESPACE USAGE NOTES:
    Tablespace Name - Name of the tablespace
    Bytes Used - Size of the file in bytes
    Bytes Free - Size of free space in bytes
    Largest - Largest free space in bytes
    Percent Used - Percentage of tablespace that is being used - Careful if it is more than 85%
    select     a.TABLESPACE_NAME,
         a.BYTES bytes_used,
         b.BYTES bytes_free,
         b.largest,
         round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
    from      
              select      TABLESPACE_NAME,
                   sum(BYTES) BYTES
              from      dba_data_files
              group      by TABLESPACE_NAME
         a,
              select      TABLESPACE_NAME,
                   sum(BYTES) BYTES ,
                   max(BYTES) largest
              from      dba_free_space
              group      by TABLESPACE_NAME
         b
    where      a.TABLESPACE_NAME=b.TABLESPACE_NAME
    order      by ((a.BYTES-b.BYTES)/a.BYTES) desc
    SET SERVEROUTPUT ON
    SET PAGESIZE 1000
    SET LINESIZE 255
    SET FEEDBACK OFF
    PROMPT
    PROMPT Tablespaces nearing 0% free
    PROMPT ***************************
    SELECT a.tablespace_name,
           b.size_kb,
           a.free_kb,
           Trunc((a.free_kb/b.size_kb) * 100) "FREE_%"
    FROM   (SELECT tablespace_name,
                   Trunc(Sum(bytes)/1024) free_kb
            FROM   dba_free_space
            GROUP BY tablespace_name) a,
           (SELECT tablespace_name,
                   Trunc(Sum(bytes)/1024) size_kb
            FROM   dba_data_files
            GROUP BY tablespace_name) b
    WHERE  a.tablespace_name = b.tablespace_name
    AND    Round((a.free_kb/b.size_kb) * 100,2) < 10
    PROMPT
    SET FEEDBACK ON
    SET PAGESIZE 18
    Set Termout  On
    Set Heading  On
    clear breaks
    break on contents -
    skip 1
    compute Sum of alloc used free nbfrag on contents
    column tblsp         format a20 wrap          heading  "Tablespace Name"
    column Alloc         format 999,999           heading  "Alloc|(Mb)"
    column Free          format 999,999           heading  "Free|(Mb)"
    column used          format 999,999           heading  "Used|(Mb)"
    column pused         format 990.9             heading  "%|Used|Space"
    column fragmax       format 99,999.9          heading  "Largest|Free|Ext.(Mb)"
    column nbfrag        format 99999             heading  "Nb|frag"
    column contents      format a10               heading  "Content"
    column pct_ext_coal  format 999                     heading  "% Ext.|Coal."
    column ext_manage    format a7 wrap           heading  "Ext.|M."
    column autoext       format a7 wrap           heading  "Auto|Ext."
    select
           contents
         , nvl (dt.tablespace_name, nvl (fsp.tablespace_name, 'Unknown')) tblsp
         , alloc
         , alloc - nvl (free, 0)       Used
         , nvl (free, 0)               Free
         , ((alloc - nvl (free, 0)) / alloc) * 100  pused
         , nbfrag
         , fragmax
         , dfsc.pct_ext_coal pct_ext_coal
         , dt.ext_manage
         , df.inc                           autoext
      from
           ( select sum (bytes)/1048576     free
                  , max (bytes)/1048576     fragmax
                  , tablespace_name
                  , count(*)                nbfrag
              from  sys.dba_free_space
             group  by tablespace_name
           ) fsp
        ,  ( select sum(bytes)/1048576      alloc
                  , tablespace_name
                  , Decode(((inc * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')     inc
               from sys.dba_data_files sddf
                  , sys.filext$        aut
              where sddf.file_id       =  aut.file#   (+)
              group by tablespace_name
                     , Decode(((inc * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')
              Union
              select sum(bytes)/1048576      alloc
                   , tablespace_name
                   , Decode(((increment_by * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')    inc
                from sys.dba_temp_files sddf
               group by tablespace_name
                      , Decode(((increment_by * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')
           ) df
        ,  ( select contents
                  , tablespace_name
                  , initial_extent/1024     initial_ext
                  , next_extent/1024        next_ext
                  , pct_increase
                  , max_extents
                  , min_extents
                  , Substr(extent_management,1,5)       ext_manage
               from dba_tablespaces
           ) dt
         , ( select percent_extents_coalesced    pct_ext_coal
                  , tablespace_name
               from dba_free_space_coalesced
           ) dfsc
    where
           fsp.tablespace_name  (+)   =   dt.tablespace_name
       and
           df.tablespace_name   (+)   =   dt.tablespace_name
       and
           dfsc.tablespace_name (+)   =   dt.tablespace_name
    order
        by contents
         , pused desc
    ;Cheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • Queries about Space Info of Temporary Tablespace

    Hi
    I want to know the free space, used space, total space of Temporary Tablespace,
    and also how much space is currently using by different active sessions of Temporary Tablespace.
    Oracle version is 9.2.0.1.0
    Can any body send the links or queries regarding this.
    Thanks,

    This link might help http://www.orafaq.com/faqdba.htm#TEMPSPACE

  • Although my temporary tablespace is enough space,the error occurs ORA-01652

    Hello,
    Although my temporary tablespace is enough space ,i am taking an error ORA-01652 and some dbfs in the tablespace are looks like as offline and it’s size looks like as 0 byte.
    So that i am changing status of these datafiles to online with this command as follows;
    ALTER DATABASE TEMPFILE '/QDBP/q023/q023/temp/qt_lm_tmp01.dbf' ONLINE;
    Also, The disk that exist these datafiles was 0 in availibility.
    When i issued the command df –k as follows
    Filesystem kbytes used avail capacity Mounted on
    /dev/vx/dsk/qdbpdg/volq23 20971520 20971520 0 100% /QDBP/q023
    is pointed.
    And then i have released space from disk
    The current review is
    /dev/vx/dsk/qdbpdg/volq14 157286400 21731141 127083885 15% /QDBP/q014
    My queries and results are for the hint of about the problem:
    SELECT A.tablespace_name TABLESPACE, D.mb_total,
    SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
    D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
    FROM v$sort_segment A,
    SELECT B.NAME, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
    FROM v$tablespace B, v$tempfile C
    WHERE B.ts#= C.ts#
    GROUP BY B.NAME, C.block_size
    ) D
    WHERE A.tablespace_name = D.NAME
    GROUP BY A.tablespace_name, D.mb_total;
    TABLESPACE |MB_TOTAL| MB_USED| MB_FREE
    QT_LM_TMP |61440 |12| 61428 --temporary
    TS_TEMP_SDPA |15360 |0| 15360 –temporary
    Separately,i want to see you a view about alert log like points below.
    KCF: write/open error block=0x1b6e0a online=1
    file=3 /QDBP/q014/q014/temp/qt_lm_tmp03.dbf
    error=27063 txt: 'SVR4 Error: 28: No space left on device
    Additional information: -1
    Additional information: 8192'
    Automatic tempfile offline due to write error on
    file 3: /QDBP/q014/q014/temp/qt_lm_tmp03.dbf
    With sum,i have some question like below:
    1)Although there is enough space on temporary tablespace why i take error ORA-01652?
    2)Although there is enough space on temporary tablespace why databasefiles have offline status suddenly?
    3) is it important fully rate of disk on operating system if there is enough space on temporary tablespace which has extend properties.
    Best regards
    Oya YALÇIN

    Hi,
    i don't make tablespaces offline mode.But neverthless i don't understant although there is enough space on tablespace why tablespaces are being offline status mode itself?
    When i look at ‘ select file_name,status from dba_temp_files ‘ query on the database now.The result is like below;
    FILE_NAME|STATUS
    /QDBP/q023/q023/temp/qt_lm_tmp01.dbf|AVAILABLE
    /QDBP/q023/q023/temp/qt_lm_tmp02.dbf|AVAILABLE
    /QDBP/q014/q014/temp/qt_lm_tmp03.dbf|AVAILABLE
    /QDBP/q023/q023/temp/ts_temp_sdpa01.dbf|AVAILABLE
    /QDBP/q023/q023/temp/ts_temp_sdpa02.dbf|AVAILABLE
    /QDBP/q014/q014/temp/qt_lm_tmp04.dbf|AVAILABLE
    /QDBP/q014/q014/temp/qt_lm_tmp05.dbf|AVAILABLE
    But when i look at first 3 dbf by orderly from tab of scripts about tablespaces on toad tool
    i see that like below;
    ALTER DATABASE TEMPFILE '/QDBP/q023/q023/temp/qt_lm_tmp01.dbf' OFFLINE;
    ALTER DATABASE TEMPFILE '/QDBP/q023/q023/temp/qt_lm_tmp02.dbf' OFFLINE;
    ALTER DATABASE TEMPFILE '/QDBP/q014/q014/temp/qt_lm_tmp03.dbf' OFFLINE;
    And their size is look like 0 .
    Regards
    Oya.

  • Using temporary tablespace for sort in select statement without spacifying

    how can i use some particular temporary tablespace in select statement for sording without allocating any temporary tablespace to that user

    Try to set for the current session the in memory sorting space to 0 before running your query:
    SQL> alter session set sort_area_size = 0;The query should use the temporary tablespace.
    Message was edited by:
    Pierre Forstmann

  • 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

  • DEFAULT TABLESPACE and TEMPORARY TABLESPACE for eBusiness Suite database

    Hi:
    What is the
    DEFAULT TABLESPACE and TEMPORARY TABLESPACE
    for eBusiness Suite database.
    I want to create a new schema on the eBusiness Suite database.
    Please help

    DEFAULT TABLESPACE and TEMPORARY TABLESPACE
    for eBusiness Suite database.
    I want to create a new schema on the eBusiness Suite database.Create a new tablespace and temporary tablespace for your custom schema (you may use the existing temporary tablespace).
    Integrating Custom Applications with Oracle Applications Release 11i [ID 176852.1]
    Step By Step Guide to Creating a Custom Application in Applications 11i [ID 216589.1]
    Thanks,
    Hussein

  • Used part of the tablespace

    Hi
    I appreciate if anyone can clear my doubts.
    create tablespace test datafile
    'C:\test.dbf' size 50M
    extent management local uniform size 10M
    When I check the used space of this tablespace:
    I notice that
    1-)Even the tablespace is empty, it shows 10M as a used part ?
    2-)When I create an empty table in this tablespace, the used part becomes 20M ? Since the table is empty why used part increase? It should increase after the rows inserted into the table? I know 10M of extent allocated for the table, but it should be free for inserts, why does it occupy space in used part?
    Thanks

    so the below script doesnt show the free blocks inside the extents of segments.
    Even it shows there is not available space in the tablespace, there might be space available inside the extents of the segments....
    Am I right??
    select (select decode(extent_management,'LOCAL','*',' ')
              from dba_tablespaces where tablespace_name = b.tablespace_name) ||
    nvl(b.tablespace_name,
                 nvl(a.tablespace_name,'UNKOWN')) name,
           kbytes_alloc kbytes,
           kbytes_alloc-nvl(kbytes_free,0) used,
           nvl(kbytes_free,0) free,
           ((kbytes_alloc-nvl(kbytes_free,0))/
                              kbytes_alloc)*100 pct_used,
           nvl(largest,0) largest,
           nvl(kbytes_max,kbytes_alloc) Max_Size,
           decode( kbytes_max, 0, 0, (kbytes_alloc/kbytes_max)*100) pct_max_used
    from ( select sum(bytes)/1024 Kbytes_free,
                  max(bytes)/1024 largest,
                  tablespace_name
           from  sys.dba_free_space
           group by tablespace_name ) a,
         ( select sum(bytes)/1024 Kbytes_alloc,
                  sum(maxbytes)/1024 Kbytes_max,
                  tablespace_name
           from sys.dba_data_files
           group by tablespace_name
           union all
          select sum(bytes)/1024 Kbytes_alloc,
                  sum(maxbytes)/1024 Kbytes_max,
                  tablespace_name
           from sys.dba_temp_files
           group by tablespace_name )b
    where a.tablespace_name (+) = b.tablespace_name
    order by &1

  • Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.

    Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.?

    I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
    What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
    Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
    Thanks again for "anyone" that can help me!!!

Maybe you are looking for

  • Bcc's recipients are not shown in Sent mail folder. (Mail 2.0)

    If I send an email with a bcc, and then look in my sent email, I have discovered that I cannot look at who I bcc'd in the email. Only the main recipient is shown. Does anyone know how to see who you've bcc'd after the message has been sent using Mail

  • Setting up a new destination drive, doubling of files.

    I recently moved. My computer reassigned the drive letter of my music disk drive. There is a new, third disk drive that I don't recognize, as I only have two - a CD-RW and DVD-RAM. Therefore, all of the music on my G: drive moved to an H: drive. This

  • Set JTable resize manual behaviour

    I've been trying for the better part of the day to implement a manual resize behavior for table column widths but without success. The JTable.setAutoResizeMode method that does this automatically has a couple of modes but not a weight mode (closest w

  • Showing data on a Desktop folder that's an Alais

    I can get a number of files in a folders I create and situated on the desktop, but if it is an alias I get nothing. Can I change this somehow?

  • FM transaction by profile

    Hi gurus, Do you know any FM or similar to obtain transactions that have assigned to a profile?? It will be similar to obtain values from object S_TCODE of a profile. I need this FM because I cannot use table AGR_TCODES. Regards, Pablo