Shrink / reclaim space

what is the best proceedure to reclaim or shrink a 109GB of reclaimable space? w/o using alot of disk space.
tyia

1. ALTER TABLE tablename SHRINK SPACE COMPACT;
-> DML operations and queries can be issued during compaction.
2. ALTER TABLE tablename SHRINK SPACE;
-> DML operations are blocked when the HWM is adjusted.
When you specify the SHRINK SPACE COMPACT clause, the progress of the shrink operation is saved in the bitmap blocks of the corresponding segment. This means that the next time a shrink operation is executed on the same segment, the Oracle database server remembers what has been done already. You can then reissue the SHRINK SPACE clause without the COMPACT clause during off-peak hours to complete the second phase.

Similar Messages

  • Need to reclaim space from dwh tables.

    We have couple of large tables (> 200G) in one of the DWH schema. I need to reclaim space on the mountpoint.
    I have used ALTER TABLE <> MOVE COMPRESS; command to compress these tables.
    Now in dba_segments it is showing the improvement. 200g table came down to 60G. However I am not able to see any change in datafile and in mountpoint, I beleive due to the HWM.
    I tried shrink for the tables, it did not help.
    Could you please suggest any other approach.

    refer to
    http://jonathanlewis.wordpress.com/2010/01/30/free-space/
    http://jonathanlewis.wordpress.com/2010/02/06/shrink-tablespace/
    Anand

  • Can't reclaim space in tablespace after deleting records

    Oracle 11gR1 RHEL5 64bit
    Hi.
    I am having trouble reclaiming space from a tablespace after having deleted all (thousands) of the records from a table (which resides in that tablespace). I have tried the following options to no avail:
    - Alter table <table_name> shrink
    - purge tablespace
    - purge recyclebin
    This table has several LOB columns and is using securefiles. I don't know if that has something to do with it or not. The tablespace is locally Managed and Segment space management is set to AUTO. Below is the create table command:
    CREATE TABLE IIQ.DICOM_OBJECT
    DICOM_OBJECT_RID NUMBER CONSTRAINT NN_DICOM_OBJECT_DICOM_OBJ_RID NOT NULL,
    SUBMISSION_RID NUMBER,
    SUBMISSION_ITEM_RID NUMBER,
    DICOM ORDSYS.ORDDICOM,
    IMAGETHUMB ORDSYS.ORDIMAGE,
    ANONDICOM ORDSYS.ORDDICOM,
    ACTIVE_FLAG VARCHAR2(1 CHAR) DEFAULT 'Y' CONSTRAINT NN_DICOM_OBJECT_ACTIVE_FLAG NOT NULL,
    CREATED_TIMESTAMP TIMESTAMP(6) WITH LOCAL TIME ZONE DEFAULT SYSTIMESTAMP CONSTRAINT NN_DICOM_OBJECT_TIMESTAMP NOT NULL,
    SOURCE_DESCRIPTION VARCHAR2(100 CHAR) CONSTRAINT NN_DICOM_OBJECT_SOURCE NOT NULL,
    OP_CONFORMANCE_FLAG VARCHAR2(1 CHAR)
    COLUMN IMAGETHUMB NOT SUBSTITUTABLE AT ALL LEVELS
    TABLESPACE IIQDCMDAT01
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 80K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    LOB ("DICOM"."EXTENSION") STORE AS SECUREFILE
    ( TABLESPACE IIQDCMLOB01
    DISABLE STORAGE IN ROW
    CHUNK 16384
    RETENTION
    NOCACHE
    INDEX (
    TABLESPACE IIQDCMLOB01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 208K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOB (SYS_NC00050$) STORE AS
    ( TABLESPACE IIQDCMDAT01
    ENABLE STORAGE IN ROW
    CHUNK 16384
    PCTVERSION 10
    NOCACHE
    INDEX (
    TABLESPACE IIQDCMDAT01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 80K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOB ("DICOM"."SOURCE"."LOCALDATA") STORE AS SECUREFILE
    ( TABLESPACE IIQDCMLOB01
    DISABLE STORAGE IN ROW
    CHUNK 16384
    RETENTION
    NOCACHE
    INDEX (
    TABLESPACE IIQDCMLOB01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 208K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOB ("ANONDICOM"."SOURCE"."LOCALDATA") STORE AS SECUREFILE
    ( TABLESPACE IIQDCMLOB01
    DISABLE STORAGE IN ROW
    CHUNK 16384
    RETENTION
    NOCACHE
    INDEX (
    TABLESPACE IIQDCMLOB01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 208K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    XMLTYPE SYS_NC00017$ STORE AS CLOB
    ( TABLESPACE IIQDCMLOB01
    DISABLE STORAGE IN ROW
    CHUNK 16384
    RETENTION
    CACHE READS
    INDEX (
    TABLESPACE IIQDCMLOB01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 208K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOB ("IMAGETHUMB"."SOURCE"."LOCALDATA") STORE AS SECUREFILE
    ( TABLESPACE IIQDCMLOB01
    DISABLE STORAGE IN ROW
    CHUNK 16384
    RETENTION
    NOCACHE
    INDEX (
    TABLESPACE IIQDCMLOB01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 208K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOB ("ANONDICOM"."EXTENSION") STORE AS SECUREFILE
    ( TABLESPACE IIQDCMLOB01
    DISABLE STORAGE IN ROW
    CHUNK 16384
    RETENTION
    NOCACHE
    INDEX (
    TABLESPACE IIQDCMLOB01
    STORAGE (
    INITIAL 80K
    NEXT 1
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    STORAGE (
    INITIAL 208K
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCACHE
    NOPARALLEL
    MONITORING
    ENABLE ROW MOVEMENT;
    Thank you all.

    Justin Cave wrote:
    OK, so you did a SHRINK SPACE CASCADE? Not just a SHRINK SPACE?That is correct.
    What makes you believe that there is more space that can be reclaimed? Well, what I don't understand is that when a table (and only that table) was assigned to a specific tablespace whose data was completely removed is showing as if the data is still there...at least when you look at the tablespace. If all the rows of a table are removed, then shouldn't the tablespace size go down? There was 95 GB of data in that tablespace and all from that one table, which was completely emptied. However, it still shows the tablespace as being 95GB full.
    Can you post the size of the table segment and the LOB segments as well as the size of the actual data in the table and the LOBs?Can you tell me which views you would like to the see the data from ? dba_lobs, dba_segments, etc... I want to make sure i have the right query for you.
    Here is some info...not sure if this is what you want (formatiing is off):
    select owner, segment_name, segment_type, tablespace_name, bytes
    from dba_segments
    where owner = 'IIQ'
    and tablespace_name = 'IIQDCMLOB01'
    and segment_type = 'LOBSEGMENT';
    OWNER SEGMENT_NAME SEGMENT_TYPE TABLESPACE_NAME BYTES
    IIQ SYS_LOB0000651630C00012$$ LOBSEGMENT IIQDCMLOB01 9.8416E+10
    IIQ SYS_LOB0000651630C00018$$ LOBSEGMENT IIQDCMLOB01 755236864
    IIQ SYS_LOB0000651630C00021$$ LOBSEGMENT IIQDCMLOB01 755236864
    IIQ SYS_LOB0000651630C00023$$ LOBSEGMENT IIQDCMLOB01 262144
    IIQ SYS_LOB0000651630C00044$$ LOBSEGMENT IIQDCMLOB01 262144
    IIQ SYS_LOB0000651630C00053$$ LOBSEGMENT IIQDCMLOB01 262144
    OWNER TABLE_NAME
    COLUMN_NAME
    ----------------------------------- SEGMENT_NAME TABLESPACE_NAME INDEX_NAME CHUNK PCTVERSION RETENTION FREEPOOLS CACHE LOGGING ENCR COMPRE DEDUPLICATION IN_ FORMAT PAR SEC
    IIQ DICOM_OBJECT
    "DICOM"."SOURCE"."LOCALDATA"
    SYS_LOB0000651630C00012$$ IIQDCMLOB01 SYS_IL0000651630C00012$$ 16384 10800 NO YES NO NO NO NO NOT APPLICABLE NO YES
    IIQ DICOM_OBJECT
    SYS_NC00018$
    SYS_LOB0000651630C00018$$ IIQDCMLOB01 SYS_IL0000651630C00018$$ 16384 10800 CACHEREADS YES NO NO NO NO ENDIAN NEUTRAL NO YES
    IIQ DICOM_OBJECT
    "DICOM"."EXTENSION"
    SYS_LOB0000651630C00021$$ IIQDCMLOB01 SYS_IL0000651630C00021$$ 16384 10800 NO YES NO NO NO NO NOT APPLICABLE NO YES
    IIQ DICOM_OBJECT
    "IMAGETHUMB"."SOURCE"."LOCALDATA"
    SYS_LOB0000651630C00023$$ IIQDCMLOB01 SYS_IL0000651630C00023$$ 16384 10800 NO YES NO NO NO NO NOT APPLICABLE NO YES
    IIQ DICOM_OBJECT
    "ANONDICOM"."SOURCE"."LOCALDATA"
    SYS_LOB0000651630C00044$$ IIQDCMLOB01 SYS_IL0000651630C00044$$ 16384 10800 NO YES NO NO NO NO NOT APPLICABLE NO YES
    IIQ DICOM_OBJECT
    "ANONDICOM"."EXTENSION"
    SYS_LOB0000651630C00053$$ IIQDCMLOB01 SYS_IL0000651630C00053$$ 16384 10800 NO YES NO NO NO NO NOT APPLICABLE NO YES
    Thanks.

  • Reclaim space from DBFs

    Hi All,
    I have one query regarding tablespace reclaim space. I have users tablespace which is having 5 dbfs. Some of the DBFs of USERS tablespace having autoextend on with max size 32G and some of the DBFs not having autoextend on and maxsize 4G.
    Now when I checked the USERS TBS through EM , I come to know only few MBs out of 20G are in used in 3 DBFs of USERS tablespace and rest of 2 dbfs are in good in use. Now I want to reclaim the space from 3 dbfs say users03,users04 and users05. users01 and users02 are properly in used. I want to reclaim the space from 03,04 and 05.
    can I have any idea how to reclaim space from dbfs? I try with alter database datafile ...resize but giving error "ORA-03297: file contains used data beyond requested RESIZE value".
    please suggest me,
    Thanks...

    Yes, I think you are understanding how it works. For a visual example, if this is your data file:
    XXXX--XX-XXXX-XXXX-XXXX-XXXXXXX-----------------
    and you delete some data
    XX----X--------X------------------X-----------------
    The datafile can be resized only down to
    XX----X--------X------------------X
    Which tools are available to do this efficiently vary by database version, for example in my 9.2.0.6 database I can use exp/imp, CREATE TABLE AS SELECT, rebuild indexes (mostly) online, exp/imp, move LOBs around with ALTER TABLE ... MOVE LOB, or other strategies - some of these are more work than others, and all will take some amount of time. In 8i There are fewer options; beginning with 10g data pump and DBMS_REDEFINITION are available; in 11g the index rebuilds don't lock the data, so the time may be less of a concern.
    Before you even spend the time to shrink these data files, consider the space needs for USERS. If the extended size was a one-time thing, then shrinking datafiles may be justified. If USERS may grow that large again then a data file shrink is a lot of work for little gain.

  • Benefits of Reorg to reclaim space in Oracle

    Hi All,
    I have archived and deleted records from few big tables from my database, now how want to reclaim space by doing reorg.
    Can anyone please guide me how to find out If I can reclaim some space by doing reorg.
    What are the queries which can help me find out space used before and after reorg.
    Thanks & Regards,
    Deepak

    You cannot do much with a long raw short of export/import it - so you would export it, drop the old table, create a new one in the new tablespace and import with ignore=y. Other objects can be online redefined into this tablespace - or indexes if they are in there can be rebuilt online into this new tablespace, but moving the long raw is going to be offline.  
    Source:Ask Tom &amp;quot;Reclaim space&amp;quot;
    Shrink, Move, CTAS (Reclaiming space) do not works for LONG datatype. For LONG dataype export/import is the best and feasible solution.
    Regards
    Girish Sharma

  • Reclaim space at OS level.

    Dear all
    I have performed following activities to reclaim space at database level on development system but I am quite suspicious about to reclaim at OS level.
    1) Choose baldat table for REORG candidate
    2) Size of table before deleting record was 11GB
    3) Delete record from it using slg2
    4) Offline REORG done
    5) Table size is now around 2.5GB
    6) Since database is DB9.7 and tablespace is in DMS type, I need to issue two command as following to reclaim space at DB and OS level.
         alter tablespace TCD#BTABD lower high water mark
         ALTER TABLESPACE TCD#BTABD REDUCE (ALL CONTAINERS G/K/M)
    7) I have issued only first command to lower HWM which freed up space at Database level.
         Checked from DBACOKPIT to see tablespace status as following
         Tablespace Name     KB Total     Percent Used     KB Free     Page Size (KB)     High-Water Mark (KB)    
         TCD#BTABD            16121856        33.25           10762016       16                         5359712
    Now my query is I want to reduce it down by 9GB at OS level so which figure I have to put (??) on the following. Is there any harm to execute this command on the fly which causes database issue???
          ALTER TABLESPACE TCD#BTABD REDUCE (ALL CONTAINERS ??? G/K/M)
    Thanks
    Mehul

    Hi,
    I have a following output from abovemention query
    TBSP_NAME                      TBSP_TYPE  RECLAIMABLE_SPACE_ENABLED
    SYSCATSPACE                    DMS                                1
    SAPTOOLS                       DMS                                1
    SAPEVENTMON                    DMS                                1
    PSAPTEMP16                     SMS                                0
    SYSTOOLSTMPSPACE               SMS                                0
    SYSTOOLSPACE                   DMS                                1
    TCD#STABD                      DMS                                1
    TCD#STABI                      DMS                                1
    TCD#BTABD                      DMS                                1
    TCD#BTABI                      DMS                                1
    TCD#CLUD                       DMS                                1
    TCD#CLUI                       DMS                                1
    TCD#POOLD                      DMS                                1
    TCD#POOLI                      DMS                                1
    TCD#DDICD                      DMS                                1
    TCD#DDICI                      DMS                                1
    TCD#DOCUD                      DMS                                1
    TCD#DOCUI                      DMS                                1
    TCD#EL702D                     DMS                                1
    TCD#EL702I                     DMS                                1
    TCD#LOADD                      DMS                                1
    TCD#LOADI                      DMS                                1
    TCD#PROTD                      DMS                                1
    TCD#PROTI                      DMS                                1
    TCD#ES702D                     DMS                                1
    TCD#ES702I                     DMS                                1
    TCD#SOURCED                    DMS                                1
    TCD#SOURCEI                    DMS                                1
    TCD#USER1D                     DMS                                1
    TCD#USER1I                     DMS                                1
    TCD#DIMD                       DMS                                1
    TCD#DIMI                       DMS                                1
    TCD#FACTD                      DMS                                1
    TCD#FACTI                      DMS                                1
    TCD#ODSD                       DMS                                1
    TCD#ODSI                       DMS                                1
      36 record(s) selected.
    Thanks
    Mehul

  • Re-organizing table to reclaim space

    Hi All,
    Recently we have purged data from some tables in the database.
    Is it necessary to reorganize the table to reclaim space after we remove the data from the tables? How can we find out that the table can be reorganized?
    Database version:11.2.0.2
    OS version:AIX

    how did you purge the data?
    have you used delete or truncate.
    please check space under dba_segments for particular object which was purged.
    from 10g onwards we have segment advisor.
    The segment advisor performs analysis on the fragmentation of specified tablespaces, segments or objects and makes recommendations on how space can be reclaimed. The advisor is accessible from Enterprise Manager (Home > Advisor Central > Segment Advisor) or from PL/SQL by using the DBMS_ADVISOR package.
    https://forums.oracle.com/forums/ann.jspa?annID=718
    Please close the thread after marking it helpful or correct if you get the answer.
    Thanks
    Kuljeet Pal Singh

  • Query needed to find reclaimable space in db

    10.2.0.4
    Linux 4.
    Hi.
    On a test database I suspect there are a lot of objects that are not needed that are taking up valuable disk space. These may include tables that are backups of tables etc.
    Does anyone have a tested query to seek out these objects? They will have probably been named test, or backup, etc.
    Thanks in advance.

    Apparently you want to find candidate junk objects to discard. This is a quite specific subset of the overall issue of finding reclaimable space. In the overall issue a lot of attention should be paid to whether temporarily supressing some free space (due to massive deletions, for example) is worthwhile. In the subset you inquire about, if you can identify the junk it is almost certainly a win to discard it. Some shops have naming standards for objects not officially sanctioned in the production schema. My favorite is the prefix JUNK_<initials>_, so that all the objects can be found quickly with the wildcard on the efficient end of the query, as in:
    select owner,object_name,object_type
       from dba_objects
       where object_name like 'JUNK%'
       order by object_name;
    or
    select owner,object_name,object_type
       from dba_objects
       where object_name like 'JUNK_MWF%'
       order by object_name;Even just the naming convention makes it easy to identify candidate objects, and if you have rules about creating "JUNK" objects such as maintaining a log with expiration dates and purposes, then further inquiry is easy. Having the object's sponsor's initials at hand makes a personal interview possible if the log entries are not useful, and if an expiration date is provided you can simply use the log table as a list to control deleting discardable objects.
    In your case you are dealing with catching the horses after the stalls and barn door were left open. Up to now I've written more about closing the barn door for future efforts.
    For the cleanup, the similar query with the like predicate '%TEST' and other candidate name templates should suffice. Depending on how creative folks have been spelling TST and BCKUP, you may want to play with the regex functions. Just be sure to treat the generated list as a list of candidates. Depending on the length of the list you can then either generate the appropriate drop statement by type or simply type them into a file for review and execution. Sending out the list of objects to be deleted with a reasonable warning period is highly recommended, since having the ability to create unknown objects often implies sufficient rank to ignore organizational rules. Whether creating an individual object export prior to the drop will vary from site to site and by the size of the object to be dropped.
    Good luck,
    mwf (aka pudge)

  • Shrink the space between rows in a report

    hi all,
    As the subject says, I am trying to shrink the space between rows in a report so that there is no space between rows when i print it. Does anyone know how to do this? Do I need to make a custom report template for it?

    The space between rows in a report in Apex is frequently determined by the cellpadding and cellspacing attributes of the TABLE tag that makes up the innermost report area, but there also other factors that may affect the resulting area, so one has to look at the specific case and see what is determining the final result, bearing in mind that it's quite possible that two browsers will display the same thing differently.
    At any rate, spacing is normally controlled by fine-tuning margin and padding properties in CSS.
    As CSS stylesheets, as per their name, are applicable in cascade, you can add your own CSS stylesheet in the page header (after the built-in ones).
    If you are using Firefox (with Firebug add-on installed) or Chrome or Safari, you can easily experiment with these properties and see the effects by temporarily setting or unsetting certain values and when you are satisfied, you can copy the resulting definitions into your stylesheet.
    The fact you want to make some adjustments only when printing can be solved by means of the @media rule inside the stylesheet or by linking different stylesheets depending on the value of the media attribute in the LINK tag or by dynamically pointing to different stylesheets depending on whether Apex is rendering the page in printer-friendly mode or not.
    Flavio
    http://oraclequirks.blogspot.com

  • Ssd reclaim space

    How can I reclaim space after file deletions on NVidia MCP89 AHCI?

    Boot into internet recovery and repair the disk.
    Boot up holding Command Option R
    Resolve startup issues and perform disk maintenance with Disk Utility and fsck

  • Clear FND_LOBS to reclaim space in applsysd

    we have on LOB in applsysd tablespace which is taking 20% space in tablespace. I do not need this, please advise how to move to reclaim space on it.
    I have LOB segment details and we can findout LOB files location in FND_LOBS, but wondering how to match both of these.

    Review the following notes:
    Note: 303709.1 - Reclaiming unused space in APPLSYSD tablespace
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=303709.1
    Note: 298698.1 - Avoiding abnormal growth of FND_LOBS table in Applications 11i
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=298698.1
    Note: 555463.1 - How to Purge Generic or Purchasing Attachments from the FND_LOBS Table
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=555463.1

  • Reclaim space FND_LOBS

    Hi All,
    EBS R12.1.3 , DB 11.2.0.2 RAC 2 nodes
    I have recently Reclaimed the space from FND_LOBS table , but even after this , Total allocated space showing 135 GB , and when i see the space occupied is 61G only, please help in this how can i get back the space. I followed note Reclaiming unused space in an E-Business Suite Instance tablespace (Doc ID 303709.1)
    select
      owner                  username,
      segment_name           segment_name,
      segment_type           segment_type,
      bytes/1024/1024/1024   Gbytes,
      extents                extents
    from
      dba_segments
    where
      segment_name ='SYS_LOB0000034032C00004$$'
    USERNAME SEGMENT_NAME      SEGMENT_TYPE  GBYTES                 EXTENTS
    APPLSYS SYS_LOB0000034032C00004$$ LOBSEGMENT 135.297607421875 1108358
    select sum(dbms_lob.getlength(file_data))/1024/1024/1024 GB from   applsys.fnd_lobs;
    GB
    61.2054669829085
    select PCTVERSION from dba_lobs where TABLE_NAME = 'FND_LOBS' and COLUMN_NAME='FILE_DATA';
    0
    thanks

    Please review the following docs and see if it helps.
    Reclaiming unused space in an E-Business Suite Instance tablespace (Doc ID 303709.1)
    Avoiding abnormal growth of FND_LOBS table in Applications 11i (Doc ID 298698.1)
    FAQ - Performance Considerations For FND_LOBS (Doc ID 829235.1)
    Using SHRINK or DELETE on tables FND_LOG_MESSAGES, FND_TEMP_FILE_PARAMETERS, FND_LOBS in EBS (Doc ID 1066580.1)
    Thanks,
    Hussein

  • How can I verify if SHRNK or MOVE will reclaim space?

    Hi all,
    I need to optimize a 9.2 and a 10.2 database.
    I suspect fragmentation to be one of the causes of slowness (some queries do a lot of full table scan), but I want to rebuild only the objects which really contain unused .
    How can I verify in advance if an ALTER TABLE SHRINK or ALTER TABLE MOVE will really reclaim free space? I'd like to verify if some segments are good candidates for shrinking rather when do an "ALTER TABLE MOVE" on the whole database...
    Is DBMS_SPACE.SPACE_USAGE the only thing I can use?
    thanks in advance for every answer.
    andrea

    Normally I use this package from Tom Kyte to check the space usage of the object.
    create or replace procedure show_space
    ( p_segname in varchar2,
      p_owner   in varchar2 default user,
      p_type    in varchar2 default 'TABLE',
      p_partition in varchar2 default NULL )
    -- this procedure uses authid current user so it can query DBA_*
    -- views using privileges from a ROLE and so it can be installed
    -- once per database, instead of once per user that wanted to use it
    authid current_user
    as
        l_free_blks                 number;
        l_total_blocks              number;
        l_total_bytes               number;
        l_unused_blocks             number;
        l_unused_bytes              number;
        l_LastUsedExtFileId         number;
        l_LastUsedExtBlockId        number;
        l_LAST_USED_BLOCK           number;
        l_segment_space_mgmt        varchar2(255);
        l_unformatted_blocks number;
        l_unformatted_bytes number;
        l_fs1_blocks number; l_fs1_bytes number;
        l_fs2_blocks number; l_fs2_bytes number;
        l_fs3_blocks number; l_fs3_bytes number;
        l_fs4_blocks number; l_fs4_bytes number;
        l_full_blocks number; l_full_bytes number;
        -- inline procedure to print out numbers nicely formatted
        -- with a simple label
        procedure p( p_label in varchar2, p_num in number )
        is
        begin
            dbms_output.put_line( rpad(p_label,40,'.') ||
                                  to_char(p_num,'999,999,999,999') );
        end;
    begin
       -- this query is executed dynamically in order to allow this procedure
       -- to be created by a user who has access to DBA_SEGMENTS/TABLESPACES
       -- via a role as is customary.
       -- NOTE: at runtime, the invoker MUST have access to these two
       -- views!
       -- this query determines if the object is a ASSM object or not
       begin
          execute immediate
              'select ts.segment_space_management
                 from dba_segments seg, dba_tablespaces ts
                where seg.segment_name      = :p_segname
                  and (:p_partition is null or
                      seg.partition_name = :p_partition)
                  and seg.owner = :p_owner
                  and seg.tablespace_name = ts.tablespace_name'
                 into l_segment_space_mgmt
                using p_segname, p_partition, p_partition, p_owner;
       exception
           when too_many_rows then
              dbms_output.put_line
              ( 'This must be a partitioned table, use p_partition => ');
              return;
       end;
       -- if the object is in an ASSM tablespace, we must use this API
       -- call to get space information, else we use the FREE_BLOCKS
       -- API for the user managed segments
       if l_segment_space_mgmt = 'AUTO'
       then
         dbms_space.space_usage
         ( p_owner, p_segname, p_type, l_unformatted_blocks,
           l_unformatted_bytes, l_fs1_blocks, l_fs1_bytes,
           l_fs2_blocks, l_fs2_bytes, l_fs3_blocks, l_fs3_bytes,
           l_fs4_blocks, l_fs4_bytes, l_full_blocks, l_full_bytes, p_partition);
         p( 'Unformatted Blocks ', l_unformatted_blocks );
         p( 'FS1 Blocks (0-25)  ', l_fs1_blocks );
         p( 'FS2 Blocks (25-50) ', l_fs2_blocks );
         p( 'FS3 Blocks (50-75) ', l_fs3_blocks );
         p( 'FS4 Blocks (75-100)', l_fs4_blocks );
         p( 'Full Blocks        ', l_full_blocks );
      else
         dbms_space.free_blocks(
           segment_owner     => p_owner,
           segment_name      => p_segname,
           segment_type      => p_type,
           freelist_group_id => 0,
           free_blks         => l_free_blks);
         p( 'Free Blocks', l_free_blks );
      end if;
      -- and then the unused space API call to get the rest of the
      -- information
      dbms_space.unused_space
      ( segment_owner     => p_owner,
        segment_name      => p_segname,
        segment_type      => p_type,
        partition_name    => p_partition,
        total_blocks      => l_total_blocks,
        total_bytes       => l_total_bytes,
        unused_blocks     => l_unused_blocks,
        unused_bytes      => l_unused_bytes,
        LAST_USED_EXTENT_FILE_ID => l_LastUsedExtFileId,
        LAST_USED_EXTENT_BLOCK_ID => l_LastUsedExtBlockId,
        LAST_USED_BLOCK => l_LAST_USED_BLOCK );
        p( 'Total Blocks', l_total_blocks );
        p( 'Total Bytes', l_total_bytes );
        p( 'Total MBytes', trunc(l_total_bytes/1024/1024) );
        p( 'Unused Blocks', l_unused_blocks );
        p( 'Unused Bytes', l_unused_bytes );
        p( 'Last Used Ext FileId', l_LastUsedExtFileId );
        p( 'Last Used Ext BlockId', l_LastUsedExtBlockId );
        p( 'Last Used Block', l_LAST_USED_BLOCK );
    end;
    /Read about it completely here.
    Aman....

  • Hired a movie, completed download, got stuck processing, can't reclaim space

    Here are the steps that led to my issue:
    1. Hired a movie from my iphone 5
    2. began download
    3. Checked download an hour later and status was 'Processing.....'. Checked
    Movies and no Hired icon present in bottom nav
    4. 6 hours later, still in Processing
    5. Reset phone (held power+menu button util apple logo appears)
    6. check download status in itunes store and download starts again but fails due to not enough space
    7. Check Movies and rental icon is in Nav and hired movie is listed. Click okay but movie fails to play.
    8. Delete movie
    9. Go back to itunes download and start to download again
    10. Download fails due to not enough space. The deleted movie was removed from the a Rental section but the space associated with the failed download was not reclaimed.
    Any tips?
    Thanks

    Looks like they've changed the screens overnight - they were different yesterday, you had a set of options on the left-hand side of the page and didn't need to enter a serial number.
    You could instead try the 'report a problem' link from your purchase history (assuming that hasn't been changed as well) : log into your account on your computer's iTunes via Store > View My Account and you should then see a Purchase History section with a 'see all' link to the right of it ; click on that and you should see a list of your purchases ; find that film and use the 'Report a Problem' link.

  • Reclaim space from empty queues

    I'm using Glassfish 3.1.2 that comes with embedded OpenMQ (4.5.2 (Build 2-d)).
    When I put persitent messages into a queue the messages are saved to disk and they take space.
    When I receive messages from queue the space on disk is not reduced.
    Is there a way to reclaim that space?
    So for example, if a queue with 100 messages takes 50MB on disk, then the messages are received from the queue and the queue still takes 50 MB on disk. I want it to take 0MB (or some small number).

    Hello,
    Run following query by replacing with your table name and appropriate one partition range. In TOAD, you can anaylze or collect stats on partition it will update the partition tab with latest infornation meaning 0 zeros for truncated partition.
       select count(*) from yourtablename where date_column between to_date('20090101,'YYYYMMDD') and to_date('20090102','YYYYMMDD') ;Regards

Maybe you are looking for