Release of space after delete/truncate table

Hello,
How does release of space after delete/truncate table works? Is the space used before deletion released once delete is complete or not? Will I see the space occupied by deleted table as free in dba_segments or will I need to reorganize the table (drop and recreate again?). Reason why I am asking is that I can see table with 0 rows, but in dba_segment I can see it is occupying few gigabytes....
Thank you

Here is a little illustration for you;
SQL> conn ogan/password
Connected.
SQL> create table ogan_deneme as select * from all_objects;
Table created.
SQL> select count(*) from ogan_deneme;
  COUNT(*)
    228470
SQL> set line 1000
SQL> set pagesize 1000
SQL> select * from dba_segments where owner='OGAN';
OWNER    SEGMENT_NAME        PARTITION_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_
OGAN      OGAN_DENEME          TABLE              SYSTEM                                 854       319981   *30408704*       *1856*         *44*          65536                       1  2147483645                       1               1          854 DEFAULT
SQL> truncate table ogan_deneme;
Table truncated.
SQL> select * from dba_segments where owner='OGAN';
OWNER    SEGMENT_NAME        PARTITION_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_
OGAN      OGAN_DENEME           TABLE              SYSTEM                                 854       319981      *65536*          *4*          *1*          65536                       1  2147483645                       1               1          854 DEFAULT
SQL>Hope it Helps,
Ogan

Similar Messages

  • Nas drive does not recalculating space after deleting files on Nas Drive??

    Greetings to Respected expert,
    Actually we have configure Window server 20082 Storage server.We have NAS drive configured which have 300GB quota limit. The actual data in the folder is 185 GB but it shows only 15 GB free and shows a warning .Please assist me why NAS server does not re-calculate
      the space after deleting files or does not leave space. Pardon me if I am not able to clear you my problems.this is very urgent for me.
    Thanks And Regards
    Rajnish Singh

    Hi Rajnish,
    As you mentioned "quota limit", it is set via FSRM or specific function on NAS?
    Meanwhile could you confirm the number 185GB is accurate? Sometimes a part of used space is just not calculated. You can confirm with checking the total space on NAS locally.
    If the number is correct and quota is set via FSRM, check if it is the Disk Quota which not re-calculated the released space. Try to clear the Quota setting and reconfig with 300GB limitation and see if issue still exists.
    If you have any feedback on our support, please send to [email protected]

  • External HD won't free-up space after deleting files

    Hello. My old Maxtor 500 Gb external hard-drive won't free-up any space after deleting many, many files. I'm using a late 2009 iMac i5 desktop with Snow Leopard. I had 6 Time Machine backups of my old MacBook Pro on the drive - each taking up roughly 70-80 Gb of space. I deleted 3 of the Time Machine backups as they were close enough in date to other backups so I wasn't going to lose any data. This should have freed up more than 200 Gb of space on the external hard drive. However, the hard drive still shows having only 10 Gb of space available. I deleted the Trash from the Dock. The Trash is empty. I unmounted the hard drive, turned it off and reconnected it. I restarted the computer. Still no change. Please help me. Thanks!

    Welcome to Apple Discussions-
    Are you using FileVault? If so, you have to log out or restart in order for the disk space to be reclaimed.

  • Exfat drive does not free up space after deleting files

    My external exfat formatted drive does not free up space after deleting files using a mac....however if I delete files using a PC, it will free up space.
    I've even tried the *erase free space* using Disk Utility, but nothing.....
    Thoughts/Suggestions??

    Thanks for the suggestion.
    I ran WhatSize and here is the result. Oddly, it says there is 40.2 GB used (in the top-left) which conflicts with the information directly below it: "Capacity 108 GB, Used 103GB, Available 4.27 GB". Not so helpful.
    Disk Inventory X solved the problem, however. Much thanks! I wasted most of my weekend troubleshooting this sad issue. Anyway, Disk Inventory X revealed a bug where my external hard drive for photos was still appearing as a mounted volume, even though the HD was no longer connected. Freaky.
    After moving it to the trash and deleting it, I've recovered the space.
    Again, thanks! Contact me if you're curious about the details, as this might help you diagnose similar problems in the future.
    - Mike

  • Freeing space after deleting files

    Has anyone tried to free the LOB space after deleting a file? We've been using the aging feature but none of the space utilized by files that have been migrated to disk was freed after the file was moved to BFILE.

    Hi,
    there is old posting from you,
    Questions with Third-Party Access Management Systems
    I am trying integration of Oracle SSO and Oracle EBS but headers are not reaching in custom java file. Would be very thankful if you could help
    thanks in advance.
    prakash

  • How to gain space after Delete

    Hi All,
    Oracle 9208
    I have one table space which is 90% full. I know a table which can give me 10% space if I delete 50% of old data in table. I cannot truncate the table as users are always using the table.
    If I delete the rows in TEST env. The tablespace is still 90%, as deleting doesn't release the space. How can we gain the space?
    Thanks,

    It's allocated space and that can't quite be released, since the table is still fragmented at the extent level. Export/import of the table will solve the problem after specifying 'deallocate unused'
    Message was edited by:
    FeNiCrC_Neil

  • How to reclaim the space after delete

    Hi All,
    Today we deleted large number of rows from one table, but we didn't get free space after that. So for testing purpose, I have created one test tablespace with 5mb size .Created a table and inserted n number of rows in that table and made the tablespace full.I checked in dba_segments(5mb) and dba_free_space tables.It shows perfectly.After that I deleted all the records and try to create a simple table,but it returns (ORA-01658: unable to create INITIAL extent for segment).I read some time back in tom's forum that delete willn't reclaim the space ,instead it will go to freelist of table..Is there any way to reclaim the space?(after delete)
    and also I used to see the tablesize by using dba_segments table.but now it shows 5mb of size for the empty table.Is there any query to get the exact table size?Please help me to understand the concept.
    Thanks,Jvel

    880401 wrote:
    Hi All,
    Today we deleted large number of rows from one table, but we didn't get free space after that. So for testing purpose, I have created one test tablespace with 5mb size .Created a table and inserted n number of rows in that table and made the tablespace full.I checked in dba_segments(5mb) and dba_free_space tables.It shows perfectly.After that I deleted all the records and try to create a simple table,but it returns (ORA-01658: unable to create INITIAL extent for segment).I read some time back in tom's forum that delete willn't reclaim the space ,instead it will go to freelist of table..Is there any way to reclaim the space?(after delete)
    and also I used to see the tablesize by using dba_segments table.but now it shows 5mb of size for the empty table.Is there any query to get the exact table size?Please help me to understand the concept.
    Thanks,JvelDELETE simply deletes the specified rows. The blocks/extetents that were allocated to hold those rows remain allocated. The theory is that if the table once needed sufficient blocks/extents to hold 'x' rows, it may need so again at some time in the future. Allocating and de-allocating extents is a pretty expensive operation, so oracle is not going to waste time and resources constantly doing that just because you delete rows, which is a perfectly normal DML operation. Unless you don't expect that table to grow again, I'd not waste my time trying to reclaim the space.

  • Reclaim disk space after delete an index

    Hi ,
    I have deleted unused indexes from a history table to reclaim the disk space was allocated for these indexes , yet the size on the disk is the same , any steps I can follow to achieve this would be greatly appreciated..
    indexes size is 70 GB
    table size is 45 GB , # of rows is above 200 Million
    Thanks in advance

    in order to reclaim space after your big delete.  Don't shrink your data files unless you have no other choice.
    The space will automatically go back to SQL server. You don't have to do anything.
    The database size will be the same plus the growth of your log file due to logging the transactions. However, internally, SQL server knows that it still has that space to play with.
    Other wise you can go for  update the statistics and rebuild indexes . but I think it would be the part of your normal weekend nightly maintenance plan
    Please click "Propose
    As Answer" if a post solves your problem, or "Vote
    As Helpful" if a post has been useful to you

  • Reuse of freed space after DELETE statement (ASSM)

    Dear Members,
    After DELETE of records in tables, the USED SPACE in tablespace still grows when new records are inserted. So the freed space is apparently not reused!
    DB is Oracle 9.2. and ASSM is used.
    Does anyone knows how to solve this problem?

    1) Table (heap) space will continue to grow after deletes if the new rows are appended (APPEND HINT). Appending rows does not reuse free space in existing blocks.
    2) Index space will continue to grow after deletes if the leaf blocks could not be reused. Index leaf blocks will be reused only if a) new data index keys will fit in on of the existing leaf blocks that still has entries after the delete completes; b) all of the entries in the leaf block were deleted and a new leaf block needs to be added to the index. It is possible to shrink/coalesce or rebuild an index to cure this phenomenon.

  • Reclaiming disk space after deleting virtual hard drive

    Hello forum, I have to temporarily create a 200GB virtual disk and attach to a virtual server. The purpose of the disk is for moving some files across different servers. Once the files have been moved, I would like to delete the disk and release the space back to the datastore. Can this be done? I have a datastore with enough disk space from which the temporary disk will be created. But I would like to release the space back to that datastore once purpose is solved. Any inputs?
    Thanks in advance.

    Like already stated above, make sure select the option Remove from virtual machine and delete files from disk when removing the disk from virtual machine. Take in mind that VM must not be running from a snapshot, otherwise only the delta file will be deleted: VMware KB: Removing a harddisk from a virtual machine through the vSphere client does not release the desired space.…

  • SQL azure database size not dropping down after deleting all table

    Dear all,
    I have a simple database on Azure for which I have deleted all table data. The size of the database is still showing 5Mb of data and I am charge for that. I have heard that this may happen from cluster index getting fragmented.
    I have run  a querry I found on internet on all my table index to show percentage of fragmentation and all report 0%.
    DBA is not so my job but what could it be or how can I reduce that size ?
    ON premise I would use COMPACT DB but not available in azure like some others DB action
    Thnaks for tips
    regards

    user created objects/data are not the only ones stored in your database. you got system objects and metadata as Mike mentions above.
    are you trying to skip being charged if you're not storing data? looking at the pricing table,  you'll still get charged the $4.995 for the 0-100MB database size range.

  • /dev/shm not release space after delete file.

    when I remove file from /dev/shm, the available space of shm still not increase.
    Is it having a command for shrinking  shm ?

    http://www.linuxquestions.org/questions … on-806387/
    Edit: Even the wiki has a thing or two on this subject https://wiki.archlinux.org/index.php//dev/shm
    Last edited by karol (2011-05-29 10:22:27)

  • Reclaim Disk Space After Deleting Versions.

    We've recently went through a few large Document Libraries using Power-Shell and deleted tens of thousands of versions of files we didn't need the version history for. 
    Unfortunately the DB size has not gotten any smaller. I went in to try and shrink the DB however there is very little available space to reclaim. 
    Is there something else that needs to be done after versions are deleted to fully release the drive space on our SQL box?

    Measuring the MDF/LDF isn't going to be a good calculation. For one, you have padding done by SQL Server itself, then you have index space and other metadata storage, and of course you have all of the information that is associated with the BLOB anyhow.
    But with 3 versions of the document, again only the differences are stored, so it wouldn't be 600KB * 3 in that case.
    http://blogs.technet.com/b/wbaer/archive/2012/11/12/introduction-to-shredded-storage-in-sharepoint-2013.aspx
    Also, why are you wanting to shrink the database? Shrinking destroys the indices and generally degrades performance (e.g. if you encounter another data file expansion).
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Extra White space after an inserted table

    Between a table I inserted into my document and the first line of text after my table I have almost a full page of blank space. There is no paragraph marker shown when I click "hide/show" and I cannot do anything with the document within the
    blank space. There is no page break that I can remove in the paragraph function with my cursor in front of that subsequent line of text. It is also not a style problem unless it has something to do with the table style. Please help. I'm using Microsoft
    Word 2013.

    Could you create a stripped-down copy of the document (without sensitive information) and make it available through one of the websites that let you upload and share a file, such as Microsoft OneDrive (https://onedrive.live.com),
    FileDropper (http://filedropper.com) or DropBox (http://www.dropbox.com). Make sure that you share the document (click Share, then Get a link), then post the link to the uploaded and
    shared file in a reply here.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Why Oracle Linux 5 cannot recover disk space after delete files ?

    Folks,
    Hello. When I create a Virtual Machine for Oracle Linux 5 to install EBS R12, I allocate 300GB to the VM. I download EBS R12 Source Files (45.7GB) and unzip the files (46GB). Total size of stage area directory(EBS_R12) is 91.7GB.
    Because some files are corrupted and cannot install, I move the folder EBS_R12 into trash but cannot empty trash. I move EBS_R12 from trash back to the directory. Then at root user, use command "rm -rf " to delete EBS_R12 completely.
    I shut down Oracle Linux 5 and restart it, 91.7GB disk space cannot recover.
    I download some other files into Oracle Linux files and then delete those files, but disk space cannot be recovered either.
    It seems that OEL5 virtual disk only can expand but cannot be reduced. The VM disk space is less than 200GB now and not enough to install EBS R12.
    Can any folks tell me how to make 91.7GB disk space and some more disk space come up ?

    Folks,
    Hello. Thanks a lot for replying.
    Host OS is Windows 7, Guest OS is Oracle Linux 5 on the top of VMPlayer 3. The VM of Oracle Linux 5 is created on the external USB drive and not on the local hard disk.
    There is a directory /tmp/VMwareDnd/376c7cae/EBS_R12 in Oracle Linux 5 file system. I copy/Paste the folder of EBS_R12 from Windows 7 into Oracle Linux 5. All of zip files and unzipped files are placed in the folder of EBS_R12.
    After EBS_R12 is deleted, the external USB drive(F:) doesn't come up 91.7GB disk space.
    My question is:
    Where to run "boot>linux rescue" command ?
    Does this command work correctly in the external USB drive ?

Maybe you are looking for