Alter SHRINK SPACE in oracle 10g

Hello,
My table PRICE_T table gets deleted and inserted almost 50 million records everyday.
Now it takes too much time to perform this operation because of TABLE fragmented.
i can use "CREATE table as select” option to remove fragmentation from table.
but i dont want to use this option.
so i hv tried ALTER TABLE SHRINK SPACE as i m using ORACLE 10g
alter table price_t enable row movement;
alter table price_t shrink space
alter table price_t disable row movement;
and i have applied following query to check table gets remove free space but still having free space after applying ALTER SPACE COMMAND
select table_name,round((blocks*8),2)||'kb' "size1",round((num_rows*avg_row_len/1024),2)||'kb' "size"
from DBA_tables
where table_name = 'PRICE_T';
Tablespace in PRICE_T table fall into is SEGMENT SPACE MANAGEMENT AUTO
please help me to remove fragmentation from table using SHRINK command.
Thanks.

Now it takes too much time to perform this operation because of TABLE fragmented.How do you define "fragmented"?
Why do you believe that your table is fragmented?
Why do you believe that the fragmentation is causing performance problems?
select table_name,
       round((blocks*8),2)||'kb' "size1",
       round((num_rows*avg_row_len/1024),2)||'kb' "size"
  from DBA_tables
where table_name = 'PRICE_T'; - What is the output of this query before and after you shrink the table?
- Are your statistics up to date? NUM_ROWS, BLOCKS and AVG_ROW_LENGTH provide information to the optimizer-- they are estimates gathered when object statistics are gathered. They are not maintained by Oracle in real time and may be substantially out of date.
- I don't see any attempt to account in this query for overhead like PCTFREE.
- Is there a reason that you aren't using the DBMS_SPACE package? This query seems highly suspect.
Justin

Similar Messages

  • How to avoid:Query returns extra trailing spaces in oracle 10g

    I want to use cursor sharing FORCE, SIMILAR for performance tuning. but i am having some problems like query process will give extra trailing spaces this will throw errors from the java application while reading literals.
    do we have any option in oracle 10g to avoid extra trailing spaces during query processing ?
    alter session set cursor_sharing ='EXACT'
    select 1 from dual;
    '1'
    1
    alter session set curson_sharing='FORCE'
    select 2 from dual;
    '2'
    2
    alter session set curson_sharing='SIMILAR'
    select 3 from dual;
    '3'
    3

    You are right, But we already wrote millions of queries during that time we used cursor sharing is EXACT. so i don't want to take risk in modifying all the existing queries by adding TRIM.
    do we have any option in oracle to trim after/ during processing the query.
    Now we are facing performance issues and suggested us to use SIMILAR as cursor_sharing. but all the selected rows are giving extra tralining spaces.
    I think i am clear now.

  • How to verify reused table space in oracle 10g ?

    Hi..
    From my system, i have seen that the table size keep increasing event the delete query is running. Due to that, I would to check either the oracle allowed to reuse the table space or not ? if not then how could i enable it ?
    Please help me..
    Thank you,
    Baharin

    You can use dbms_space.space_usage to check the for free space.
    Space reuse will depend on whether you are using MSSM or ASSM, PCT_FREE, PCT_USED, and how new data is inserted ?
    You can shrink or move the table and rebuild indexes to reclaim space.

  • Export 500gb database size to a 100gb file system space in oracle 10g

    Hi All,
    Please let me the know the procedure to export 500gb database to a 100gb file system space. Please let me know the procedure.

    user533548 wrote:
    Hi Linda,
    The database version is 10g and OS is linux. Can we use filesize parameter for the export. Please advice on this.FILESIZE will limit the size of a file in case you specify multiple dumpfiles. You could also could specify multiple dump directory (in different FS) when given multiple dumpfiles.
    For instance :
    dumpfile=dump_dir1:file1,dump_dir2:file2,dump_dir3:file3...Nicolas.

  • Increase 'archive_max_process'  in oracle 10g

    Dear Friends ,
    I want to increase the value of 'archive_max_process' dynamically (i.e., alter system or alter database ) in my oracle 10g . Is it possible to do ?

    Hi,
    Kindly find the below.
    alter system set log_archive_max_processes=4;
    The LOG_ARCHIVE_MAX_PROCESSES initialization parameter specifies the number of ARCn processes that the database initially invokes. The default is two processes. There is usually no need specify this initialization parameter or to change its default value, because the database starts additional archiver processes (ARCn) as needed to ensure that the automatic processing of filled redo log files does not fall behind.
    However, to avoid any runtime overhead of invoking additional ARCn processes, you can set the LOG_ARCHIVE_MAX_PROCESSES initialization parameter to specify up to ten ARCn processes to be started at instance startup. The LOG_ARCHIVE_MAX_PROCESSES parameter is dynamic, and can be changed using the ALTER SYSTEM statement. The database must be mounted but not open. The following statement increases (or decreases) the number of ARCn processes currently running:
    ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES=3;
    Best Regards
    RajaBaskar

  • Table space not reduce after delete in oracle 10g

    Hi..
    Based on my system, i have found that my oracle table space did not reduce after the deletion query. Why ?.. Could somebody help me. As your info, I am using oracle 10g.
    Thank you,
    Baharin

    After Delete the table space will not be set free. high water mark will not be reset. to regain the space you need to recognize the objects from which you deleted the data. This can be done in many ways.
    1) Move the objects.
    Alter table temp move --> optionally tablespace clause can be used. After this you need to rebuild table indexes.
    2) With 10g table can be shrinked or reorganize to free the space.
    alter table mytable enable row movement;
    alter table mytable shrink space;
    3) Export/Import
    export the objects and drop and recreate with import.

  • Shrinking BLOB tablespace in Oracle 10g

    Hello,
    I have table created with 32 GB in Oracle 10g with BLOB field containing images. after that I have deleted some of the images from the table but when I'm checking free space, it is show full 32 GB. But when I'm looking at Toad it shows me out of 32 GB 17 GB is free.
    my question is how to shrink/resize blob tablespace/table having BLOB field in oracle 10g 2rel ?

    Hello urgent,
    Tablespace management is not really an Oracle Spatial topic, I suppose these are georaster images?. You probably want to search and post in the more general database forums.
    The quick answer is that it is not easy. Oracle tablespaces may only be "shrunk" if the free space is at the end of the datafile at the "high water" mark. If by some wild coincidence the images you removed were indeed at the back of the datafile, then you could alter the datafile with a RESIZE command. But the odds of that being the case are incredibly low. If you really, really MUST recover that space then about the only thing to do is export the data, delete it from the tablespace, shrink the tablespace and then import the data back in. Another approach if you have the space is just move the data into another empty tablespace and then drop the original tablespace. I would guess that the salary expended for you to take everything offline and do this would be more than just buying another cheap disk. Considering that in doing your daily work you may well indeed be in this position again in a few weeks, then it makes even less sense.
    Now having said all that I have been in the situation where I MUST recover that space without taking everything offline.
    One thing you can try is to "pop" the last items off the datafile (moving them to another tablespace) identified using the query below. But this is an exercise in futility unless your resources happen to be nicely "chunked" together near the highwater mark. Oracle tends to stripe resources across the available space in the datafile. So you might find you need to move half the contents before recovering any significant amount of space.
    Cheers,
    Paul
       SELECT '
       a.owner, '
       a.segment_name, '
       a.segment_type, '
       a.block_id, '
       a.tablespace_name '
       FROM '
       dba_extents a '
       WHERE '
       a.file_id = ( '
          SELECT '
          b.file_id '
          FROM '
          dba_data_files b '
          WHERE '
          b.file_name = :p1 '
       ORDER BY '
       a.block_id DESC

  • Oracle 10g not releasing space after delting the records

    Hello
    We have a tool which uses Oracle 10g as database. We have been deleting records from the tool and the table space does not show any improvements in the free space. When we have taken the dump and recreated the schema all the unused space is visible. Before recreating the schema database was showing 17.5 GB after recreatig it has hardly 1G which is real. Clearly this is not recommended on a production environemt. Please suggest.

    By performing DELETE operations you will not get back the used space. Extents are still allocated to the segments. To free unused extents you may have to do one of the following:
    1) move table within the same tablespace
    2) shrink the table
    3) exp/imp
    .......

  • Is alter table shrink space a logged operation?

    Hello -
    I am running alter table xxxxxx shrink space. I have a few questions:
    1. Is this a logged operation? Oracle handles this interanally as insert/delete operations, but I am not seeing more arch logs being generated.
    2. If I stop in the middle of the shrink process, can Oracle resume where it left off?
    3. How can I monitor the progress of the shrink operation? I am not seeing the sid, serial# in v$session_longops.
    Any help is much appreciated!
    Thanks,
    mike

    I'm not sure that you will be able to "monitor" it.
    You could test using dbms_space to see if it shows any changes will the shrink is in progresss.
    One other way would be to watch V$TRANSACTION USED_UREC (which will reflect counts for rows and index entries) to see USED_UREC approaching the expected number of table+index entries being rebuilt.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Alter table modify lob shrink space hangs despite ddl_lock_timeout

    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    The following command hangs despite session parameter ddl_lock_timeout being set to 0:
    alter table <table> modify lob (<column>) (shrink space);
    Data type of <column> is CLOB. In another session a transaction on <table> is open, with a simple update on a different (non-LOB) column.
    Looks like a bug to me, but have no access to metalink for confirmation/SR submission and would appreciate any comments/help on this issue.

    From Oracle 11 documentation ( http://docs.oracle.com/cd/B28359_01/server.111/b28310/schema003.htm#CBBBIADA )
    "Segment shrink is an online, in-place operation. DML operations and queries can be issued during the data movement phase of segment shrink."
    Simon

  • Oracle 10g DBCA error - not enough space on root?

    Im running Oracle 10g on HP-UX 11i.
    Oracle software is installed ok. Already created a database succesfully. I have now deleted that database and am creating a new one using dbca.
    When I get to the final step I get the following error:
    You do not have enough free disk space to create the database. You need at least 785,408KB on /, you only have 753,664KB available please allocate more free disk space.
    The above is true but I am not putting any datafiles/ redo logs etc on root they are on a separte logical volume. Why does it need all this space on root? I cant add any more space to root anyway as I cant unmount root and extend it.
    Cant find anything about this in the oracle documentation, I can only think my oracle software install has got messed up causing this strange error?
    Can anyone help? Thanks.

    @ Oracle software is installed ok. Already created a database succesfully. I have now deleted that database and am creating a new one using dbca.
    When I get to the final step I get the following error:
    You do not have enough free disk space to create the database. You need at least 785,408KB on /, you only have 753,664KB available please allocate more free disk space.
    When you create database with DBCA, it gives a few options like General purpose, OLTP, etc.
    Did you pick same options both the time?

  • How to Access Table Space Map in Oracle 10g OEM

    How and from where to Access Table Space Map in Oracle 10g OEM ??
    Thanks

    Hi,
    first of all, the online help system of grid control is outstanding. Just click on Help in the upper right corner and enter "Tablespace Extent Map" in the search form.
    Result:
    Show Tablespace Contents Page
    Each Oracle database is divided into one or more logical units called tablespaces. You can use Oracle Enterprise Manager to manage these tablespaces and create or modify the parameters for the tablespaces. Use the Tablespace property sheet to set general and storage information for the specified tablespace.
    Use the Show Tablespace Contents page to display the list of tablespace segments that comprise the existing tablespace. You can display Tablespace Extents by choosing Show Tablespace Extent Map at the bottom of the page. An extent is a logical unit of database storage space allocation made up of a number of contiguous data blocks. One or more extents in turn make up a segment. When the existing space in a segment is completely used, Oracle allocates a new extent for the segment.
    You can view segment extents by clicking on the link in the Extents column to display the Extents in Segments page.
    You can display the Show Tablespace Contents page by choosing Show Tablespace Contents from the command drop down list on the Tablespace property page, the Tablespace View page, or the Tablespace search results page.
    Note: Developers could only display the tablespace map to a maximum hard coded number of 30,000 extents. Tablespaces are often larger than that. If a tablespace is larger than 30,000 extents, the portion over that is displayed as Unmapped. To avoid exceeding the memory capacity of the tablespace map and to display the map without unmapped extents, use a search criteria displaying results of less than 30K extents.
    For an overview of tablespaces, see the "Overview of Tablespaces " chapter of the Oracle Database Concepts Guide.
    For more information about managing tablespaces, see the " Managing Tablespaces" chapter of the Oracle Database Administrators Guide.
    For more information about managing datafiles, see the " Managing Datafiles and Tempfiles" chapter of the Oracle Database Administrator's Guide.

  • Access Table Space Map in Oracle 10g EM

    From where can I access Access Table Space Map in Oracle 10g EM?
    Thanks

    From where can I access Access Table Space Map in Oracle 10g EM?
    Thanks

  • What is the version of grant alter table, drop table to user in Oracle 10g?

    Hi,
    Oracle support "grant alter table and drop table" before, but I get the "invalid privilege" error in Oracle 10g. Oracle 10g have the "DROP ANY TABLE" and "Alter any table". Is these two means can drop and alter tables belonging to other users? How do I grant the total control (CRUD) of tables in the owner's schema to the owner in Oracle10g?
    Thanks,
    Jiang

    CREATE TABLE privilege grants complete control on owner's tables :
    SYS@db102 SQL> create user test01 identified by test01;
    User created.
    SYS@db102 SQL> grant create session, create table to test01;
    Grant succeeded.
    SYS@db102 SQL> alter user test01 quota unlimited on users;
    User altered.
    SYS@db102 SQL> conn test01/test01
    Connected.
    TEST01@db102 SQL> create table test(a number);
    Table created.
    TEST01@db102 SQL> alter table test add(b varchar2(100));
    Table altered.
    TEST01@db102 SQL> drop table test purge;
    Table dropped.
    TEST01@db102 SQL>                                                      

  • How SMON coalesces free space in oracle 9i and 10g

    how SMON coalesces free space in oracle 9i and 10g?
    Is it doing same as it was behaving in oracle 7 like looking through free extent table every five minutes (sys.fet$) to see if there are any adjacent free extents that can be coalesced into a single extent, and on every 25th cycle (i.e. every two hours and five minutes) it looks at the segment table (sys.seg$) to see if there are any temporary segments that need to be eliminated, as explained by jonathan lewis?
    what are extent and segment tables available in oracle 9i and 10g like sys.fet$ and sys.seg$ in oracle7?

    >
    how SMON coalesces free space in oracle 9i and 10g?
    Is it doing same as it was behaving in oracle 7 like looking through free extent table every five minutes (sys.fet$) to see if there are any
    adjacent free extents that can be coalesced into a single extent, and on every 25th cycle (i.e. every two hours and five minutes) it looks
    at the segment table (sys.seg$) to see if there are any temporary segments that need to be eliminated, as explained by jonathan lewis?
    what are extent and segment tables available in oracle 9i and 10g like sys.fet$ and sys.seg$ in oracle7?I think you need to go and have a look at the Oracle 9i documentation here
    http://www.oracle.com/technology/documentation/oracle9i_arch_901.html
    and automatic segment management in 10g
    http://www.oracle.com/technology/pub/articles/10gdba/week15_10gdba.html
    HTH.
    Paul...
    Software - OS (+ version), Server,
    Hardware - CPU + Disk configuration.
    Please include all of the above information with database queries.
    This will help those who are trying to help you!
    Furthermore, please do not top-post and do try to trim your replies!

Maybe you are looking for

  • Fi Invoice workflows - using Business Functions

    Dear Experts, Please provide the list of business functions to be activated for MM & FI integration for automatic clearing of down payment or automatic capture of vendor details for vendor payment. My Client requirement is as follows. My Client organ

  • Using CASE & GROUP BY

    I am trying to right a query that displays a location with the numer of targets within each price range from a table I have created which looks like. TARGET_ID        COST     LOCATION_ID  22                6.76                1   83               13

  • SQL Server 2012 Dynamic Memory

    Does anyone know if Dynamic memory can be used for SQL 2012 on a Hyper-V 2012 VM? There seems to be conflicting views of this, some say only static memory can be used or performance would be affected?

  • Lumira Edge PoC

    Hi I am evaluating Edge after reviewing Cloud & Lumira Server. Currently, Edge refresh based on MS SQL Server 2008 and 2012 and is not available for BO Universe. For BO, I will have to use SAP Lumira server and not Edge. Will this change in later ver

  • Storage Spaces - volume with deduplication always flagged as "online filesystem check needed"

    Hi, I am using Storage Pools and we have quite some Volumes on them.  I am noticing an warning to do an online check of a Volume on 2 volumes where dedup is activated.  If I do the check, all is fine for about 10-30 minutes, and it's flagged again to