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

Similar Messages

  • Tablespace used and free space size in 9i

    Hi,
    How to find the tablespace used space and tablespace free space in 9i.
    Normally i uses below query in 10g and 11g, but this query not working in 9i. Please help the query for 9i....
    SELECT /* + RULE */ df.tablespace_name "Tablespace",
    df.bytes / (1024 * 1024) "Size (MB)",
    SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
    Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
    Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
    FROM dba_free_space fs,
    (SELECT tablespace_name,SUM(bytes) bytes
    FROM dba_data_files
    GROUP BY tablespace_name) df
    WHERE fs.tablespace_name (+) = df.tablespace_name
    GROUP BY df.tablespace_name,df.bytes
    UNION ALL
    SELECT /* + RULE */ df.tablespace_name tspace,
    fs.bytes / (1024 * 1024),
    SUM(df.bytes_free) / (1024 * 1024),
    Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
    Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
    FROM dba_temp_files fs,
    (SELECT tablespace_name,bytes_free,bytes_used
    FROM v$temp_space_header
    GROUP BY tablespace_name,bytes_free,bytes_used) df
    WHERE fs.tablespace_name (+) = df.tablespace_name
    GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
    ORDER BY 4 DESC;
    Regards,
    Pravin

    hi,
    try this
    /* TOTAL, FREE AND USED SPACE IN TABLESPACES */ 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;
    and you can have a look this thred. it will be hellp you
    query to check tablespace size and freespace
    regards,

  • Daafiles used and free space

    hii everybody,
    i want to check the used and free space of all datafiles of my database(10.2.0.3),platform redhat 5.7 .
    your help is highly appreciated thanks.
    Edited by: 938946 on Dec 31, 2012 4:38 AM

    938946 wrote:
    can you please tell me why temp tablespace's %used is showing in negative.
    (tablespace name)TEMP (size in MB)1100221 (Free in MB)48.375 (%Free)94 (%Used)-1913Without seeing what you actually have, I can only guess, but as I said, you have the aggregations messed up in both halves of your query.
    The second half of your original query (below the UNION ALL) is the bit that calculates the space for the temp tablespace. It looks to me as if you have multiple files in your temp tablespace and that the files actually have at least two different sizes. This is from one of my databases the has that situation, and builds up to the query that you are using to get the temporary tablespace information.
    The basic dba_temp_files query:
    SQL> select tablespace_name, bytes
      2  from dba_temp_files;
    TABLESPACE_NAME                     BYTES
    TMP                            2146500608
    TMP                            2146500608
    TMP                            1072758784The basic v$temp_space_header query:
    SQL> SELECT tablespace_name,bytes_free,bytes_used
      2  FROM v$temp_space_header;
    TABLESPACE_NAME                BYTES_FREE BYTES_USED
    TMP                                     0 2146500608
    TMP                                     0 1072758784
    TMP                                     0 2146500608Your query against v$temp_space_header
    SQL> SELECT tablespace_name,bytes_free,bytes_used
      2  FROM v$temp_space_header
      3  GROUP BY tablespace_name,bytes_free,bytes_used;
    TABLESPACE_NAME                BYTES_FREE BYTES_USED
    TMP                                     0 1072758784
    TMP                                     0 2146500608The basic join of your two queries without the aggregation. I added the file_id and bytes columns from dba_temp_files and the bytes_free and bytes_used columns from v$temp_space_header to make what is happening clearer.
    SQL> SELECT df.tablespace_name tspace, fs.file_id, fs.bytes, df.bytes_free,
      2         df.bytes_used, fs.bytes / (1024 * 1024) bytes_mb,
      3         df.bytes_free / (1024 * 1024) bytes_free_mb,
      4         ((fs.bytes - df.bytes_used) * 100) / fs.bytes bytes_minus_used,
      5         ((fs.bytes - df.bytes_free) * 100) / fs.bytes bytes_minus_free
      6  FROM dba_temp_files fs,
      7       (SELECT tablespace_name,bytes_free,bytes_used
      8        FROM v$temp_space_header
      9        GROUP BY tablespace_name,bytes_free,bytes_used) df
    10  WHERE fs.tablespace_name  = df.tablespace_name
    11  ORDER BY 1, 3, 4, 5;
    TSPACE        FILE_ID      BYTES BYTES_FREE BYTES_USED   BYTES_MB BYTES_FREE_MB BYTES_MINUS_USED BYTES_MINUS_FREE
    TMP                 3 1072758784          0 1072758784  1023.0625             0                0              100  -- Group 1
    TMP                 3 1072758784          0 2146500608  1023.0625             0       -100.09164              100  -- Group 2
    TMP                 1 2146500608          0 1072758784  2047.0625             0       50.0228987              100  -- Group 3
    TMP                 2 2146500608          0 1072758784  2047.0625             0       50.0228987              100  -- Group 3
    TMP                 1 2146500608          0 2146500608  2047.0625             0                0              100  -- Group 4
    TMP                 2 2146500608          0 2146500608  2047.0625             0                0              100  -- Group 4The comments at the end show which group the rows will fall into when they are aggregated. Now, if we do the math manually based on your query we get:
    Group 1
       Bytes_mb = 1072758784/1024/1024 = 1023.0625
       Bytes_free_mb = 0/1024/1024 = 0
       pct_free = ((1072758784 - 1072758784)*100)/1072758784 = 0
       pct_used = ((1072758784 - 0)*100/100 = 100
    Group 2
       Bytes_mb = 1072758784/1024/1024 = 1023.0625
       Bytes_free_mb = 0/1024/1024 = 0
       pct_free = (1072758784 - 2146500608)/1024/1024 = -100
       pct_used = (1072758784 - 0)/1024/1024 = 100
    Group 3
       Bytes_mb = 2146500608/1024/1024 = 2047.0625
       Bytes_free_mb = SUM(0+0)/1024/1024 = 0
       pct_free = ((SUM(2146500608+2146500608) - 1072758784)*100)/2146500608 = 150
       pct_used = ((SUM(2146500608+2146500608) - 0)*100)/2146500608 = 200
    Group 3
       Bytes_mb = 2146500608/1024/1024 = 2047.0625
       Bytes_free_mb = SUM(0+0)/1024/1024 = 0
       pct_free = ((SUM(2146500608+2146500608) - 2146500608)*100)/2146500608 = 100
       pct_used = ((SUM(2146500608+2146500608) - 0)*100)/2146500608 = 200and actually running the query:
    SQL> SELECT df.tablespace_name tspace,
      2         fs.bytes / (1024 * 1024) bytes,
      3         SUM(df.bytes_free) / (1024 * 1024) bytes_free,
      4         Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1) pct_free,
      5         Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes) pct_used
      6  FROM dba_temp_files fs,
      7       (SELECT tablespace_name,bytes_free,bytes_used
      8        FROM v$temp_space_header
      9        GROUP BY tablespace_name,bytes_free,bytes_used) df
    10  WHERE fs.tablespace_name  = df.tablespace_name
    11  GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
    12  ORDER BY 4 DESC;
    TSPACE          BYTES BYTES_FREE   PCT_FREE   PCT_USED
    TMP         2047.0625          0        150        200  -- Group 3
    TMP         2047.0625          0        100        200  -- Group 4
    TMP         1023.0625          0          0        100  -- Group 1
    TMP         1023.0625          0       -100        100  -- Group 2John

  • Determining the used and free space on the database

    Hi,
    I am trying to analyse the total used and free space on all the tablespaces in a database. The query which I am using is as below:
    SELECT /* + RULE */ df.tablespace_name "Tablespace",
    df.bytes / (1024 * 1024) "Size (MB)",
    SUM(fs.bytes) / (1024 * 1024) "Free (MB)",
    Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free",
    Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used"
    FROM dba_free_space fs,
    (SELECT tablespace_name,SUM(bytes) bytes
    FROM dba_data_files
    GROUP BY tablespace_name) df
    WHERE fs.tablespace_name (+) = df.tablespace_name
    GROUP BY df.tablespace_name,df.bytes
    UNION ALL
    SELECT /* + RULE */ df.tablespace_name tspace,
    fs.bytes / (1024 * 1024),
    SUM(df.bytes_free) / (1024 * 1024),
    Nvl(Round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes), 1),
    Round((SUM(fs.bytes) - df.bytes_free) * 100 / fs.bytes)
    FROM dba_temp_files fs,
    (SELECT tablespace_name,bytes_free,bytes_used
    FROM v$temp_space_header
    GROUP BY tablespace_name,bytes_free,bytes_used) df
    WHERE fs.tablespace_name (+) = df.tablespace_name
    GROUP BY df.tablespace_name,fs.bytes,df.bytes_free,df.bytes_used
    ORDER BY 4 DESC;
    Is this query alright? Or are any changes required in it?
    Thanks in advance.

    SET LINESIZE 85
    SET PAGESIZE 200
    column tablespace_name format a18
    column file_name format a25
    column Allocated_kb format 999,999,999
    column free_kb format 999,999,999
    column Percent_Free format 999
    SELECT
    df.tablespace_name,
    df.file_name,
    df.bytes/1024 Allocated_kb,
    free.free_kb,
    Round(free.free_kb/(df.bytes/1024)*100) Percent_Free
    FROM
    dba_data_files df,
    (SELECT file_id, SUM(bytes)/1024 free_kb
    FROM dba_free_space GROUP BY file_id) free
    WHERE
    df.file_id=free.file_id
    ORDER BY
    Percent_Free;

  • After using "erase free space," hard drive has almost no available capacity

    I decided to clean all the files off my iMac as I wasn't using it as my primary computer anymore. After deleting the files, I used Disk Utility and used "erase free space" with the 7x option. I also emptied the Trash folder.
    When I checked the HD, I found:
    Capacity: 297.77 GB
    Available: 4.68 GB
    Used: 293.09 GB
    This makes no sense to me, since there is very little on the computer (some applications). Also, before I started, I know there was about 260 GB available.
    I'd appreciate some advice on how to "free up" the available space that I know must be there.
    Thanks!

    Hi, sounds like the secure erase didn't finish maybe & left a big invisible file on there.
    How much free space is on the HD, where has all the space gone?
    OmniDiskSweeper is likely the easiest/best, and is now free...
    http://www.omnigroup.com/applications/omnidisksweeper/download/

  • Help using "erase free space" feature in Disk Utility

    If I try to "erase free space" on my hard drive, the task never completes, and a temporary file is created, which can be deleted upon restart. If I start up from the Tiger Install DVD to wipe the free hard drive space, will I still have this problem or will it work properly?
    G5 Dual 2.3 GHz   Mac OS X (10.4.6)  

    So how much "free space" for a Temp file do you need to even use "Erase Free Space"? I have 111G available (120G drive), and I have 50G "free space", and it uses up all my space for a Temp File, then won't proceed unless I "clear more room on your startup drive". I need over HALF the drive empty to even use "Erase Free Space"? It would be nice if Apple told us before we started the long process.

  • How to find used and free space

    Hi all,
    How to find the used and free space of a particular user (schema) in a Database.
    I need the sql query .
    PLz urgent..
    Thanks
    Gobi

    SYS@db102 SQL> select file_name, file_id, bytes
      2  from dba_temp_files
      3  where tablespace_name = 'TEMP';
    FILE_NAME                                        FILE_ID           BYTES
    /home/ora102/oradata/db102/temp01.dbf                  1        52428800
    SYS@db102 SQL> alter database tempfile '/home/ora102/oradata/db102/temp01.dbf'
      2  resize 70M;
    Database altered.
    SYS@db102 SQL> select file_name, file_id, bytes
      2  from dba_temp_files
      3  where tablespace_name = 'TEMP';
    FILE_NAME                                        FILE_ID           BYTES
    /home/ora102/oradata/db102/temp01.dbf                  1        73400320
    SYS@db102 SQL>                                                                   

  • How to create a partition using the free space of an existing[SOLVED]

    Hi Guys,
    Since I could not install fifa 09 using wine on linux, I need to create a partition where I can install windows first in order to install fifa 09 on it. How can I create a partition using the rest free space of my , for example, /home partition?How can I do it in a secure way (meaning without doing something to my existing archlinux installation files and system files) ?
    Thanks.
    Please see this post:
    https://bbs.archlinux.org/viewtopic.php?id=109402
    Last edited by Archie_Enthusiasm (2010-12-08 19:23:46)

    Use Parted Magic. But you *should* backup any important files just in case, regardless of method you use. You never know. Someone could unplug your computer, a power surge might happen, etc. A cousin of mine actually did something similar while I was gaming, the extension cord has a red button which he "accidentally" pressed. I would've cracked his skull had he done it while resizing a partition.
    Anyway, the partitioning scheme should be the first thing you do when you decide go this route (dual booting). I remember about a year ago I forced myself to use Linux by formatting the entire drive to ext4, except for the 2 GB + 20 GB ntfs partitions. It was what kick-started me on this path. Here's my partitioning scheme for both computers, maybe you'll get an idea and do something similar:
    Older computer:
    2 GB ntfs - MicroXP
    8 GB ext4 - Arch Linux + Home dir (to keep the dot files organized in one place)
    20 GB ntfs - games partition
    Rest is for media, formatted as ext3 with inode 128 (so it can be loaded as Read-Only in Windows too via Ext2fsd so they won't be affected in case of a virus infection)
    New computer:
    20 GB Windows 7
    10 GB Arch Linux + home dir
    50 GB games partition
    Rest of the space is ext4 mounted to /media
    Note that they're all primary partitions for remembering easier (sda1, sda2, sda3, sda4) instead of a combination of primary and extended which would probably look like sda1, sda5, sda6, sda7, etc.
    Last edited by DSpider (2010-12-03 13:02:26)

  • Re-use of free space

    Hi,
    after a large client delete or after important data archiving, does Oracle re-use new freed space into datafile ? ... we need to delete a large client and then copy e new mid-size client but we haven't a lot of free space in dev system.
    Regards.
    Ganimede Dignan.

    Hello Ganimede,
    >> after a large client delete or after important data archiving, does Oracle re-use new freed space into datafile ?
    Oracle reuses the freed space inside the same segment. For example if you have freed space in table MSEG, you can reuse the allocated space only for table MSEG (=same segment).
    For indexes its a little bit "special", because the freed space (in blocks) can only be reused if they are completely empty, because of the index must be sorted.
    You can take a look at the ALL_TABLES on column AVG_SPACE to estimate the freed size in the tables (but take care, the values are only updated on statistic gathering):
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2105.htm#i1592091
    Regards
    Stefan

  • I cant open Itunes 12.1.2 and use "erase free space"

    Hi guys, after updating the new Apple update (10.10.3 and iTunes 12.1.2, I have so many problem to my macbook pro 2014 version. It takes a lot longer to start the computer which is incredibly fast before updating. Plus, I also cant open the iTunes and use the "erase my free space" in Disk Utility due to "cant create temporary file" even when i have like 150 Gbs left. Any helps?

    Hey SteelyDanO78249
    My iTunes 12.1.2.27 becomes unresponsive on Windows 7 (64bit) whilst just browsing through the software, as I get a message come up saying “iTunes has stopped working” and then closes itself.  I personally think that the software is full of errors which need fixing by Apple especially as they still have not grasped the motto “If it aint broke don’t fix it”.  Especially as I have done everything like you have done to try to make the faulty software work.
    It will be interesting to find out if someone out there has found a fix, but I doubt they have.
    All the best, Jolly_Oli

  • How can I use the free space of my Time Capsule as wireless HD ?

    Hi,
    Just set up a 2T Time Capsule and use it as Time Machine for my IMac and my MacBook.
    How can I use the 1 Tb free space to ave data available from all my devices ?
    Tks

    thierry118 wrote:
    Just set up a 2T Time Capsule and use it as Time Machine for my IMac and my MacBook.
    How can I use the 1 Tb free space to ave data available from all my devices ?
    Although it seems like you have a lot of extra space, Time Machine keeps versions, and if you want to take full advantage of the version history you should not worry about "extra space" because it will get used to provide safer coverage for the two Macs. If you had a Time Machine disk that fit your two Macs' hard drives perfectly, you would have no room for the version history, only room for the one most recent copy of each file. This can be a problem if you discover corruption that happened a while ago and cannot go back far enough in time to find an uncorrupted file.
    Therefore it's better to not try and use up the "extra space" and let it be used for a longer, safer version history for your backups.
    But like you, I want to use my Time Machine for additional network storage. So I plugged a cheap, compact hard drive into the Time Capsule USB port, and that shows up in File Sharing too. There is no need to buy anything fancier since it will be limited by both network speed and USB 2.0 anyway.

  • ITunes Match on the iPhone 4 uses all free space

    iTunes Match on the iPhone 4 uses all available space (8GB). The deactivation and reactivation does not work. The problem persists! Even unplugging the Apple ID and opening the Music app there are still all the artists, playlists, albums, etc. etc. (in the settings app music occupies 0 bytes! Have not saved songs). I have already restored three times! restarting iPhone available space returns to 8GB, opening the Music app after a few minutes iOS noted that the space is occupied.
    iPad 2 and iPhone 3GS regularly work with the same Apple ID!
    Any advice?

    I am also reporting the same behavior.  I, like billybaloney, have an almost "topped-out" iTunes Match collection (I actually have to manage keeping the matched content under the Apple 25K limit, but that is a different matter).  Whenever I open Music app on my phone - 4S, iOS 7.11 - I see my available storage go to nil, and I start getting the "Storage Almost Full" messages.  Which, if you have received them, also puts a significant drag on the performance of the device. 
    I am fully aware of the download locally (device) of "played" content, so I expect the number of songs and albums I have played to be resident on the phone after, and that requiring manual cleanup.  I can see this by taking the phone offline (airplane mode, or literally out of coverage), and then opening the Music app and seeing only what is truly on the device.
    I suspect that the "eater of free space" in the iTunes Match arena, for users with a large library of iCloud selections, is as simple as the iTunes library info to render for selection (not the music, but the artist, album, song and playlist lists, and the album artwork).  Resetting your phone is a PITA for workaround.  Something needs to be done, but I have a feeling nothing will.  Or it will require an iOS update to a newer version that my devices won't be eligible to load. 
    Any insight or help would be great.  Workarounds are only that: work arounds.  Solution is what is needed.

  • How can validate the ASM size and free space correctly?

    Dears ,,
    I faced problem in ASM size as it appeared in alert file as below
    ORA-19504: failed to create file "+DG_DATA"
    ORA-17502: ksfdcre:4 Failed to create file +DG_DATA
    ORA-15041: diskgroup space exhausted
    So we resize ASM space and large it. But we faced the same problem also although there is free space in ASM.
    It seems that the shown free space is not real.
    How can validate the ASM size and free space correctly?
    Thanks & Regards,,

    *Oracle DBA* wrote:
    Dears ,,
    I faced problem in ASM size as it appeared in alert file as below
    ORA-19504: failed to create file "+DG_DATA"
    ORA-17502: ksfdcre:4 Failed to create file +DG_DATA
    ORA-15041: diskgroup space exhausted
    So we resize ASM space and large it. But we faced the same problem also although there is free space in ASM.
    It seems that the shown free space is not real.
    How can validate the ASM size and free space correctly?
    Thanks & Regards,,
    I was having this problem. Im my case i couldn add datafiles to a tablespace despite the fact that i was having a lot of space in the asm. Try rebalancing. It might help. In my case rebalancing also didn work because it seems that there need to be a threshold space in all the disks for the rebalancing to happen which was not in my case, so i had to shrink some unused space in the tablespace and then after gaining the required space I rebalanced the disk and then the disks got rebalanced, also i was able to use the free space that was showing .

  • How to find out the used space and free space in the DB for attachments

    Hi,
    In CRM 5.2 web UI, we can save a transaction by saving attachments like work documents or text files.
    Could someone help me find out the used space, free space, maximum capacity on the CRM DB for these attachments.
    Thanks & Best Regards,
    Ramesh.

    Hi,
    check with  below table
    TNAPR   ---  Processing programs for output
    and NACE Transaction code
    NACE  --  out types
    Regards,
    Madhu

  • Fragmentation. Inserts not using free space

    Hi,
    We are running Oracle version 10.2.04, and we have a tablespace with locally managed, uniform, extents with ASSM set to manual. As part of our ETL process, we delete rows one at a time in a loop and then commit every 10,000 rows. We then insert using the same method.
    Can anyone think of reasons why the inserts would not use the free space from the deletion statements?
    I'm going to try and run a few tests, so any recommendations for this would be appreciated.
    Thanks,
    Rob

    Thank you both for your comments. I have now performed some testing and concluded that it was due to the PCTUSED parameter being set to 40 which has caused the lack of space re-use. I did some testing and here are the results:
    The reason for using the MOD function is because I wanted to delete from different blocks and not just the same one because they are ordered by the sequence numner (PK_COL in my example).
    Test 1
    Manual SSM
    Default PCTFREE and PCTUSED
    Look at the NUM_ROWS and BLOCKS values
    dba@TEST> create table dba.rj_del_ins_test
      2  tablespace Tbs_tables_x128K
      3  as
      4  select *
      5  from table
      6  where PK_COL > 1135268669
      7  and PK_COL is not null
      8  order by PK_COL ;
    Table created.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                         1      84217        849            0          0         141           0
    dba@TEST> delete from dba.rj_del_ins_test
      2  where PK_COL > 1135268669
      3  and mod(PK_COL ,20) = 10;
    4143 rows deleted.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                         1      80074        849            0          0         141           0
    dba@TEST>
    dba@TEST> insert into dba.rj_del_ins_test
      2  select *
      3  from table
      4  where PK_COL > 1135268669
      5  and PK_COL is not null
      6  and mod(PK_COL ,20) = 6;
    4277 rows created.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                         1      84351        892            0          0         141           0TEST 2
    New tablespace created with same extent size as previous tablespace being used for TEST1
    One change: Automatic Segment Space Management (ASSM) is set to AUTO instead of manual, as in TEST1
    As you can see from the results below, we have the same problem here where the deleted space is not being reused when the new inserts come along
    dba@TEST> create table dba.rj_del_ins_test
      2  tablespace rj_test_X128K
      3  as
      4  select *
      5  from table
      6  where PK_COL > 1135268669
      7  and PK_COL is not null;
    Table created.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                                84217        868            0          0         141           0
    dba@TEST> delete from dba.rj_del_ins_test
      2  where PK_COL > 1135268669
      3  and mod(PK_COL ,20) = 10;
    4143 rows deleted.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                                80074        868            0          0         141           0
    dba@TEST> insert into dba.rj_del_ins_test
      2  select *
      3  from table
      4  where PK_COL > 1135268669
      5  and PK_COL is not null
      6  and mod(PK_COL ,20) = 6;
    4277 rows created.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                                84351        911            0          0         141           0TEST 3
    Manual segment space management
    Specifying the PCTFREE and PCTUSED parameters for the table being created
    The first sign that something has changed is the number of blocks for the same number of rows is reduced; we are only using 764 instead of 868
    Secondly, upon re-inserting the rows we are only using 3 additional blocks which shows that we are in fact re-using the space we freed up
    dba@TEST> create table dba.rj_del_ins_test PCTFREE 0 PCTUSED 99
      2  tablespace Tbs_tables_X128K
      3  as
      4  select *
      5  from table
      6  where PK_COL > 1135268669
      7  and PK_COL is not null;
    Table created.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                         1      84217        764            0          0         141           0
    dba@TEST> delete from dba.rj_del_ins_test
      2  where PK_COL > 1135268669
      3  and mod(PK_COL ,20) = 10;
    4143 rows deleted.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                         1      80074        764            0          0         141           0
    dba@TEST> insert into dba.rj_del_ins_test
      2  select *
      3  from table
      4  where PK_COL > 1135268669
      5  and PK_COL is not null
      6  and mod(PK_COL ,20) = 6;
    4277 rows created.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                         1      84351        767            0          0         141           0TEST 4
    Automatic segment space management, using same tablespace as in TEST2
    PCTFREE and PCTUSED has been changed to be the same as in TEST2
    The result of this shows that the space is not re-used when using manual segment space management
    dba@TEST> create table dba.rj_del_ins_test PCTFREE 0 PCTUSED 99
      2  tablespace rj_test_X128K
      3  as
      4  select *
      5  from table
      6  where PK_COL > 1135268669
      7  and PK_COL is not null;
    Table created.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                                84217        782            0          0         141           0
    dba@TEST> delete from dba.rj_del_ins_test
      2  where PK_COL > 1135268669
      3  and mod(PK_COL ,20) = 10;
    4143 rows deleted.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                                80074        782            0          0         141           0
    dba@TEST> insert into dba.rj_del_ins_test
      2  select *
      3  from table
      4  where PK_COL > 1135268669
      5  and PK_COL is not null
      6  and mod(PK_COL ,20) = 6;
    4277 rows created.
    dba@TEST> commit;
    Commit complete.
    dba@TEST> exec dbms_stats.gather_table_stats('DBA', tabname=>'RJ_DEL_INS_TEST',estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE 1', cascade=>TRUE);
    PL/SQL procedure successfully completed.
    dba@TEST> select TABLE_NAME, FREELISTS, NUM_ROWS, BLOCKS, EMPTY_BLOCKS, AVG_SPACE, AVG_ROW_LEN, NUM_FREELIST_BLOCKS
      2  from dba_tables
      3  where table_name = 'RJ_DEL_INS_TEST';
    TABLE_NAME                      FREELISTS   NUM_ROWS     BLOCKS EMPTY_BLOCKS  AVG_SPACE AVG_ROW_LEN NUM_FREELIST_BLOCKS
    RJ_DEL_INS_TEST                                84351        823            0          0         141           0So, that does prove one point that you are right, Robert. However, can you think of why when using AUTO segment space management we don't utilitize the space as efficiently as with manual SSM?
    Thanks,
    Rob

Maybe you are looking for

  • Why wont my ipad2 reset?

    I downloaded Cydia to get a couple of cool things but then i realised i didnt want it. and i heard that to get rid of it you reset data on the ipad under settings, i dont know if cydia had anything to do with it but all it shows now is the apple logo

  • Xorg freezes often!

    Hi all, is there any solution, workaround or fix for the Xorg freeze bug? Description: Xorg freezes often, no mouse (or mouse very slow), no keyboard, cold reboot required! Additional info: System: ArchLinux i686, 32bit Current packages: kernel 3.3.2

  • I cut an email how do I get it back???

    I clicked command x by accident and cut an email, how do I get it back? When I try to paste, Mail creates some error and shuts down. So the email is probably still in the memory but how can i extract it?!?!

  • Unable to start services with different

    Hi, We have installed OBIEE 11g on a 64-bit Windows machine. When we start the services with the same user id which was logged in while installation the services go up successfully and everything seems fine. However, when we try to start the services

  • Delete Source System Assignment for a DataMart Infosource in BW3.0B

    Hello Experts: Can one of you assist me with how to delete source system assignment for a system generated  infosource(ie., Infosource existing under data Mart). i noticed that in case of an Info Cube, system provides an option to delete the source s