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

Similar Messages

  • 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

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

  • Free space in temp tablespace

    SQL> show parameter block
    NAME                                 TYPE        VALUE
    db_block_buffers                     integer     0
    db_block_checking                    boolean     FALSE
    db_block_checksum                    boolean     TRUE
    db_block_size                        integer     8192
    db_file_multiblock_read_count        integer     8
    SQL> SELECT tablespace_name,
           total_blocks,
           used_blocks,
           free_blocks,
        (total_blocks*8)/1024 as total_MB,
        (used_blocks*8)/1024  as used_MB,
        (free_blocks*8)/1024  as free_MB
    FROM   v$sort_segment;
       2    3    4    5    6    7    8 
    TABLESPACE_NAME                 TOTAL_BLOCKS USED_BLOCKS FREE_BLOCKS   TOTAL_MB    USED_MB    FREE_MB
    TEMP                                   72704        2944       69760        568         23        545
    SQL>  select (sum(bytes_free)/1024/1024) Size_MB from v$temp_space_header
    order by file_id  2 
      3  /
       SIZE_MB
          1479
    SQL>
    My version is 9.2.0.7
    why temp free space is different in both queries above..
    which one is correct.....

    why temp free space is different in both queries above..Because you are looking at two different values.
    V$SORT_SEGMENT gives details about the sort segment created in a temporary tablespace. The sort segment created may or may not be of the same size as the complete temporary tablespace. In your case, the sort segment has a total size of 568 MB but only 23 MB is being used.
    V$TEMP_SPACE_HEADER refers to the physical files allocated to the temporary tablespace; so the other query is giving you the free bytes in those files.

  • Free space in temport tablespaces

    Hi. In my database i have TEMP tablespace with extent management LOCAL.
    In DBA studio it shows total space 8000M and free space 7996
    when i query v$sort_segment
    select substr(TABLESPACE_NAME,1,10) ts_name,EXTENT_SIZE,CURRENT_USERS,
    TOTAL_EXTENTS,TOTAL_BLOCKS,FREE_EXTENTS,FREE_BLOCKS
    from v$sort_segment;
    it shows
    TS_NAME EXTENT_SIZE CURRENT_USERS TOTAL_EXTENTS TOTAL_BLOCKS FREE_EXTENTS
    FREE_BLOCKS
    TEMP 128 0 7996 1023488 7996
    1023488
    where as when i query v$temp_space_header
    select TABLESPACE_NAME,BYTES_USED,BLOCKS_USED,BYTES_FREE,BLOCKS_FREe
    FROM v$temp_space_header;
    TABLESPACE_NAME BYTES_USED BLOCKS_USED BYTES_FREE BLOCKS_FREE
    TEMP 2097152000 256000 0 0
    TEMP 2097152000 256000 0 0
    TEMP 2097152000 256000 0 0
    TEMP 2097152000 256000 0 0
    I have no active queries going on in database.
    i would like to know few things..
    a). why there is a discrepency between free_extents,free_blocks of v$sort_segment
    and bytes_free_blocks_free of v$temp_space_header.
    b). if i shutdown the database and restart will this v$emp_space_header view gets updated and thus shows actual free space.
    please let me have the answers at the earliest.
    thanks in advance..

    Hi. In my database i have TEMP tablespace with extent management LOCAL.
    In DBA studio it shows total space 8000M and free space 7996
    when i query v$sort_segment
    select substr(TABLESPACE_NAME,1,10) ts_name,EXTENT_SIZE,CURRENT_USERS,
    TOTAL_EXTENTS,TOTAL_BLOCKS,FREE_EXTENTS,FREE_BLOCKS
    from v$sort_segment;
    it shows
    TS_NAME EXTENT_SIZE CURRENT_USERS TOTAL_EXTENTS TOTAL_BLOCKS FREE_EXTENTS
    FREE_BLOCKS
    TEMP 128 0 7996 1023488 7996
    1023488
    where as when i query v$temp_space_header
    select TABLESPACE_NAME,BYTES_USED,BLOCKS_USED,BYTES_FREE,BLOCKS_FREe
    FROM v$temp_space_header;
    TABLESPACE_NAME BYTES_USED BLOCKS_USED BYTES_FREE BLOCKS_FREE
    TEMP 2097152000 256000 0 0
    TEMP 2097152000 256000 0 0
    TEMP 2097152000 256000 0 0
    TEMP 2097152000 256000 0 0
    I have no active queries going on in database.
    i would like to know few things..
    a). why there is a discrepency between free_extents,free_blocks of v$sort_segment
    and bytes_free_blocks_free of v$temp_space_header.
    b). if i shutdown the database and restart will this v$emp_space_header view gets updated and thus shows actual free space.
    please let me have the answers at the earliest.
    thanks in advance..

  • Free space available in tablespace

    Hi, Any one help me how to check how much free space available on a particular Tablespace. Appreciate if you provide query.
    Thanks & Regards
    Bhaskara

    This SQL will return free space by datafile in the tablespace.
    SELECT a.name FileName, a.status, c.bytes/1024 CurrentSize, a.create_bytes/1024 SizeCreated,
    sum(b.bytes/1024) FreeSpace, max(b.bytes/1024) LargeFragment
    from sys.v_$datafile a, sys.dba_free_space b, sys.dba_data_files c
    where a.file# = b.file_id(+)
    and a.file#=c.file_id
    and c.tablespace_name='XXXXXXXXXXXXXXXXX'
    group by a.name, a.status, c.bytes, a.create_bytes
    ORDER BY a.name;
    I just posted an integrated set of GUI tools to administer the Oracle database.
    One of the many functions is to view and maintain all database objects including tablespaces and datafiles. It also has a graphical function to monitor space allocation for tablespaces. You may need same help to get started, so feel free to contact me ([email protected]). The link is http://www.barsoft.net/

  • How does repeated snapshot import impact tablespace free space?

    Hello,
    Our client is doing DEC-2014 reconciliation in FCM. Every time he changes profile mappings he has to do snapshot import again. So far he did at least ten times snapshot import for DEC-2014 period. In our FCM database Tablespace FCM_TX_TS_DATA free space is reduced 7 GB for this period already by querrying dba_free_space table.
    By my understanding during the repeated snapshot import for the same period, the previous load data is deleted and the current load data is inserted. After data delete the table space will not be set free, and high water mark will not be reset.
    During snapshot import will the deleted blocks from the previous load be reclaimed when new load data is inserted in the table? If not, what is the best way to reclaim the free space in FCM_TX_TS_DATA tablespace?
    Thanks,
    Hongfei Liu (AT&T)

    Przemek P wrote:
    Hallo. I need to replace all schemas from one server to another. I want to know how much free space will be left on /data after this kind of refresh. Both servers are Oracle 9 so I will use exp/imp. Here is how I do it. Could you check if I think good? On target server there is 72 GB free space on /data.
    Filesystem Size Used Avail Capacity Mounted
    /dev/vgsmxdata/lvsmxcopy 194.74G 122.56G 72.18G 63% /data
    Overall size of schemas to be exported from SOURCE_DB is 150 GB. The same schemas on TARGET_DB takes 90GB. So difference is 60GB. Free space in datafiles in TARGET_DB is 30GB. Does it mean that in first place the free space in datafiles will be filled and after that datafiles would be extended? That would mean that a database would extend to 150GB and free space on /data would be 40 GB after refresh. Am I right?
    yes

  • 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

  • Undo Tablespace Reuse

    Hi,
    I am using 10.2.0.3.0 on Oracle Solaris 5.10.
    I have an undo tablespace 'UNDOTBS1' which has 5 data files of sizes 60GB. Here are my undo parameters:
    SQL> show parameter undo
    NAME                                 TYPE        VALUE
    undo_management                      string      AUTO
    undo_retention                       integer     900
    undo_tablespace                      string      UNDOTBS1I have a long running batch process, which is inserting billions of records in the table and generating lots of undo. The batch is running for the last two days, and generating lots of undo and developer says that he is committing after 3 million records, though he was told to commit after 10000 records. Now all the data files of undo tablespace have become full except one, which is also getting filled up.
    I see from dba_rollback_segs that there are some 25 segments which are showing status offline.
    does it mean that the oracle will reuse those segments and I dont need to add another data file to the undo tablespace?
    How would I know during this running process, that oracle would reuse space in undo tablespace, or will just throw an error, after exhausting all the data files.
    Thanks and regards

    Hi,
    As the undo segments are used in a curcular fashion, dba_free_space may not give correct picture. use following sql.
    col PCT_USED head '% Used'
    select a.used, b.allocated, round((a.used/b.allocated)*100,2) PCT_USED, c.unexpired, d.active from
    (select sum(BYTES/1024/1024) used from dba_undo_extents where status in ('UNEXPIRED','ACTIVE')) a,
    (select bytes/1024/1024 allocated from dba_data_files where tablespace_name = 'UNDOTBS1') b ,
    (select sum(bytes/1024/1024) unexpired from dba_undo_extents where status = 'UNEXPIRED') c,
    (select sum(bytes/1024/1024) active from dba_undo_extents where status = 'ACTIVE') d
    Here ACTIVE - they are being used
    UNEXPIRED - they will not be released until the undo_retention time. But if all other extents are used, then oracle may reallocate unexpired blocks and any session which is trying to read from unexpired block may received "snapshot too old error".
    EXPIRED - here these blocks will be reused, you can consider them as free.
    Thanks,
    Siva

  • Undo tablespace resize error

    Total space occupied by UNDO tablespace is : 3G and used space for UNDO tablespace is only 512M , so approx 2.5G space is free. But when i tried to resize the undo tablespace to 1G then its showing the below error :
    ORA-03297: file contains used data beyond requested RESIZE value
    but the used data size is 512M only.
    Kindly help me to resize the undo tablespace to 1G.
    Database : Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
    Kindly suggest.
    Advance thanks !!

    you can't resize undo tablespace. If you are trying to reduce the size.
    then add a unod tablespace may like undotbs2 then set undotbs2 as default to your database. then drop the prvious undo tablespace
    Anil Malkai

  • UNDO Tablespace is used to fill frequently

    Hi Experts,
    We have an issue with the UNDO tablespace frequently,where we dont see the space occupied for any active transactions and i can see only for "Retained for Use by Queries or Flashback" i.e. more than 2000M.
    Can any one let me know how to purge this space and to free up the undo tablespace.
    FYI -
    Oracle Ver:10.2.0.2
    OS :SUN OS
    Undo Retention : 30 Mins.
    Undo tblspace size:3G
    undo_management:AUTO
    Thanks Much!!
    Senthil

    Hi,
    I think your undo tablespace contains data for inactice transactions and this is mainly because of higher value of undo_retention parameter.
    This space will be overwritten automatically as and when the space will be required by the current transaction.
    Thanks,
    Navneet

  • Checking space in a tablespace ... yes, that one again

    I know this has been done to death, but I wanted to just go over what I do when OEM alerts me to a tablespace running out of space.
    First, I check the free space of the tablespace using this query:
    SET LINESIZE 100
    COLUMN TABLESPACE FORMAT A15
    select t.tablespace,  t.totalspace as " Totalspace(MB)",
    round((t.totalspace-fs.freespace),2) as "Used Space(MB)",
    fs.freespace as "Freespace(MB)",
    round(((t.totalspace-fs.freespace)/t.totalspace)*100,2) as "% Used",
    round((fs.freespace/t.totalspace)*100,2) as "% Free"
    from
    (select round(sum(d.bytes)/(1024*1024)) as totalspace, d.tablespace_name tablespace
    from dba_data_files d
    group by d.tablespace_name) t,
    (select round(sum(f.bytes)/(1024*1024)) as freespace, f.tablespace_name tablespace
    from dba_free_space f
    group by f.tablespace_name) fs
    where t.tablespace=fs.tablespace
    order by t.tablespace;
    Secondly, I check if it is autoextendible and what the MAXBYTES is.
    select file_name, bytes/1024/1024 size_MB, AUTOEXTENSIBLE, maxbytes/1024/1024 maxsize_MB from dba_data_files where tablespace_name = 'RBPTAB';
    To my understanding, if you don't do this you wont allow for what the datafile has been allowed to autoextend up to.  The first query will only give allocated size, not the real, actual, TOTAL size that it can grow to.
    Once you know that, from query 1, there is no space left, and from 2 it is really hitting its MAXSIZE,  (compare the MAXSIZE of 2 with the Used Space(MB) column from 1) ... then add a new one.
    Does this make sense?

    so much titles included, i think you should have to reduce the size of the sql query, to understand in a meaningful way,  

  • Query to find out pertcular schema related datafiles free space????

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

    If you wish to get free space in index tablespace then use following query:
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from
    (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
    from dba_free_space group by tablespace_name) a,
    (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
    from dba_data_files group by tablespace_name
    UNION
    select tablespace_name, sum(bytes)/1024/1024 tbs_size
    from dba_temp_files
    group by tablespace_name ) b
    where a.tablespace_name(+)=b.tablespace_name
    and a.tablespace_name='INDX';
    and if you get info for all tablespace then :
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from
    (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
    from dba_free_space group by tablespace_name) a,
    (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
    from dba_data_files group by tablespace_name
    UNION
    select tablespace_name, sum(bytes)/1024/1024 tbs_size
    from dba_temp_files
    group by tablespace_name ) b
    where a.tablespace_name(+)=b.tablespace_name;

  • Segment shrinking and UNDO tablespace

    When i issued
    alter table <table_name> shrink space cascade;
    I got the error 'Unable to extend UNDO ...by 8' . Does Segment shrinking consume space from UNDO tablespace?
    Message was edited by:
    for_good_reason

    As Jonathan said, shrinking segment generates redo and undo data.
    But, this phoenomenon of undo shortage is not normal case.
    Shrinking segment might invole continous DML(deleting and re-inserting),
    but it's transaction seems to be committed internally at regular intervals.
    For this reason, shrinking operation should not hold undo area that long.
    But have no knowledge on exact behavior of shrink operation.
    Someone else will shed a light.
    How big your table and indexes?
    Some cases are reorted that shrinkage on big segment generates really large amount of undo data.
    This might be related with your problem. But not sure.
    Visit metalink note# 3888229.

  • Partition drop  not increasing free space in dba_free_spaces

    I am Using Oracle 11.2.0.3.
    I had a script that droped partitions for a table which should have dropped nearly 30 gb of data. We have data and index tablespace.
    Query of dba_free_space showed no change on data tablespace. However, index tablespace showed increase in free space.
    select  sum(bytes / (1024 * 1024 * 1024)) "Size (GB)"  from dba_free_space where tablespace_name ='&tbs_name'I am using following command to drop partition
    ALTER TABLE table_name
    DROP PARTITION "partition_name"
    UPDATE GLOBAL INDEXES;What should be done to increase free space shown for tablespace after partition drop ?
    Thanks for the time.

    >
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_3001.htm#i2131064
    ALTER TABLE table_name DROP PARTITION "partition_name" drop storage UPDATE GLOBAL INDEXES
    >
    Incorrect - the DROP STORAGE option applies to TRUNCATE PARTITION not to DROP PARTITION as the doc explains. A simple test will confirm that.
    alter table emp_part_test drop partition sys_p341 drop storage
    ORA-14048: a partition maintenance operation may not be combined with other operations

Maybe you are looking for

  • Loading  non-english  data into data target

    hi gurus, i want to load a flat file. but the flat file data  is in japanese language. can any one help me out in this issue.

  • Is there anyway to get rid of siri and get back the old voice command?

    I have found siri to be really useless. The server based approach just isn't ready for prime time. Is there a client based alternative. I am really only concerned with being able to voice dial my phone while using blue tooth in the car. Other aspects

  • It keeps repeating

    i hate ical right now, it keeps repeating what i put 50 billion x in the wrong spot help!!!

  • How XML file can be submitted to Webservices?

    Hi, In our application we have generated a XML file , which we want to submit to webservices for further processing. Could you guys please help me out on my next step to intregrate our application(which is a struts based web application) to Webservic

  • Material should be in unrestrcted

    Hi PS Guru when i use item cat "N" with material  and create PR..from PR i do PO and MIGO..but after GR material is not showing in unrestricted.. In the material procurement parameter by default take Account assignment " F".. how i will see the mater