Deallocate unused space

Hi Folks,
I would like to know the difference between these 2 ways of deallocating the unused space.
Can you please provide me the details?
way1:
alter table table_name deallocate unused;
way2:
alter table table_name enable row movement;
alter table table_name shrink space compact;
alter table table_name shrink space;
alter table table_name disable row movement;
Thanks

Shrinking table using alter table shrink space statement is a better than using alter table deallocate unused because shrink operation unused space above and below high water mark. but just space deallocation operation will effect unused space only above high water mark.

Similar Messages

  • Need advice about coalesce and deallocate unused space

    Hi experts;
    Here looking for an advice about coalesce and deallocate unused space.
    I got this tablespace with 87% full, one of the table in that tablespace has 1,150,325 records.  I'm going to delete 500,000 records from that table, but to release the space used by those records I understand that I need to execute other procedure. I was reading about coalesce tablespace and deallocate unused space.
    I found that apparently, both process can help me to free space. If you want to share with me your comments, about  advantages or disadvantages about them, in order I can take the best solution?
    Thanks for your comments.
    Al

    Hi
    after deleted rows, the high water mark is still the same and so the size of the table. you need to bring down the water mark
    here is what you need to do to bring down the high water mark. We do this monthly for performance purpose.
    This is an EBS R12 system  but the procedures are the same for EBS database or non EBS database.
    After you purge or delete data in a table
    1) alter table APPLSYS.WF_ITEM_ATTRIBUTE_VALUES move; <-- this operation will invalidate all indexes attache to the table
    2)select owner, index_name, status from dba_indexes  -- list all invalid object for user APPLSYS
    where table_owner = upper('APPLSYS')
    and
    status NOT IN ('VALID','N/A');
    3)spool idxrebuild.sql --generate script to rebuild indexes.
    select 'alter index ' ||owner||'.'||index_name ||' rebuild online;'  from dba_indexes
    where table_owner = upper('APPLSYS')
    and
    status <> 'VALID';
    4) run idxrebuild.sql   -- to rebuild indexes.  -- at this point if you check spaces on the table, it is still the same, you need to run #5
    5)exec fnd_stats.gather_schema_stats ('APPLSYS');  --fnd_stat is for EBS system you can replace with the database equivalent command.
    use this statement to count the block before and after the operation to see the different.
    select DISTINCT(SEGMENT_NAME), count(blocks) "Total Block" from dba_extents
    where
    owner IN ('APPLSYS')
    AND segment_name = 'WF_ITEM_ATTRIBUTE_VALUES'
    Hope this help.

  • What is the different DEALLOCATE UNUSED - datafile resize operation ?

    hi everybody,
    i have a question about DEALLOCATE UNUSED.
    what is the different DEALLOCATE UNUSED command and datafile resize operation ?
    Thanks.

    Deallocate unused space clause is used to to explicitly deallocate unused space at "the end" of a segment and makes that space available for other segments within the tablespace. Internally, Oracle deallocates unused space beginning from the end of the objects (allocated space) and moving downwards toward the beginning of the object, continuing down until it reaches the high water mark (HWM).
    Datafile resize add/substracts physical operating system bytes from the datafile .
    Cheers :)
    Renjith Madhavan

  • How deallocate unused in partition

    dear all,
    In order to save space in my database, my steps to drop a table is:
    1.- truncate table TABLE_NAME reuse storage;
    2.- alter table TABLE_NAME deallocate unused ;
    3.- drop table TABLE_NAME ;
    This is ok.
    But my question is:
    * How can i proceed if my table have partitions? *
    I think that the syntax could be:
    1.- alter table TABLE_NAME truncate partition PARTITION_93 reuse storage;
    2.- ALTER TABLE TABLE_NAME deallocate unused ; This is my doubt
    3.- ALTER TABLE TABLE_NAME DROP PARTITION PARTITION_93;
    In step 2, how can i say that must to work in partition_93 ???
    thanks to all.

    The space allocated to the table,gets released once its dropped (or truncated.In truncate the tables structure stays).What is the need of 1st and 2nd step, when finally the table is dropped? correct me, might be i didn't understand your procedure for releasing/saving space.
    Anand

  • Add button to unused space in JTableHeader

    I have modified my JTable so that I can have multiple rows of column headers. I did this by extending BasicTableHeaderUI. In my particular instance, the first column of the table will never have more than one row in the header (unlike other implementations of multi-row headers I have seen, my column headers don't automatically fill upwards to take up all usable space in the header). So, I have "unused" space in the header above the first column.
    I would like to put some buttons there that are relevant to the table, but so far every effort to do so has failed.
    In the SSCCE below I have created a very stripped down version of my TableHeaderUI. It doesn't contain any of the code to create multiple row headers, it just pushes down the standard column headers to create some space. I try adding a button to the rendererPane, but it doesn't show up. There is a commented out line that paints the button which does work in terms of showing the button, but that's probably not the right way to do this (and the button doesn't work anyway).
    So, why isn't the button showing up? Am I doing this the right way (i.e. adding the button within the UI)? Thanks in advance for you help.
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.Enumeration;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.plaf.basic.BasicTableHeaderUI;
    import javax.swing.table.TableCellRenderer;
    import javax.swing.table.TableColumn;
    import javax.swing.table.TableColumnModel;
    public class HeaderButtonTable extends JPanel {
         public HeaderButtonTable() {
              String[] colNames = {"column 1", "column2", "column3"};
              Object[][] data = {{"a","b","c"},{"d","e","f"}};
              JTable table = new JTable(data, colNames);
              table.setPreferredScrollableViewportSize(new Dimension(400,100));
              table.setFillsViewportHeight(true);
              table.getTableHeader().setUI(new ButtonHeaderUI());
              JScrollPane scrollPane = new JScrollPane(table);
              add(scrollPane);
         public class ButtonHeaderUI extends BasicTableHeaderUI {
              public void paint(Graphics g, JComponent c) {
                   Rectangle clip = g.getClipBounds();
                   Point left = clip.getLocation();
                   Point right = new Point( clip.x + clip.width - 1, clip.y );
                   TableColumnModel cm = header.getColumnModel();
                   int cMin = header.columnAtPoint(left);
                   int cMax = header.columnAtPoint(right);
                   if (cMin == -1) cMin =  0;
                   if (cMax == -1) cMax = cm.getColumnCount()-1;
                   TableColumn draggedColumn = header.getDraggedColumn();
                   int columnWidth;
                   Rectangle cellRect = header.getHeaderRect(cMin);
                   TableColumn aColumn;
                   for(int column = cMin; column <= cMax ; column++) {
                        aColumn = cm.getColumn(column);
                        columnWidth = aColumn.getWidth();
                        cellRect.width = columnWidth;
                        if (aColumn != draggedColumn) {
                             paintCell(g, cellRect, column);
                        cellRect.x += columnWidth;
                  JButton test = new JButton("test");
                  test.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e) {
                             System.out.println("pressed");
                  test.setBounds(2, 2, 60, 15);
                  rendererPane.add(test);  //why isn't this showing up?
                  //this line will display the button, but button doesn't work
    //          rendererPane.paintComponent(g, test, header, 2, 2, 60, 15);
              private Component getHeaderRenderer(int columnIndex) {
                   TableColumn aColumn = header.getColumnModel().getColumn(columnIndex);
                   TableCellRenderer renderer = aColumn.getHeaderRenderer();
                   if (renderer == null) renderer = header.getDefaultRenderer();
                   return renderer.getTableCellRendererComponent(header.getTable(),
                        aColumn.getHeaderValue(), false, false, -1, columnIndex);
              private void paintCell(Graphics g, Rectangle cellRect, int columnIndex) {
                   Component component = getHeaderRenderer(columnIndex);
                   rendererPane.paintComponent(g, component, header,
                        cellRect.x, cellRect.y + 30, cellRect.width,
                        cellRect.height - 30, true);
              public Dimension getPreferredSize(JComponent c) {
                   long width = 0;
                   Enumeration enumeration = header.getColumnModel().getColumns();
                   while (enumeration.hasMoreElements()) {
                        TableColumn aColumn = (TableColumn)enumeration.nextElement();
                        width = width + aColumn.getPreferredWidth();
                   return new Dimension((int)width, 60);
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add(new HeaderButtonTable());
              frame.pack();
              frame.setVisible(true);
    }

    Yes, I've seen similar links/posts about how to activate buttons in the header of a table, but those do it by adding listeners to the renderer. My buttons would be directly in the CellRendererPane that is the container for the table header. I would have thought that by putting the button directly in the Cell RendererPane that it would have nothing to do with the rest of the table header. CellRendererPane extends Container. Is it not possible to put a JButton in a Container? JFrame extends indirectly from Container and you can add buttons to that.
    Edited by: Bob.B on Oct 28, 2009 10:57 PM

  • How do I fill the unused space?

    Hi there,
                I have an issue whereby I can not get the screen to use the unused space on the side of my presenter area.
    I have a big gray empty section on the right hand side and this makes my charts too small in the middle.
    Can any one tell me how to use the entire space available?
    I have tried to resize the screen resolution , tried using presenter area only tried clicking and dragging it wider but cant seem to get it to fill the gray area on the right hand side.
    I have attached a chart to show you what I mean.
    Thanx

    Hi there,
                Thanx for the answer...the problem is my members do see this area...that screen shot was sent to me from a member.
    They all can see that gray area which is why I am trying to fix it.
    I am a complete newbie to this software and so am still trying to make head or tail of the multitudious manuals and tutorials...
    would it be possible for you to post a step for step how to maximize the area seen by the members? I have attached a chart here sent to me from the same member of another connect pro room that uses all the space, have a look at their space usage...its fills the box and their off stage area on the right is very much smaller than mine.
    thanx

  • How do I reclaim the unused space after a huge data delete- very urgent

    Hello all,
    How do I reclaim the unused space after a huge data delete?
    alter table "ODB"."BLOB_TABLE" shrink space; This couldn't execute with ora 10662 error. Could you please help

    'Shrink space' has requirements:
    shrink_clause
    The shrink clause lets you manually shrink space in a table, index-organized table or its overflow segment, index, partition, subpartition, LOB segment, materialized view, or materialized view log. This clause is valid only for segments in tablespaces with automatic segment management. By default, Oracle Database compacts the segment, adjusts the high water mark, and releases the recuperated space immediately.
    Compacting the segment requires row movement. Therefore, you must enable row movement for the object you want to shrink before specifying this clause. Further, if your application has any rowid-based triggers, you should disable them before issuing this clause.
    Werner

  • Remove unused space

    I have 10 schema in a tablespace. I have drop 6 schema but my datafile size is not decrease.I want to remove unused space from datafile.How is it possible?
    Thanks

    select max(block_id)+bytes
    from dba_extents
    where tablespace_name = '<affected tablespace>'
    Sybrand Bakker
    Senior Oracle DBA

  • I erased my windows partition using disk utility then realized I should have used boot camp, because now I can't resize the original partition and seem to be stuck with a ghost unusable space. Boot Camp now doesn't give me the option to install or re

    I erased my windows partition using disk utility then realized I should have used boot camp, because now I can't resize the original partition and seem to be stuck with a ghost unusable space. Boot Camp now doesn't give me the option to install or remove windows partition.

    Hi, Ralph,
    The problem is that I did erase the partition, using disk utility, but I can't go back to my original disk size pre-partition, as disk utility won't let me do it and gives the message "Couldn’t modify partition map because file system verification failed." When I try to use Boot Camp Assistant it won't let me select the third option to remove windows.

  • Snapshot log and unused space

    I have a snapshot log that is big in size, yet empty. How can i shrink the shapshot log smaller ? Looking for the comparable command for a snapshot that we use for a table - by truncating the table. How do we do it in the snapshot/materialized view world ? I don't want to drop and recreate the snapshot log either.......at least not, if i can help it.
    Using Oracle 9.2 here on unix platform.

    Question: Do you understand why the table, without an index, has 32KB assigned and 4KB used?
    Answer: ASE will allocate an extent (8x 4KB pages = 32KB) when the table is created, and then assign (ie, 'use') one of those pages for immediate use by the table
    Question: What happens when an index is created?
    Answer: ASE will also allocate an extent (8x 4KB pages = 32KB) when the index is created, and then assign (ie, 'use') one of those pages for immediate use by the index
    If you run 'sp_spaceused tmp,1' you'll get a detailed breakdown of allocated/used/unused space for each index.
    NOTE: If you're running ASE 15.7 ESD#2 (or higher), the 'create table' command has a 'deferred_allocation' option that delays the allocation of an extent (for the table and each index) until the first row is inserted.

  • Where did 30GB of unused space on my SSD main drive go?  I have a mid 2011 iMac that until yesterday had just 54GB of space occupied on the primary drive.  I imported 45 minutes of video from an SD card.  Could that have used up the space?

    Where did 30GB of unused space on my SSD main drive go?  I have a mid 2011 iMac that until yesterday had just 54GB of space occupied on the primary drive.  I imported 45 minutes of video from an SD card.  Could that have used up the space?

    I added an SSD to my 27" 2011 iMac.  Although Sahidus is absolutely correct, it is much easier to add an SSD replacing the optical drive, it wasn't that bad to add it using an entirely seperate cable using SATA-III.  To me it is worth the extra hassle to install a SATA-III SSD.  This is where you are going to get maximum performance.
    Although it appears complicated, if you go slow, the procedure to install an SSD drive isn't too bad.  It takes at most 3 hours, as long as you are prepared and have all the parts and tools.
    http://www.btobey.com/learn/imac-ssd-install.php
    This describes how I did it.  Now I get awesome data performance from my iMac!
    I think the 21.5" may be more difficult to find where to place the SSD.  But im sure it is possible.  Just be creative.

  • Required to know unused space of a Table...

    Hello All,
    I'm trying to gather the unused space of a table (irrespective of the database on which SAP runs). Is there any FM that suits this requirement? If not unused, at least if there are FMs that can give me allocated space for a table (again irrespective of the database), kindly share the details. All the help is very much appreciated.
    Thanks,
    sunitha.

    hi i think you are thinking about these 2 FMs:
    DB_GET_TABLE_SIZE
    GET_TABLE_SIZE_ALL
    but those FMs will give us ony the used space, but i have to know Free space or total allotted size.
    if you any other FM for this purpose pls let me know.
    Pls let me know.
    Sunitha.

  • How to access unused space on a harddisk ? crypt this without part.

    Hello,
    i try to use unused space on a harddisk without a device-file.
    My harddisk:
    /dev/sda1    /boot
    /dev/sda2   SWAP
    /dev/sda5   /
    and the free/unused space after this partitions i like to use for cryptsetup luksFomat
    but i dont know how to access this.
    i dont like create a partition (like /dev/sda6) to hide the crypt space, i think a unused partition is treasonously.
    i can crypt /dev/sda an create LVM on sda, but then the harddisk looks like empty thats treasonously too.
    thanks

    Wow, you must live in a tough place.
    One might get a microSD card and plug it into your card reader when you need it, hiding it otherwise. These are very tiny cards and easy to hide.
    Truecrypt.org might have some ideas for you. But if you are arrested and trying to prove you have nothing "subversive" on your computer, you are already in a very bad situation no matter how good the technical means you have to hide things on your disk and anyway having truecrypt on your computer is incriminating. Can torture be ruled out? It can't even in the US any more (look up the phrase "extraordinary rendition"). It may be better to take Solzhenitsyn's advice:
    "And how we burned in the camps later, thinking: What would things have been like if every Security operative, when he went out at night to make an arrest, had been uncertain whether he would return alive and had to say good-bye to his family? Or if, during periods of mass arrests, as for example in Leningrad, when they arrested a quarter of the entire city, people had not simply sat there in their lairs, paling with terror at every bang of the downstairs door and at every step on the staircase, but had understood they had nothing left to lose and had boldly set up in the downstairs hall an ambush of half a dozen people with axes, hammers, pokers, or whatever else was at hand? . . ."
    Last edited by PaulBx1 (2011-09-27 16:13:49)

  • How to discard unused space on an SSD?

    Dear forum,
    I have bought an ssd several days ago and I've wiped the whole drive to prepare for system encryption.
    I now realized that it may not be really good to keep that random data on the ssd due to performance reasons. So now I would like to discard all unsed space except the space used by my partitions.
    How could I easily accomplish this?
    I have tried with hdparm and the trim option, but I do not think that worked quite well.
    I am uncertain what values to use for the initial sector and sector count. I'd be very happy if someone could explain me how to use this properly or even show me another way to accomplish this in case there is one.
    -szt

    If the unused space on the SSD is continuous, the easiest & safest is probably to create a partition in the unused space and then wipe it with /dev/zero again (man shred).
    Using tune2fs on it should do it also (once the 'unused' partition is setup), but then you have to mount it with the discard option also. With a partition setup temporarily for it, you get away without getting hdparm parameters correct.

  • Drive keeps filling up, with 100 gb unused space

    I have a FUJITSU drive 250gb which came with my Macbook aluminum bought a year ago. It has happened twice in different days within the last week or so, that I get this warning from OSX that the drive is filling up. I have approximately 100gb of unused space in my Hard Drive. The way I have fixed it before is by running Disk Permission Repair, and then also do a Disk Repair running from the Install Disk-Disk Utility.
    My report from the Disk Permission Repair, always indicates the following:
    Repairing permissions for “Macintosh HD”
    Permissions differ on "usr/share/derby", should be drwxr-xr-x , they are lrwxr-xr-x .
    Repaired "usr/share/derby".
    Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired.
    Permissions repair complete
    When I do the Repair Disk routine in the Install Disk - Disk Utility, it presents some "count" issues which are then repaired.
    If there is any information available to help me determine if this is OSX doing some errors, or if it the initial warning from a soon to die Hard Drive, please let me know.
    Is the report from Disk Permission something that could be fixed, or pay any attention to?
    Spinrite?
    regards,

    ok, I see repeatedly several times during the day the following message:
    "macbook /Applications/Microsoft Office 2008/Microsoft Entourage.app/Contents/MacOS/Microsoft Entourage[4065]: Warning: accessing obsolete X509Anchors."
    Regarding Entourage, there are also these, which seems errors:
    "May 11 14:53:24 macbook Microsoft Entourage[4065]: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 792
    May 11 14:53:24 macbook [0x0-0x89089].com.microsoft.Entourage[4065]: Tue May 11 14:53:24 macbook Microsoft Entourage[4065] <Error>: kCGErrorIllegalArgument: _CGSFindSharedWindow: WID 792
    May 11 14:53:24 macbook [0x0-0x89089].com.microsoft.Entourage[4065]: Tue May 11 14:53:24 macbook Microsoft Entourage[4065] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    May 11 14:53:24 macbook [0x0-0x89089].com.microsoft.Entourage[4065]: Tue May 11 14:53:24 macbook Microsoft Entourage[4065] <Error>: kCGErrorIllegalArgument: CGSGetWindowTags: Invalid window 0x318
    May 11 14:53:24 macbook Microsoft Entourage[4065]: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    May 11 14:53:24 macbook Microsoft Entourage[4065]: kCGErrorIllegalArgument: CGSGetWindowTags: Invalid window 0x318"
    any recommendation?
    thanks

Maybe you are looking for

  • Re: How to have more than one vertical axis in graphs...

    As a matter of fact, there is a library of dual-Y-axis controls, developed by National Instruments, but for some reason it did not make it into the official release. I've been using it under v.5.01 quite successfully. The only problem with it is that

  • How can I get rid of a 'ghost' Apple ID?

    Hi. Hoping for a little help here... I'm trying to set up an iCloud account from my iPhone 4 (running iOS 7.1.2). Problem is, when I try to do this I keep getting prompts to sign in to iCloud using an Apple ID I didn't know I had. The username is an

  • Linking Flash Banners to a Web Page

    I've had a bunch of Flash banners created. In DW CS3 (on Mac OS X 10.5.8), they display just fine, but I can't link them to a web page, like I can with any other graphic. Some old info I saw (three years old) says I have to create an invisible button

  • Obiee on websphere server

    Hi All, Does Anyone know how to install obiee OBIEE 10.1.4.3.2 on web sphere server ? I am looking for any installation document for this purpose. Appreciate your kind help. Surya

  • First- "R" - reset - doesn't seem right

    I have a 4th Gen that gives me intermittent trouble (for example, I choose an album to play, and it just skips through all the songs, then goes back to the "Artist" heading). When I do the first stage of troubleshooting - the reset (hold down menu an