Free space discrepancy

Hi,
For a particular tablespace I am querying dba_segments view to calculate the utilized space size of that tablespace:
SQL> select tablespace_name,sum(bytes)/1024/1024/1024 gb
from dba_segments
where tablespace_name='TBS1'
group by tablespace_name;
The output is: *74.48*
To find out the total allocated size of this tablespace I have used this:
SQL>select tablespace_name, sum(bytes)/1024/1024/1024 gb
from dba_data_files
where tablespace_name='TBS1'
group by tablespace_name;
The output is: *77.43*
Then I queried dba_free_space to find out the free space of that tablespace using this:
SQL> select tablespace_name,sum(bytes)/1024/1024/1024 gb
from dba_free_space
where tablespace_name='TBS1'
group by tablespace_name;
The output is: *21.8*
Now here I am not able to understand that, why dba_free_space returned 21.8 GB as free space instead of 2.95 GB (calculated by subtracting the value returned by dba_segments from dba_data_files).
DB Version: 10.2.0.1, 64 bit
OS Platform: Linux
Thanks for your time.
Regards,
Joy

Hi,
Here i will give the approach how to troubleshoot this kind of issue.
find the dba_segments definination:
======================
SQL> set long 100000
SQL> select dbms_metadata.get_ddl('VIEW','DBA_SEGMENTS','SYS') FROM DUAL;
CREATE OR REPLACE FORCE VIEW "SYS"."DBA_SEGMENTS" ("OWNER", "SEGMENT_NAME", "P
ARTITION_NAME", "SEGMENT_TYPE", "TABLESPACE_NAME", "HEADER_FILE", "HEADER_BLOCK"
, "BYTES", "BLOCKS", "EXTENTS", "INITIAL_EXTENT", "NEXT_EXTENT", "MIN_EXTENTS",
"MAX_EXTENTS", "PCT_INCREASE", "FREELISTS", "FREELIST_GROUPS", "RELATIVE_FNO", "
BUFFER_POOL") AS
select owner, segment_name, partition_name, segment_type, tablespace_name,
header_file, header_block,
decode(bitand(segment_flags, 131072), 131072, blocks,
(decode(bitand(segment_flags,1),1,
dbms_space_admin.segment_number_blocks(tablespace_id, relative_fno,
header_block, segment_type_id, buffer_pool_id, segment_flags,
segment_objd, blocks), blocks)))*blocksize,
decode(bitand(segment_flags, 131072), 131072, blocks,
(decode(bitand(segment_flags,1),1,
dbms_space_admin.segment_number_blocks(tablespace_id, relative_fno,
header_block, segment_type_id, buffer_pool_id, segment_flags,
segment_objd, blocks), blocks))),
decode(bitand(segment_flags, 131072), 131072, extents,
(decode(bitand(segment_flags,1),1,
dbms_space_admin.segment_number_extents(tablespace_id, relative_fno,
header_block, segment_type_id, buffer_pool_id, segment_flags,
segment_objd, extents) , extents))),
initial_extent, next_extent, min_extents, max_extents, pct_increase,
freelists, freelist_groups, relative_fno,
decode(buffer_pool_id, 0, 'DEFAULT', 1, 'KEEP', 2, 'RECYCLE', NULL)
from sys_dba_segs
find the dba_free-space definination:
======================
SQL>
SQL> select dbms_metadata.get_ddl('VIEW','DBA_FREE_SPACE','SYS') FROM DUAL;
CREATE OR REPLACE FORCE VIEW "SYS"."DBA_FREE_SPACE" ("TABLESPACE_NAME", "FILE_
ID", "BLOCK_ID", "BYTES", "BLOCKS", "RELATIVE_FNO") AS
select ts.name, fi.file#, f.block#,
f.length * ts.blocksize, f.length, f.file#
from sys.ts$ ts, sys.fet$ f, sys.file$ fi
where ts.ts# = f.ts#
and f.ts# = fi.ts#
and f.file# = fi.relfile#
and ts.bitmapped = 0
union all
select /*+ ordered use_nl(f) use_nl(fi) */
ts.name, fi.file#, f.ktfbfebno,
f.ktfbfeblks * ts.blocksize, f.ktfbfeblks, f.ktfbfefno
from sys.ts$ ts, sys.x$ktfbfe f, sys.file$ fi
where ts.ts# = f.ktfbfetsn
and f.ktfbfetsn = fi.ts#
and f.ktfbfefno = fi.relfile#
and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0
union all
select /*+ ordered use_nl(u) use_nl(fi) */
ts.name, fi.file#, u.ktfbuebno,
u.ktfbueblks * ts.blocksize, u.ktfbueblks, u.ktfbuefno
from sys.recyclebin$ rb, sys.ts$ ts, sys.x$ktfbue u, sys.file$ fi
where ts.ts# = rb.ts#
and rb.ts# = fi.ts#
and u.ktfbuefno = fi.relfile#
and u.ktfbuesegtsn = rb.ts#
and u.ktfbuesegfno = rb.file#
and u.ktfbuesegbno = rb.block#
and ts.bitmapped <> 0 and ts.online$ in (1,4) and ts.contents$ = 0
union all
select ts.name, fi.file#, u.block#,
u.length * ts.blocksize, u.length, u.file#
from sys.ts$ ts, sys.uet$ u, sys.file$ fi, sys.recyclebin$ rb
where ts.ts# = u.ts#
and u.ts# = fi.ts#
and u.segfile# = fi.relfile#
and u.ts# = rb.ts#
and u.segfile# = rb.file#
and u.segblock# = rb.block#
and ts.bitmapped = 0
DBA_FREE_SPACE is taking value from sys.recyclebin$ rb, sys.ts$ ts, sys.x$ktfbue u, sys.file$ fi
DBA_SGEMNETS taking value from sys_dba_segs
Solution:
=====
1) How the value will be populated to these view ?
When you collect the stats then the value will be populated to those table.
2) From where these view DBS_SEGMENTS derived ?
From base tables
So, Please collect the stats on fixed table then let me know the result
Kind Regards,
Rakesh jayappa

Similar Messages

  • Syncing: Free Space discrepancy

    Hope there is a solution for this other than, "wipe it and load everything all over again."
    Somewhere in 4.2 I think, a Free Space discrepancy has developed in my iPad. When performing a sync, the Free Space decreases by about .50 GB while in the middle of the sync, but then increases back to normal when the sync is complete.
    This did not happen before with the iPad.
    The problem is still there in 4.3 version. My iPhone does not have this problem and it has also been upgraded through 4.2 and now 4.3 version.
    Thanks

    Hi,
    If you store photos on the iPad, try deleting the cache.
    iTunes: Understanding the iPod Photo Cache folder
    Carolyn

  • Hard drive free space discrepancy

    I have an 11 inch Macbook Air with a 120GB SSD and I am running OS X Lion 10.7.5.
    Every so often I get messages indicating my hard drive is nearly full. Since it is a small hard drive I never thought much of it and just deleted a movie or two I put on it for when I travel. But lately I realized that I keep all my music, photos, and bulk of my movie files on an external drive, so there really isn’t much on my computer.
    When I add up all the files listed under My Mac HD in the finder, I get 62 GB. Add in the operating system and I come up with 75 GB of the SSD used. When I look at the storage summary on “About this Mac”, it says I am using 94 GB. There is about a 19 GB discrepancy. Does anyone know what could cause this and where 19 GB of data can be hiding?
    Hard drive free space discrepancy

    Use a tool like OmniDiskSweeper 1.8 to find what's on the disk, where, and how large.
    Freeing Up Space on The Hard Drive
      1. See Lion's Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.

  • Ipad and itunes free space discrepancy

    Hi,
    I'm trying to sync new itunes purchases onto my ipad. My ipad tells me there is 12 GB left but itunes is convinced there is only 1GB free space. The former must be right because it has automatically removed a whole bunch of watched TV shows.
    How can I correct it so it will let me sync?
    Ta
    C

    HI,
    To see exactly how much free storage space is available... connect your iPad to your computer. In the iTunes window select the Summary tab. At the bottom of that window you'll see Capacity and Free.
    Try resetting your iPad. Press and hold both the Sleep/Wake button and the Home button for at least ten seconds, until the Apple logo appears.
    Restart both your G5 and your iPad. Try syncing again.
    Carolyn

  • Finder reports wrong amount of free space

    Finder is reporting the wrong amount of free space on all my drives.  It's not from time machine local backups, because I've disabled those.  In fact, it's reporting MORE free space than there should be!  In all cases, Disk Utility shows the correct amount.  (So does the Terminal command df.)
    eg:
    external 120GB hard drive (USB) - finder says 137.83GB free (more than the drive can hold, nice) - disk util says 70 used 49.9 free... better
    external 1TB (firewire) - finder says 276.66GB free - disk util says 783.72 used 216.15 free
    internal 120GB SSD - finder says 108.32GB - disk util says 78.6GB used, 40.5 free
    Anyway to fix Finder?

    I noticed the same problem. I assumed it was from Time Machine's local backups (which exactly account for the space discrepancy between Finder and Disk Utility on my machine). But, as you say, you've disabled Time Machine local "snapshots." I can only assume you deleted the local backups (to free up the space they were using), emptied your Trash and are still showing the discrepancy.

  • Inconsistent Reporting of Free Space on the HDD

    Activity Monitor shows Disk Usage as follows: Space utilized = 397.48 GB and Space free = 101.77 GB.
    About This Mac - Storage indicates 101.5 GB Free and 164.46 GB Backups (???).
    Right clicking on Macintosh HD in Finder and then on Get info reports: Used = 233.28 GB and Available = 265.97 GB.
    Why the discrepancy? I believe the latter is more correct but what is going on? Or, do I have a virus or something eating up the free space on my hard drive? These discrepancies did not exist before in Snow Leopard.
    What gives?...

    Michael9009 wrote:
    Thanks, it all makes sense.
    But it is still not clear to me why Apple made this so confusing. For example, I think that both the Activity Monitor and Finder should report the same values, i.e. the Activity Monitor should not include the backups.
    The Activity Monitor is a administration utility and have to show complete values, e.g. for troubleshooting.
    Finder is a user utility and have to show the available space for a user, regardless of files like backups, swap, trash or cache that will be shrink or deleted when the space become less or needed to store user data.
    Lupunus
    Message was edited by: lupunus (typo's fixed)

  • 72GB of free space missing...again.

    Ok, so I have been having this issue intermittently since iOS 7.0. I am now on 8.3 (just upgraded to it this morning) but the problem is still here.
    Basically, after a weekend of streaming a LOT of purchased videos to my iPad (not downloading them, mind you, but "streaming" from the cloud), my 128GB iPad will suddenly decide that it has no more free space. In Settings>General>Usage, it will show less than a gigabyte of free space; in fact this morning when I tried to update to 8.3 it told me there was not enough free space to even download the update.
    I know for a FACT that I am only actually using about 30% or so of the device's capacity. I can go through the usage section and add everything up manually, or better yet, just plug it in to iTunes. iTunes will tell me that the iPad has 73GB of free space available!
    Why the discrepancy? I've managed to fix this before (I do NOT want to factory restore, and quite frankly I shouldn't have to), but I can't remember how I did it. It seems to me that there is some sort of download cache that the iPad uses when I stream my purchased videos, then it forgets that it downloaded those and so it doesn't clean up after itself...
    Any help here would be great...this is probably the 5th time I've had this happen after streaming a lot of my purchased videos, and streaming purchased videos is the only thing that seems to actually cause this storage capacity black hole.

    Ok, after messing around a bit more it would appear that I've fixed the issue.
    Heres how:
    In Settings>iTunes & App Store: Turn OFF Show All Music and Videos as well as iTunes Match.
    Open the Videos app, hit edit, and delete anything that is showing up in there (even though there shouldn't be anything in there now since none of them have ever been downloaded by me).
    Go back to Settings>iTunes & App Store, turn Show All Music and Videos and iTunes Match back ON.

  • Wrong amount of free space

    I searched the forum, and it seems that other people have a problem with the OS seemingly reporting too little free space on the disk, which is the opposite of the problem I have.
    I'm being shown that I have MUCH more free space than I do. I have a (Early 2013) MacBook Pro 15" with Retina display and a 500 GB SSD. Using "Get Info," the hard drive reports that I have a capacity of 499.42 GB with 459.04 GB free and only ~40 GB used. The "Item Info" below the disk name reports the same thing. This is impossible, considering the amount of data that I have stored, including a 60 GB Windows 7 partition. Disk Utility reports the correct amount of disk space available as does About This Mac.
    Any idea what's causing the discrepancy? Since Disk Utility is reading the drive correctly and reports no problems when I use "Verify Disk," I'm guessing it's not a big deal, but I'd like to know if there's a fix.
    Thanks.

    Try re-indexing Spotlight:
      http://support.apple.com/kb/ht2409

  • Macintosh HD and Bootcamp Installer Disagree on Free space on Hard Drive

    Im having a hard drive issue.
    I have 500 gb and macosx shows about 300gb free.
    I'm attempting to install windows and the assistant gives about 100gb of space but I'd like 200 or so for windows.
    Theres a discrepancy in available hard drive space!
    I had installed windows prior and made the mistake of following some bad advice and re partitioning for extra space within windows 8. After this I lost the windows partition. I have a third party disk utility that says the drive needs repaired. The drive has issues with discrepancies in drive space and sectors used and not used. The volume gets repaired and allowed some more space for windows (the 100gb) but I should assumably be allowed most all the free space available and would like to (iI have an external for large files).
    How can I fix this? I dont mind command line. Are there third party utilities?

    You have two issues.
    1. Partitioning within Windows and OS X are using two different personalities of a disk, and if not kept in sync, you run into this issue. Apple does not allow Windows partition to be resized because they do not provide the appropriate tools to keep them in sync.
    2. If you are willing to take a backup of OS X and all your files, the cleanest method is to erase the drive and restore from a backup, preferably using a Time Machine backup.

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

  • Finder and About This Mac free space discrepancies

    I've read that "Finder displays the available space on the disk without accounting for the local snapshots." However, the discrepancy is more than that.
    You can see that "About this mac" informs me that I have 31,56 GB of free space. Add to that the backups and I'd have 37 GB free. Finder, however is informing me that I have 54,59 GB free.
    Who can explain to me where this difference comes from?

    My SSD has been verified, so I may conclude that the storage structure itself isn't damages. I tried a clean reboot of OS X and the sizes are now correctly displayed. Because I had already tried such a reboot, I think the combination reindex/reboot might have done the trick. Pondini, thank you for your support. That was real kind.
    Best Regards,
    Wouter
    PS: I actually already owned WhatSize.app. Thats how I discovered the discrepancy between DiskUtility.app, About My Mac and Finder.app.

  • Strange calculation of free space

    Hi!
    I can't understand how size of free space is calculated.
    For example:
    in my mailbox i have 3 folders
    Incoming  40.4 Mb
    Sent 13.1 Mb
    Junk 302 Kb
    In total about 55 Mb
    but in Statistic writtent, that ocupied 161.7 Mb
    Same situation3 with Documents and Application data:
    My Measures  252.5 Mb
    Mail                160.1 Mb
    Pages              22.6 Mb
    Numbers          14.6 Mb
    Keynote           13.4 Mb
    All other in sum less than 1 Mb
    In total should be less than 500 Mb
    ps: I deleted all photos and turned off PhotoStream.
    How to solve this problem?

    I have the same issue. I have just 68.5MB of documents in iCloud and it says it's full. I tried to delete photos from photo stream. I have no backups in iCloud and I don't sync my mail to iCloud.
    https://www.evernote.com/shard/s24/sh/a8fc9ce7-0b24-4b24-a306-617a824b9333/5bbc8 d18d8fb43ef713088057c8d830e
    https://www.evernote.com/shard/s24/sh/58447450-8089-4bc6-8a0f-d133747d05ff/17fc6 e9d31b5d68242ea2f8f1024ac73

  • HT1284 Do I need to reformat my external hard drive before I backup to it?  It shows very little free space when in fact it is empty.

    I am new to Imac.  I want to use an external hard drive to backup to but the drive shows very little free space when in fact it is empty.  Do I need to reformat it and, if so How?  Thanks

    What is the external disk?
    Is it new?  If so, maybe it has a Windows file system on it (FAT, exFAT, or NTFS).  If so then reformat to "HFS+ Journaled".
    What backup utility are you using?  TimeMachine, Carbon Copy Cloner, SuperDuper, etc...?  If the external is suppose to be bootable because you are using a cloning backup (CCC or SuperDuper), then it is also important that the disk partition table be GUID.
    You can find out this information via Applications -> Utilities -> Disk Utility, select the disk (not volume on the disk) and the partition time will be shown at the botton of the window.   Now Select the volume and it will tell you how the file system on the disk is formatted.
    Also do you want to leave room for a recovery partition on the external disk?  Then repartition it with a small (2GB) partition that can hold a bootable recovery partition that you can setup via the Apple "Recovery Disk Assistant" which can be downloaded from Apple.

  • Logical Volume Group and Logical Partition not matching up in free space

    I was dual booting Windows 7 and Mountain Lion. Through Disk Utility, I removed the Windows 7 Partition and expanded the HFS+ partition to encompass the entire hard drive. However, the Logical Volume Group does not think that I have that extra free space. The main problem is that I cannot resize my partition. I am wanting to dual boot Ubuntu with this. Any ideas? Any help is appreciated. I will post some screenshots with the details. Furthermore, here are some terminal commands I ran: /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *250.1 GB disk0
    1: EFI 209.7 MB disk0s1
    2: Apple_CoreStorage 249.2 GB disk0s2
    3: Apple_Boot Recovery HD 650.0 MB disk0s3
    /dev/disk1
    #: TYPE NAME SIZE IDENTIFIER
    0: Apple_HFS MAC OS X *248.9 GB disk1 Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on
    /dev/disk1 243031288 153028624 89746664 64% 38321154 22436666 63% /
    devfs 189 189 0 100% 655 0 100% /dev
    map -hosts 0 0 0 100% 0 0 100% /net
    map auto_home 0 0 0 100% 0 0 100% /home CoreStorage logical volume groups (1 found)
    |
    +-- Logical Volume Group 52A4D825-B134-4C33-AC8B-39A02BA30522
    =========================================================
    Name: MAC OS X
    Size: 249199587328 B (249.2 GB)
    Free Space: 16777216 B (16.8 MB)
    |
    +-< Physical Volume 6D7A0A36-1D86-4A30-8EB5-755D375369D9
    | ----------------------------------------------------
    | Index: 0
    | Disk: disk0s2
    | Status: Online
    | Size: 249199587328 B (249.2 GB)
    |
    +-> Logical Volume Family FDC4568F-4E25-46AB-885A-CBA6287309B6
    Encryption Status: Unlocked
    Encryption Type: None
    Conversion Status: Converting
    Conversion Direction: backward
    Has Encrypted Extents: Yes
    Fully Secure: No
    Passphrase Required: No
    |
    +-> Logical Volume BB2662B7-58F3-401C-B889-F264D79E68B4
    Disk: disk1
    Status: Online
    Size (Total): 248864038912 B (248.9 GB)
    Size (Converted): 130367356928 B (130.4 GB)
    Revertible: Yes (unlock and decryption required)
    LV Name: MAC OS X
    Volume Name: MAC OS X
    Content Hint: Apple_HFS

    Here is another try via the command line:
    dhcp-10-201-238-248:~ KyleWLawrence$ diskutil coreStorage resizeVolume BB2662B7-58F3-401C-B889-F264D79E68B4 210g
    Started CoreStorage operation
    Checking file system
    Performing live verification
    Checking Journaled HFS Plus volume
    Checking extents overflow file
    Checking catalog file
    Incorrect block count for file 2012.12.11.asl
    (It should be 390 instead of 195)
    Checking multi-linked files
    Checking catalog hierarchy
    Checking extended attributes file
    Checking volume bitmap
    Checking volume information
    Invalid volume free block count
    (It should be 21713521 instead of 21713716)
    The volume MAC OS X was found corrupt and needs to be repaired
    Error: -69845: File system verify or repair failed

  • I made a dumb decision to 'Erase Free Space' on my drive. I now have no free space, I realize because it wrote 0's over all my free space. Is there a way to undo this??? Help please I can't save any documents now! Thanks in advance all, it is truly apprec

    I made a dumb decision to 'Erase Free Space' on my drive. I now have no free space, I realize because it wrote 0's over all my free space. Is there a way to undo this??? Help please I can't save any documents now! Thanks in advance all, it is truly appreciated. how can find the hidden temporary files using the terminal what do i type in?

    It's more likely a failed Erase Free Space, which creates a huge temporary file; that's why it looks like you have no more available drive space. You can recover from this. See these links
    https://discussions.apple.com/message/10938738#10938738
    http://www.macgeekery.com/tips/quickie/recovering_from_a_failed_secure_erase_fre e_space 
    Post back if you need any help with this.

Maybe you are looking for