Incorrect trapping of free space in tablespace

Hi,
We have a script that monitors tablespaces, and flags if they are getting full. The code is shown below......
select tablespace_name from
(select a.tablespace_name, a.physsp/1024/1024 psm,
nvl(b.freesp,0)/1024/1024 fsm,
nvl(b.mfreecnk,0)/1024/1024 mfs,
nvl((a.physsp + c.extdf - c.extdfact),a.physsp)/1024/1024 maxpos,
100*(a.physsp - nvl(b.freesp,0))/nvl((a.physsp + c.extdf - c.extdfact),a.physsp) maxpospct
from
(select tablespace_name, sum(bytes) physsp
from dba_data_files
group by tablespace_name) a,
(select tablespace_name, sum(bytes) freesp, max(bytes) mfreecnk
from dba_free_space
group by tablespace_name) b,
(select distinct tablespace_name, autoextensible ext,sum(maxbytes) extdf
,sum(bytes) extdfact
from dba_data_files
where autoextensible='YES'
group by tablespace_name,autoextensible) c
where b.tablespace_name (+) = a.tablespace_name
and c.tablespace_name (+) = a.tablespace_name
and a.tablespace_name not like '%UNDO%') outer
where ((outer.maxpos - outer.psm) + outer.mfs) < 500
and maxpospct > 90 ;
One tablespace is showing as either failing this test (of being > 90% full and less than 500MB free), but while it is 92% full, it has over 5gb free.....
SELECT a.name, b.tablespace_name,
substr('Free : '||sum(b.bytes)/1024/1024,1,30) File_Size
FROM dba_free_space b, v$database a
GROUP BY b.tablespace_name, a.name
UNION
SELECT a.name, b.tablespace_name,
substr('Total: '||sum(b.bytes)/1024/1024,1,30)
FROM dba_data_files b, v$database a
GROUP BY b.tablespace_name, a.name
ORDER BY 1,2,3;
NAME TABLESPACE_NAME FILE_SIZE
DB12 DATA Free : 5368.75
DB12 DATA Total: 70000
DB12 SYSAUX Free : 10.375
DB12 SYSAUX Total: 280
DB12 SYSTEM Free : 33.0625
DB12 SYSTEM Total: 500
DB12 UNDOTBS1 Free : 3055.75
DB12 UNDOTBS1 Total: 3185
DB12 USERS Free : 4.6875
DB12 USERS Total: 5
10 rows selected.
It is tablespace DATA that is complaining in the first script. This was flagged up first during a session of creating a lot of dropped indexes (data had been reimported), and at first I though it might have been something to do with the recycle bin, but a purge of that made no difference.
What's wrong?
Thanks for your help.

Hi,
We have a script that monitors tablespaces, and flags if they are getting full. The code is shown below......
select tablespace_name from
(select a.tablespace_name, a.physsp/1024/1024 psm,
nvl(b.freesp,0)/1024/1024 fsm,
nvl(b.mfreecnk,0)/1024/1024 mfs,
nvl((a.physsp + c.extdf - c.extdfact),a.physsp)/1024/1024 maxpos,
100*(a.physsp - nvl(b.freesp,0))/nvl((a.physsp + c.extdf - c.extdfact),a.physsp) maxpospct
from
(select tablespace_name, sum(bytes) physsp
from dba_data_files
group by tablespace_name) a,
(select tablespace_name, sum(bytes) freesp, max(bytes) mfreecnk
from dba_free_space
group by tablespace_name) b,
(select distinct tablespace_name, autoextensible ext,sum(maxbytes) extdf
,sum(bytes) extdfact
from dba_data_files
where autoextensible='YES'
group by tablespace_name,autoextensible) c
where b.tablespace_name (+) = a.tablespace_name
and c.tablespace_name (+) = a.tablespace_name
and a.tablespace_name not like '%UNDO%') outer
where ((outer.maxpos - outer.psm) + outer.mfs) < 500
and maxpospct > 90 ;
One tablespace is showing as either failing this test (of being > 90% full and less than 500MB free), but while it is 92% full, it has over 5gb free.....
SELECT a.name, b.tablespace_name,
substr('Free : '||sum(b.bytes)/1024/1024,1,30) File_Size
FROM dba_free_space b, v$database a
GROUP BY b.tablespace_name, a.name
UNION
SELECT a.name, b.tablespace_name,
substr('Total: '||sum(b.bytes)/1024/1024,1,30)
FROM dba_data_files b, v$database a
GROUP BY b.tablespace_name, a.name
ORDER BY 1,2,3;
NAME TABLESPACE_NAME FILE_SIZE
DB12 DATA Free : 5368.75
DB12 DATA Total: 70000
DB12 SYSAUX Free : 10.375
DB12 SYSAUX Total: 280
DB12 SYSTEM Free : 33.0625
DB12 SYSTEM Total: 500
DB12 UNDOTBS1 Free : 3055.75
DB12 UNDOTBS1 Total: 3185
DB12 USERS Free : 4.6875
DB12 USERS Total: 5
10 rows selected.
It is tablespace DATA that is complaining in the first script. This was flagged up first during a session of creating a lot of dropped indexes (data had been reimported), and at first I though it might have been something to do with the recycle bin, but a purge of that made no difference.
What's wrong?
Thanks for your help.

Similar Messages

  • Finder showing incorrect amount of free space

    After the recent Mountain Lion update, my Finder now shows an incorrect amount of free space.
    I have a 500GB hard drive, and I have about 150GB free.
    After the update, finder says I have 478.4 GB free?
    That looks like the total capacity, after you account for system software. I've done a PRAM and SCM reset, disk verification and repair, but still no joy.
    Any thoughts? Is it a bug in the update?

    Here is the answer....
    zchrykng
    Re: Hard drive available space shown incorrectly in finder Jan 12, 2012 7:35 PM (in response to ilari Korte)
    This is probably like the issue that I was having on my MacBook Pro. If you are using Time Machine on a laptop it stores the diffs in a file on your hard drive. This action can be disabled with the terminal command
    sudo tmutil disablelocal
    This turns the local Time Machine off. It is up to you if you want to do this, but Finder shows this space as unused since it can be overwritten when needed. It saved me over a hundred GBs of space.
    MacBook Pro, Mac OS X (10.7.2) 

  • Free space in tablespaces

    Hi All,
    Is it possible to collect data about free space in tablespaces in GC (in some table)?
    I'd like to have history of free space in tablespaces. Now I have some sql script which is triggered once per day and store output in the file.

    Hi All,
    Is it possible to collect data about free space in tablespaces in GC (in some table)?
    I'd like to have history of free space in tablespaces. Now I have some sql script which is triggered once per day and store output in the file.

  • Stange free space in tablespace

    Checking a space usage of my tablespace using those queries http://vsbabu.org/oracle/sect03.html (especially query which name USAGE) shows me that one of my table is about 100GB big, but 90GB is free space?! So only 10% of space is used. Can I do something with this "empty" space?

    Sure. Below is listing from my all tablespaces files:
    'FILE_NAME' USER_BYTES/1024/1024   BYTES/1024/1024        MAXBYTES/1024/1024     AUTOEXTENSIBLE
    file_name_1    4,9375                 5                      32767,984375           YES           
    file_name_2    32767,875              32767,984375           32767,984375           YES           
    file_name_3    613,125                613,1875               32767,984375           YES           
    file_name_4    5219,9375              5220                   32767,984375           YES           
    file_name_5    32767,875              32767,984375           32767,984375           YES           
    file_name_6    9071,625               9071,6875              32767,984375           YES           
    file_name_7    74,9375                75                     32767,984375           YES           
    file_name_8    32767,875              32767,984375           32767,984375           YES           
    file_name_9    32767,875              32767,984375           32767,984375           YES           
    file_name_10   24,9375                25                     32767,984375           YES           
    file_name_11   32767,875              32767,984375           32767,984375           YES           
    file_name_12   191,75                 191,8125               32767,984375           YES           
    file_name_13   124,9375               125                    32767,984375           YES           
    file_name_14   9669,9375              9670                   32767,984375           YES           
    file_name_15   29851,875              29852                  32767,984375           YES           
    file_name_16   1000,6875              1000,75                32767,984375           YES           
    file_name_17   32767,875              32767,984375           32767,984375           YES           
    file_name_18   32761,9375             32762,0625             32767,984375           YES           
    file_name_19   20031,9375             20032                  32767,984375           YES           
    file_name_20   22171,9375             22172                  32767,984375           YES           
    file_name_21   3999,9375              4000                   0                      NO            
    file_name_22   49,9375                50                     32767,984375           YES           
    22 rows selected At this output it doesn't look as bad as in previous queries, does it?
    Edited by: lesak on Jun 18, 2011 11:29 AM

  • Calculating free space in tablespace

    Oracle 11.0.1.7:
    I am trying to calculate free space in the tablespace but I am not sure if Allocated Space (bytes_used) also has some free space that doesn't get reflected in the query below. Is it correct to assume that bytes_used is the space allocated to extents but may not have been really used (no data or LOB) yet? How do I calculate space that's currently been used by row data, index data or blob data?
    I am currently using below query:
    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

    DBA_FREE_SPACE give you the free space information which has not been allocated to any segment. The segments can also have free space in their allocated space and in order to find that, use DBMS_SPACE.SPACE_USAGE procedure. To find out free space in LOB segments refer to metalink doc: 386341.1
    Thanks
    Daljit Singh

  • Incorrect "Available" and "Free Space" Indications

    Dear All
    I have installed a second (internal) HD in my computer (no partition). Recently I have tried to free space on this HD by deleting files (moving them to trash). But when I click on the 'get info' link for the HD, the disk space indication 'available' and 'used' doesn't change (even after a restart).
    I used the Terminal and installed the WhatSize application to see if any hidden folders (.trashes) are keeping the deleted files on my HD. But even WhatSize is giving wrong disk size indications (when I add up the GBs it doesn't equal the used GBs idicated). I keep on deleting files from my HD but available disk space is not increasing.
    So far, I have not emptied my trash ... but will that solve the problem???
    thanks for your help,
    Hynek
    G5   Mac OS X (10.4.6)  

    Hi Hynek
    Sending to trash and emptying the trash works like this.
    Every file occupies a physical location on the Hard Drive. The larger the file the more space it occupies. This physical location is reserved especially for the file so nothing else can be placed there.
    When you put a file in the trash, the file is not moved; it still stays there occupying the same space, but its status changes to 'unusable'; it cannot be opened, but its location is still reserved for itself only.
    If you drag the file out of the trash, its status is restored back to 'useable'.
    If you drag it to the trash ( status changes to 'unusable' ) and then empty the trash, the space it occupies also further changes its status to 'unreserved space' or available space. This means that the space currently occupied by this file is eligible to be overwritten by any new file that will fit there.
    By emptying the trash, which causes an increase in 'unreserved space' means there is new space now available. So your computer reports more available space.
    regards roam

  • Doubt in considering temp tablespace's free space

    Hi All,
    Database: oracle 11.2
    Operating System: AIX
    I want to know how much free space available in my temp tablespace
    I ran below scripts
    select sum((bytes_free)/1024/1024/1024) GB from v$temp_space_header
    +52.904296875+
    select (tablespace_size)/1024/1024/1024 tablespace_size_in_gb,
    +(allocated_space)/1024/1024/1024 allocated_space_in_gb,+
    +(free_space)/1024/1024/1024 free_space_in_gb+
    from dba_temp_free_space
    tablespace_size_in_gb: 98.9990234375
    allocated_space_in_gb: 46.0947265625
    free_space_in_gb:151.81640625
    So my doubt is which one from above two script gives actual free space information ?
    Also in dba_temp_free_space view why free space size > tablespace size ?

    v$temp_space_header shows you how big the temp tablespace has got since the database was restarted. It doesn't give you the current free/used space.
    See the link for dba_temp_free_space, but I think it may be the way it reports free space which is why you're seeing it as more than the actual tablespace. As you can see form the description "space that is currently allocated and available for resuse" is calculated for both allocated space and free space.
    http://docs.oracle.com/cd/B28359_01/server.111/b28320/statviews_5056.htm
    >
    ALLOCATED_SPACE = space that is currently allocated and used + space that is currently allocated and available for reuse
    FREE_SPACE = space that is currently allocated and available for reuse + space that is currently unallocated>
    I use the below script which I've plagiarised from somewhere ages ago to get the used/free temp space.
    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;

  • My iPhone 4s in iTunes shows incorrect free space!

    Okay, this is very odd... when my iPhone 4S is plugged in, it says that I have way more free space than should be available?  What in the world is going on?  I wished I had the 64 GB iPhone, but I don't.  It seems to incorrectly calculate my free space on my iPhone 4S repeatedly.  I am doing a restore of my iPhone right now, hoping that will address the issue.  Now I do have iTune Match turned on and am wondering if that has something to do with this?  It seems to get confused with what I had on my iPhone and what is in iTune Mactch.  I only saw this after doing the iTune Match thingy.

    Hey - did you get anywhere with this?
    I have the exact same problem and it is definitely related to iTunes Match (I enabled 24 hours ago and the problem started immediately).
    In my case the actual phone displays the correct information (about 1.3gb free) but via iTunes (either connecting over wifi or over usb) it displays 19.4 gb free.
    In my case the difference is almost exactly the size of my iTunes library.
    Here is what I belive is happening (no fix yet).
    I have enabled iTunes Match on my phone but I have left the song files on the phone (i.e. I play files actually from the device and not from the cloud) . Now, when I connect to iTunes, iTunes sees merely that iTunes Match is enabled and therefore belives that the phone does not contain any downloaded music (or at least did not contain any at the point iTunes Match was enabled) and therefore displays a library-size chunk as free space.
    One fix which I suspect would work would be to delete my entire library from the iPhone, enable itunes Match and redownload the entire library from the phone. That however is not something I want to entertain at present.
    This has to be a bug at Apple's end - I hope they fix it soon!

  • ITunes syncing error reports not enough free space

    Having an issue with syncing the iPad where iTunes reports that there is not enough free space to transfer the selected data. In this case it was an app(The Elements) which is 1.78 GB. The iPad has 3.8 GB free space, yet the app cannot be transfered because there is "Insufficient space". I used to see the same problem with my iPhone when attempting to sync back the photos i just copied off the camera app. There is definately free space, but iTunes seems to see something different than what is reported.
    BTW. I could not sync the app to the iPad using iTunes, but there was enough free space to directly download the app on the iPad. Seems like a problem with iTunes to me.
    Is iTunes and the iPad reporting an incorrect amount of free space? Can iTunes be forced to transfer apps without checking for the amount of free space? Any other ideas?

    It seems like double the size of the app is needed to install it on the device.

  • How to find free space in datafiles of perticular schema?

    hai,
    whats the query to find out free space in datafiles and index files related free space for perticular schmea?
    Regards
    dba

    There are lots of scripts available on Metalink which report free space in tablespaces/datafiles.
    Note: 1019999.6 - Script: To List Tablespace, Datafiles and Free Space
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=1019999.6
    Note: 145531.1 - How to Determine Which Tablespaces Do Not Have Enough Free Space
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=145531.1

  • Performance problem - Tablespace Free Space

    Hi,
    Version 10204
    I am running the following statment in order to monitor tablespace free space.
    There are some tablespaces that i am not interesting to monitor , and i also whant to be alert
    only when less than 4 GB left in the tablespace.
    I build the following statment.
    Using the hint : /*+ NO_CPU_COSTING */ gave me the best performance but there are alot of time
    that its took to this statment few minute to run befor it finished.
    Could one help to improve its performance ?
    Please note that it performe even less good when i used the RULE hint or not using hint at all.
    SELECT  /*+ gather_plan_statistics */  'tablespace_free_space;'||to_char(pct_used,'999.99')||','||TBSNAME
    FROM( SELECT *
          FROM( SELECT NVL(b.tablespace_name, NVL(a.tablespace_name,'UNKOWN')) TBSNAME,
                       MBytes_alloc,
                           maxbytes,
                           MBytes_max,
                       ROUND(MBytes_alloc-NVL(MBytes_free,0),2) used,
                       ROUND(NVL(MBytes_free,0),2) free,
                       MBytes_free,
                       ROUND(DECODE( MBytes_max, 0,((MBytes_alloc-NVL(MBytes_free,0))/MBytes_alloc)*100,100*(MBytes_alloc) / maxbytes),2)PCT_USED
                FROM ( SELECT /*+ NO_CPU_COSTING */  SUM(bytes)/1024/1024 MBytes_free,
                              MAX(bytes)/1024/1024 largest,
                              tablespace_name
                       FROM   sys.DBA_FREE_SPACE
                       WHERE  TABLESPACE_NAME NOT IN
                              ('Q405_CALLS_TS','Q405_ICALLS_TS',
                               'Q305_CALLS_TS','Q305_ICALLS_TS',
                               'Q205_ICALLS_TS','Q306_CALLS_TS',
                               'Q406_CALLS_TS','Q206_CALLS_TS',
                               'Q205_CALLS_TS','Q105_CALLS_TS',
                               'Q105_ICALLS_TS','Q206_CALLS_TS','Q106_CALLS_TS',
                               'Q306_ICALLS_TS','Q107_ICALLS_TS','Q406_ICALLS_TS',
                               'Q206_ICALLS_TS','UNLMT_INTERNET_CALLS_2006_TS',
                               'UNLMT_INTERNET_CALLS_2007_TS',
                               'UNLMT_INTERNET_CALLS_2008_TS',
                               'Q107_ICALLS_TBS','Q107_CALLS_TBS',
                               'Q207_ICALLS_TBS','Q207_CALLS_TBS',
                               'Q307_ICALLS_TBS','Q307_CALLS_TBS',
                               'Q407_ICALLS_TBS','Q407_CALLS_TBS',
                               'Q408_ICALLS_TS','Q408_CALLS_TS',
                               'Q308_ICALLS_TS','Q308_CALLS_TS',
                               'Q208_ICALLS_TS','Q208_CALLS_TS',
                               'Q108_ICALLS_TS','Q108_CALLS_TS',
                               'Q109_ICALLS_TS','Q109_CALLS_TS',
                               'UNLMT_INT_CALLS_Q308_TS',
                               'UNLMT_INT_ICALLS_Q308_TS',
                               'UNLMT_INT_CALLS_Q408_TS',
                               'UNLMT_INT_ICALLS_Q408_TS'
                       GROUP BY tablespace_name ) a,
                     ( SELECT  SUM(bytes)/1024/1024 MBytes_alloc,
                              SUM(maxbytes)/1024/1024 MBytes_max,
                              SUM(DECODE (autoextensible,'YES',maxbytes/1024/1024,'NO', BYTES/1024/1024 )) maxbytes,
                              tablespace_name
                       FROM   DBA_DATA_FILES
                       WHERE  TABLESPACE_NAME NOT IN
                              ('Q405_CALLS_TS','Q405_ICALLS_TS',
                               'Q305_CALLS_TS','Q305_ICALLS_TS',
                               'Q205_ICALLS_TS','Q306_CALLS_TS',
                               'Q406_CALLS_TS','Q206_CALLS_TS',
                               'Q205_CALLS_TS','Q105_CALLS_TS',
                               'Q105_ICALLS_TS','Q206_CALLS_TS',
                               'Q106_CALLS_TS','Q306_ICALLS_TS',
                               'Q107_ICALLS_TS','Q406_ICALLS_TS',
                               'Q206_ICALLS_TS','UNLMT_INTERNET_CALLS_2006_TS',
                               'UNLMT_INTERNET_CALLS_2007_TS',
                               'UNLMT_INTERNET_CALLS_2008_TS',
                               'Q107_ICALLS_TBS','Q107_CALLS_TBS',
                               'Q207_ICALLS_TBS','Q207_CALLS_TBS',
                               'Q307_ICALLS_TBS','Q307_CALLS_TBS',
                               'Q407_ICALLS_TBS','Q407_CALLS_TBS',
                               'Q408_ICALLS_TS','Q408_CALLS_TS',
                               'Q308_ICALLS_TS','Q308_CALLS_TS',
                               'Q208_ICALLS_TS','Q208_CALLS_TS',
                               'Q108_ICALLS_TS','Q108_CALLS_TS',
                               'Q109_ICALLS_TS','Q109_CALLS_TS',
                               'UNLMT_INT_CALLS_Q308_TS',
                               'UNLMT_INT_ICALLS_Q308_TS',
                               'UNLMT_INT_CALLS_Q408_TS',
                               'UNLMT_INT_ICALLS_Q408_TS'
                       GROUP BY tablespace_name) b
                WHERE a.tablespace_name (+) = b.tablespace_name
                AND (a.MBytes_free<4000 or a.MBytes_free is null)
             ORDER BY PCT_USED DESC
    WHERE TBSNAME not in (select tablespace_name from dba_tablespaces where contents in ('UNDO'))
    and ROWNUM =1;
    select * from table(dbms_xplan.display_cursor('42hppgtx2h1gb',0,'ALLSTATS LAST'));
    Plan hash value: 2979461796
    PLAN_TABLE_OUTPUT
    | Id  | Operation                               | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |*  1 |  COUNT STOPKEY                          |                  |      1 |        |      1 |00:00:15.52 |     146K|   8927 |       |       |      |
    |*  2 |   FILTER                                |                  |      1 |        |      1 |00:00:15.52 |     146K|   8927 |       |       |      |
    |   3 |    VIEW                                 |                  |      1 |      3 |      1 |00:00:15.52 |     146K|   8927 |       |       |      |
    |   4 |     SORT ORDER BY                       |                  |      1 |      3 |      1 |00:00:15.52 |     146K|   8927 |  2048 |  2048 | 2048  (0)|
    |*  5 |      FILTER                             |                  |      1 |        |     16 |00:00:15.52 |     146K|   8927 |       |       |      |
    |*  6 |       HASH JOIN OUTER                   |                  |      1 |      3 |     25 |00:00:15.52 |     146K|   8927 |   561K|   561K|  982K (0)|
    |   7 |        VIEW                             |                  |      1 |      2 |     25 |00:00:02.95 |     105K|      0 |       |       |      |
    |   8 |         HASH GROUP BY                   |                  |      1 |      2 |     25 |00:00:02.95 |     105K|      0 |   447K|   447K|  977K (0)|
    |   9 |          VIEW                           | DBA_DATA_FILES   |      1 |      2 |    217 |00:00:03.25 |     105K|      0 |       |       |      |
    |  10 |           UNION-ALL                     |                  |      1 |        |    217 |00:00:03.25 |     105K|      0 |       |       |      |
    |  11 |            NESTED LOOPS                 |                  |      1 |      1 |      0 |00:00:00.67 |     219 |      0 |       |       |      |
    |  12 |             NESTED LOOPS                |                  |      1 |      1 |      0 |00:00:00.67 |     219 |      0 |       |       |      |
    |  13 |              MERGE JOIN CARTESIAN       |                  |      1 |      1 |  52297 |00:00:00.22 |       0 |      0 |       |       |      |
    |* 14 |               FIXED TABLE FULL          | X$KCCFN          |      1 |      1 |    217 |00:00:00.01 |       0 |      0 |       |       |      |
    |  15 |               BUFFER SORT               |                  |    217 |    100 |  52297 |00:00:00.06 |       0 |      0 | 11264 | 11264 |10240  (0)|
    |  16 |                FIXED TABLE FULL         | X$KCCFE          |      1 |    100 |    241 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 17 |              TABLE ACCESS BY INDEX ROWID| FILE$            |  52297 |      1 |      0 |00:00:00.52 |     219 |      0 |       |       |      |
    |* 18 |               INDEX UNIQUE SCAN         | I_FILE1          |  52297 |      1 |    217 |00:00:00.24 |       2 |      0 |       |       |      |
    |* 19 |             TABLE ACCESS CLUSTER        | TS$              |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 20 |              INDEX UNIQUE SCAN          | I_TS#            |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |  21 |            NESTED LOOPS                 |                  |      1 |      1 |    217 |00:00:02.58 |     105K|      0 |       |       |      |
    |  22 |             NESTED LOOPS                |                  |      1 |      1 |  52297 |00:00:01.89 |     104K|      0 |       |       |      |
    |  23 |              MERGE JOIN CARTESIAN       |                  |      1 |      1 |  52297 |00:00:00.22 |     217 |      0 |       |       |      |
    |  24 |               NESTED LOOPS              |                  |      1 |      1 |    217 |00:00:00.02 |     217 |      0 |       |       |      |
    |* 25 |                FIXED TABLE FULL         | X$KCCFN          |      1 |      1 |    217 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 26 |                FIXED TABLE FIXED INDEX  | X$KTFBHC (ind:1) |    217 |      1 |    217 |00:00:00.01 |     217 |      0 |       |       |      |
    |  27 |               BUFFER SORT               |                  |    217 |    100 |  52297 |00:00:00.11 |       0 |      0 | 11264 | 11264 |10240  (0)|
    |  28 |                FIXED TABLE FULL         | X$KCCFE          |      1 |    100 |    241 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 29 |              TABLE ACCESS CLUSTER       | TS$              |  52297 |      1 |  52297 |00:00:01.41 |     104K|      0 |       |       |      |
    |* 30 |               INDEX UNIQUE SCAN         | I_TS#            |  52297 |      1 |  52297 |00:00:00.37 |       2 |      0 |       |       |      |
    |* 31 |             TABLE ACCESS BY INDEX ROWID | FILE$            |  52297 |      1 |    217 |00:00:00.57 |     219 |      0 |       |       |      |
    |* 32 |              INDEX UNIQUE SCAN          | I_FILE1          |  52297 |      1 |    217 |00:00:00.28 |       2 |      0 |       |       |      |
    |  33 |        VIEW                             |                  |      1 |   1401 |     25 |00:00:12.56 |   40846 |   8927 |       |       |      |
    |  34 |         HASH GROUP BY                   |                  |      1 |   1401 |     25 |00:00:12.56 |   40846 |   8927 |   465K|   465K|  982K (0)|
    |  35 |          VIEW                           | DBA_FREE_SPACE   |      1 |   1401 |  73133 |00:00:14.19 |   40846 |   8927 |       |       |      |
    |  36 |           UNION-ALL                     |                  |      1 |        |  73133 |00:00:14.04 |   40846 |   8927 |       |       |      |
    |  37 |            NESTED LOOPS                 |                  |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    |  38 |             NESTED LOOPS                |                  |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    |  39 |              TABLE ACCESS FULL          | FET$             |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 40 |              INDEX UNIQUE SCAN          | I_FILE2          |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 41 |             TABLE ACCESS CLUSTER        | TS$              |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |  42 |            NESTED LOOPS                 |                  |      1 |      5 |   7271 |00:00:00.20 |    1156 |      0 |       |       |      |
    |  43 |             NESTED LOOPS                |                  |      1 |      6 |   7271 |00:00:00.14 |    1154 |      0 |       |       |      |
    |* 44 |              TABLE ACCESS FULL          | TS$              |      1 |      2 |     25 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 45 |              FIXED TABLE FIXED INDEX    | X$KTFBFE (ind:1) |     25 |      3 |   7271 |00:00:00.11 |    1109 |      0 |       |       |      |
    |* 46 |             INDEX UNIQUE SCAN           | I_FILE2          |   7271 |      1 |   7271 |00:00:00.04 |       2 |      0 |       |       |      |
    |  47 |            NESTED LOOPS                 |                  |      1 |   1394 |  65862 |00:00:17.73 |   39476 |   8927 |       |       |      |
    |  48 |             NESTED LOOPS                |                  |      1 |  30528 |  65862 |00:00:16.94 |   39474 |   8927 |       |       |      |
    |* 49 |              HASH JOIN                  |                  |      1 |   2540 |   8927 |00:00:00.03 |      90 |      0 |   811K|   811K| 1397K (0)|
    |  50 |               TABLE ACCESS FULL         | RECYCLEBIN$      |      1 |   8319 |   8935 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 51 |               TABLE ACCESS FULL         | TS$              |      1 |      2 |     25 |00:00:00.01 |      45 |      0 |       |       |      |
    |* 52 |              FIXED TABLE FIXED INDEX    | X$KTFBUE (ind:1) |   8927 |     12 |  65862 |00:00:11.66 |   39384 |   8927 |       |       |      |
    |* 53 |             INDEX UNIQUE SCAN           | I_FILE2          |  65862 |      1 |  65862 |00:00:00.45 |       2 |      0 |       |       |      |
    |* 54 |            TABLE ACCESS BY INDEX ROWID  | RECYCLEBIN$      |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |  55 |             NESTED LOOPS                |                  |      1 |      1 |      1 |00:00:00.01 |     169 |      0 |       |       |      |
    |  56 |              NESTED LOOPS               |                  |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |  57 |               NESTED LOOPS              |                  |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |  58 |                TABLE ACCESS FULL        | UET$             |      1 |      1 |      0 |00:00:00.01 |     169 |      0 |       |       |      |
    |* 59 |                INDEX UNIQUE SCAN        | I_FILE2          |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 60 |               TABLE ACCESS CLUSTER      | TS$              |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 61 |                INDEX UNIQUE SCAN        | I_TS#            |      0 |      1 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 62 |              INDEX RANGE SCAN           | RECYCLEBIN$_TS   |      0 |   1188 |      0 |00:00:00.01 |       0 |      0 |       |       |      |
    |* 63 |    TABLE ACCESS FULL                    | TS$              |      1 |      1 |      0 |00:00:00.01 |      45 |      0 |       |       |      |
    Predicate Information (identified by operation id):
       1 - filter(ROWNUM=1)
       2 - filter( IS NULL)
       5 - filter(("A"."MBYTES_FREE"<4000 OR "A"."MBYTES_FREE" IS NULL))
       6 - access("A"."TABLESPACE_NAME"="B"."TABLESPACE_NAME")
      14 - filter(("INST_ID"=USERENV('INSTANCE') AND "FNNAM" IS NOT NULL AND BITAND("FNFLG",4)<>4 AND "FNTYP"=4))
    PLAN_TABLE_OUTPUT
      17 - filter(("F"."SPARE1" IS NULL AND "F"."TS#" IS NOT NULL))
      18 - access("FE"."FENUM"="F"."FILE#")
           filter("FNFNO"="F"."FILE#")
      19 - filter(("TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' ... AND "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      20 - access("F"."TS#"="TS"."TS#")
      25 - filter(("INST_ID"=USERENV('INSTANCE') AND "FNNAM" IS NOT NULL AND BITAND("FNFLG",4)<>4 AND "FNTYP"=4))
      26 - filter("FNFNO"="HC"."KTFBHCAFNO")
      29 - filter(("TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' AND ... AND "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      30 - access("HC"."KTFBHCTSN"="TS"."TS#")
      31 - filter("F"."SPARE1" IS NOT NULL)
      32 - access("FE"."FENUM"="F"."FILE#")
           filter("FNFNO"="F"."FILE#")
      40 - access("F"."TS#"="FI"."TS#" AND "F"."FILE#"="FI"."RELFILE#")
    PLAN_TABLE_OUTPUT
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
      41 - filter(("TS"."TS#"="F"."TS#" AND "TS"."BITMAPPED"=0 AND "TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' AND
                  "TS"."NAME"<>'Q305_CALLS_TS' AND "TS"."NAME"<>'Q305_ICALLS_TS' AND ... "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      44 - filter(("TS"."BITMAPPED"<>0 AND INTERNAL_FUNCTION("TS"."ONLINE$") AND .... "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      45 - filter("TS"."TS#"="F"."KTFBFETSN")
      46 - access("F"."KTFBFETSN"="FI"."TS#" AND "F"."KTFBFEFNO"="FI"."RELFILE#")
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
      49 - access("TS"."TS#"="RB"."TS#")
      51 - filter(("TS"."BITMAPPED"<>0 AND INTERNAL_FUNCTION("TS"."ONLINE$") AND...."TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      52 - filter(("U"."KTFBUESEGTSN"="RB"."TS#" AND "U"."KTFBUESEGFNO"="RB"."FILE#" AND "U"."KTFBUESEGBNO"="RB"."BLOCK#"))
      53 - access("RB"."TS#"="FI"."TS#" AND "U"."KTFBUEFNO"="FI"."RELFILE#")
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
    PLAN_TABLE_OUTPUT
      54 - filter(("U"."SEGFILE#"="RB"."FILE#" AND "U"."SEGBLOCK#"="RB"."BLOCK#"))
      59 - access("U"."TS#"="FI"."TS#" AND "U"."SEGFILE#"="FI"."RELFILE#")
           filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
      60 - filter(("TS"."BITMAPPED"=0 AND "TS"."NAME"<>'Q405_CALLS_TS' AND .... AND "TS"."NAME"<>'UNLMT_INT_CALLS_Q408_TS' AND
                  "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
      61 - access("TS"."TS#"="U"."TS#")
      62 - access("U"."TS#"="RB"."TS#")
      63 - filter((DECODE("TS"."CONTENTS$",0,DECODE(BITAND("TS"."FLAGS",16),16,'UNDO','PERMANENT'),1,'TEMPORARY')='UNDO' AND "TS"."ONLINE$"<>3 AND
                  BITAND("FLAGS",2048)<>2048 AND LNNVL("TS"."NAME"<>:B1)))
    Note
    PLAN_TABLE_OUTPUT
       - cpu costing is off (consider enabling it)

    Version 10204
    I am running the following statment in order to monitor tablespace free space.
    There are some tablespaces that i am not interesting to monitor , and i also whant to be alert
    only when less than 4 GB left in the tablespace.
    And just adding to Dan's reply, if you are on 10g as you mentioned, why not to use the built in Alert mechanism to monitor and get alerts about the tablespace usage using the GC or Database Console than creating a home grown solution like the one you have posted?
    Aman....

  • To know the amount of free space in a tablespace

    hi,
    I'm learning oracle 9i release 9.2.0.1.0 .I'd created a tablespace 'TOOLS' for being used as the default tablespace for Statspack.
    I wish to know the amount of free space available in this tablespace. For this purpose I ran the following query but there was no rows selected :-
    SQL> select tablespace_name,bytes from dba_free_space
    2 where tablespace_name='TOOLS';
    no rows selected
    SQL> select name from v$tablespace;
    NAME
    CWMLITE
    DRSYS
    EXAMPLE
    INDX
    ODM
    SYSTEM
    TOOLS
    UNDOTBS1
    USERS
    XDB
    TEMP
    Can anyone tell the reason for this.

    I tried your query
    SQL> select TABLESPACE_NAME,
    2 sum(BYTES) Total_free_space,
    3 max(BYTES) largest_free_extent
    4 from dba_free_space
    5 group by TABLESPACE_NAME;
    ♀TABLESPACE_NAME TOTAL_FREE_SPACE LARGEST_FREE_EXTENT
    CWMLITE 11141120 10878976
    DRSYS 10813440 10813440
    EXAMPLE 131072 131072
    INDX 26148864 26148864
    ODM 11206656 11206656
    SYSTEM 3211264 3080192
    UNDOTBS1 199229440 196149248
    USERS 26083328 26083328
    XDB 196608 196608
    9 rows selected.
    Again there were no rows for TOOLS tablespace.

  • How to find free space in a Tablespace?

    Hi,
    I have a limited access to objects in my database ( do not have access to many tables).
    I have been allocated 300GB of size in my tablespace which allows me to create my objects.
    Now, I want to find out how much of this tablespace size allocated to me have been used up. I do not have access to dba_data_files or dba_segments.
    Is there a way out for me? Could anyone show me a way please?

    This query will give you the required information but it makes use of DBA tables.
    SELECT B.TABLESPACE_NAME, TBS_SIZE SIZEGB, A.FREE_SPACE FREEGB
    from  (select tablespace_name, round(sum(bytes)/1024/1024/1024 ,2) as free_space
           from dba_free_space
           GROUP BY TABLESPACE_NAME) A,
          (select tablespace_name, sum(bytes)/1024/1024/1024 as tbs_size
           from dba_data_files
           group by tablespace_name) b
    where a.tablespace_name(+)=b.tablespace_name;
    However, you said that you are aware of your tablespace details so the above query can be modified to get the free space in your tablespace. Now I am using user_frees_space and not dba_free_space. Generally user* tables are and should be made accessible to the users.
    select  tablespace_name, round(sum(bytes)/1024/1024/1024 ,2) as free_space
    from    user_free_space
    where   tablespace_name = 'Your tablespace name'
    GROUP BY TABLESPACE_NAME;
    Ishan

  • Free space in UNDO tablespace

    Hi,
    in DB version 9.2.0, after all transactions are committed, the occupied blocks in UNDO tablespace will be free or not ?
    The same just after startup, before any transaction the free space in UNDO tablespace would be at max ?
    Many thanks.

    Hello Dear copy this script and paste in the sql prompt and it will show your how much total space table have, or how much is used and how much it is free
    SELECT Total.name "Tablespace Name",
    nvl(Free_space, 0) Free_space,
    nvl(total_space-Free_space, 0) Used_space,
    total_space
    FROM
    (select tablespace_name, sum(bytes/1024/1024) Free_Space
    from sys.dba_free_space
    group by tablespace_name
    ) Free,
    (select b.name, sum(bytes/1024/1024) TOTAL_SPACE
    from sys.v_$datafile a, sys.v_$tablespace B
    where a.ts# = b.ts#
    group by b.name
    ) Total
    WHERE Free.Tablespace_name(+) = Total.name
    ORDER BY Total.name

  • Checking tablespace used space, free space in ASM

    Hi,
    I want to find the tablespace used space, free space, total space in an ASM (Automatic Storage Management) environment. What is the query for that ?
    Thanks

    want to find the tablespace used space, free spaceUse same script that u are used in non-asm environment.
    dba_data_files
    dba_free_space
    total space in an ASM (Automatic Storage Management) environment.select name, type, total_mb, free_mb, required_mirror_free_mb,
    usable_file_mb from v$asm_diskgroup;
    Thanks
    Kuljeet

Maybe you are looking for

  • ITunes says "the disk John's ipod cannot be read from or written to"

    it also says "required file can't be found" hp pavillion mx70    

  • User can't receive mail; sending ok

    Hi, have read almost all mail topics, tried a lot of information, but nothing changed. user has enabled mail in workgroup manager (both pop and imap) and in server admin(settings/access/services/mail) and server preferences/users/services don't know

  • The printer page size setting is not working in Photoshop 5.1 with Xerox printer

    I am attempting to print an output size larger than 8.5 x 11 and Photoshop will not change the size even though the printer setting is now at the larger size.  Illustrator and other programs will print but but Photoshop fails.  This is an issue in bo

  • Design View Not Working Properly

    Hi, I save my web site files as .php and I'm using DW CS5. When I switch to Design View all I get are a couple of icons. Why won't it display the page for me?

  • BSP and Webdynpro

    I have been doing development in Webdynpro and a BSP application and was wondering if these two are being executed at the same time with the same port, will there be conflicts and one will have issues being displayed in a web browser?