Impact to production if I shrink space on table...

Hello experts.
I am running Oracle 11.2 and saw in OEM that I have a table that is candidate for shrinking space.
According to OEM, I can gain 5G by shrinking the table.
The table is 16G, so if I shrink the table, then it should reduce to approx. 11G, right?
This table is the primary table used by our application, so impact to production is very important.
Okay, so I'm wondering what the impact to production is on the table while I shrink the space on the table.
I am testing it now in my test environment.
First, I found I had a function based index which has to be dropped before I can shrink the table.
So I ran dbms_metadata to get the syntax to recreate the FBI, then dropped the FBI.
Next, i ran alter table owner.tablename enable row movement;
Then, I ran alter table owner.tablename shrink space cascade;
While I am running the shrink table command, I opened another session and I queried the table and even did updates on the table.
I was quite surprised in that the table is not locked and is still accessible for update and select statements.
In fact, I do not see any noticeable impact by the shrink table command.
Obviously, I am not in the production environment with hundreds of concurrent users, but my question is what kind of impact should I expect to see if I do this in production with people hitting this table? (No, this is not an IOT.)
Any ideas?
Edited by: 974632 on Feb 19, 2013 5:54 AM
NOTE: The table shrink command took: Elapsed: 00:43:17.19
Recreating the function based index took: Elapsed: 00:00:28.80

Uwe Hesse wrote:
What you observe is standard behavior.
A potential impact comes from the massive internal DELETE & INSERT during the shrink operation.
Will generate lots of redo & undo therefore.
That's is not necessarily a problem, though.
Kind regards
Uwe Hesse
"Don't believe it, test it!"
http://uhesse.com
Uwe,
Correct me if I'm wrong, but my thought on reading the OP is that he could very well see a performance degradation during the shrink operation, but I'd also expect to see some overall improvement after the operation due to a large decrease in the number of blocks that would have to be scanned during any FTS, and possibly some cascading of that effect back through any indexes on that table.

Similar Messages

  • 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

  • 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

  • What are the impact if we create usernames with spaces?

    Hi All,
    What are the impact if we create usernames with spaces? We tried and we were able to create in Oracle, But does it impact anywhere else.?
    Thanks in advance

    Having spaces might cause issues -- Please search MOS or the following docs for "229407.1"
    11i to R12: Bank Statement Line Errors FRM-40654, Work Around, Afchrchk.Sql [ID 758964.1]
    Receipts Workbench Error: Listing of FRM Errors [ID 1361887.1]
    Reconcile Bank Statement Lines Error: FRM-40654 Record Has Been Updated. Requery Block. [ID 1408768.1]
    11i : Applications DBA Trailing and Leading Spaces Data Collection Test [ID 229407.1]
    APXINWKB - FRM-40654 When Attempting to Place Imported Invoice On Hold [ID 429329.1]
    11i to R12: Bank Statement Line Errors FRM-40654, Work Around, Afchrchk.Sql [ID 758964.1]
    FRM-40735 and ORA-20001 Errors When Changing any Field in Define Item form [ID 206749.1]
    Cannot Modify Product Family Allocation Details, Receive Error FRM-40654 [ID 438926.1]
    "Could not reserve record" Error Appears When Trying to Update Purchase Orders [ID 781845.1]

  • Shrink space statement can support parallel ?

    Hi there
    I would like to know whether shrink space statement support parallel. my database size is around 1300 GB and it is production database.
    My database is oracle 10 R2 (10.2.0.3)
    Regards
    Jewel

    Hi sb92075
    I am dishearten to your response. This kind of reply is not expected from such as reputed forum.
    I know better than you about oracle manual. Oracle manual is vast , usually we place our question (request) in a forum to get quick response.
    It means you don't want to share your knowledge.
    Jewel

  • Segment Shrink Space Compact option in Oracle 10g

    Dear All,
    1. Is it Compulsory to run the Segment Shrinking Jobs advised by Segment Advisor?
    2. Running online will it affect the perfomance
    3. Is this same as table re organization
    Thanks in Advance

    1. NO. As with any "Advisor" it is your discretion and decision as to what action to take and when. I would schedule shrinks / rebuilds / reorgs during/without maintenance/outages. But first, I would evaluate the advice. In many cases, it wouldn't be worth the effort to rebuild/shrink. Also, you have to consider that the table/index may/will grow again.
    I do a shrink/rebuild only as part of any archival job which deletes a significant portion of the data. Not otherwise.
    2. Running it online will impact performance. Furthermore, the SHRINK actually generates a lot of Undo (as it runs as if it is normal DML) and, consequently, Redo and ArchiveLog.
    3. It is different. However, the "it" also depends on what you mean to be a "table reorganization". A reorganization that is done with an ALTER TABLE MOVE (and ALTER INDEX REBUILD) is quite a different operation from a SHRINK. A DBMS_REDEFINITION is also a very different operation.

  • 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

  • What do I do after shrink space

    Hi,
    Do I need to do anything after shrink space?
    After I shrink the tables and indexes spaces, I saw the significent space saving. question is do I need to re-collect statistic after shrink? would query plans changed after shink space? if I have outlines defined to freeze query plan, should I re-generated outlines?
    anything else should I consider after shrink space?
    Thank you

    asanga wrote:
    no need to do anything for outlinesThank you !. so, this would imply that query plan won't be changed after shrink? is my understanding correct?

  • Shrink space of datafile

    Oracle 11.1.0.7:
    I need to give some space back to the storage. I am trying to figure out what process should I follow to shrink the datafiles and drop the datafiles.
    1. Should I first do shrink space on tablespace and then drop few datafiles?
    2. How do I know how much space can be shrunk?
    3. How do I know if after shrinking which datafiles are ready for drop?
    Is there any other better way?

    I"ve just gone through a very similar procedure.
    First i had to identify the high water mark in each datafile, and then shrink it back to that or just above that value.
    NOTE: It's best to do this when your DB is not in use, specifically growing or if it is some of the commands might fail saying that there is data beyond that size.
    Now most likely your data is spread across the datafiles in some sort of "optimal" way by oracle, so it's unlikely that you'll be able to get any "clean" datafiles that you can just drop.
    So what i did was to create a new tablespace big enough to hold the objects, MOVED the tables and REBUILT the indexes in the new TS.
    Now one option here is to just keep the new TS's and drop the old ones, if needed you can even rename your tablespace (10g and above)
    ALTER TABLESPACE old_ts RENAME TO new_ts;
    However, you must follow the rules when renaming a tablespace (also need to separetly rename the df if you want to keep your naming standard) :
    You cannot rename the SYSTEM or SYSAUX tablespaces.
    You cannot rename an offline tablespace.
    You cannot rename a tablespace that contains offline datafiles.
    Here we wanted to keep the file names locations so i ended up copying everything back into the originals, but before i did that , i could querried dba_segments to get the minimum size required, and I then I shrunk and dropped the datafiles in the original TS as appropriate.
    To get the hight water mark, i used this script :
    SELECT 'ALTER DATABASE DATAFILE ''' || FILE_NAME || ''' RESIZE ' || HWMM || ';' CL_DYN_SQL
    FROM (
    SELECT DF.FILE# FILE_ID, DF.NAME FILE_NAME, NVL(DFD.MAX_BLOCK_COUNT,1)*DF.BLOCK_SIZE HWM,
    DECODE(SIGN((1024)-(CEIL(NVL(DFD.MAX_BLOCK_COUNT,1)*DF.BLOCK_SIZE/(1024*1024)))),
              1,1024, CEIL(NVL(DFD.MAX_BLOCK_COUNT,1)*DF.BLOCK_SIZE/(1024*1024))) || 'M' HWMM,
              DF.BYTES
    FROM V$DATAFILE DF, V$TABLESPACE TS,
    SELECT FILE_ID, MAX(BLOCK_ID+BLOCKS-1) MAX_BLOCK_COUNT
              FROM DBA_EXTENTS DE
              WHERE DE.TABLESPACE_NAME IN ('TS_D', 'TS_I')
              GROUP BY FILE_ID
    ) DFD          
    WHERE DF.FILE# = DFD.FILE_ID (+)
    AND DF.TS# = TS.TS#
    AND TS.NAME IN ('TS_D', 'TS_I')
    WHERE HWM < BYTES
    ORDER BY 1;

  • SHRINK SPACE - How do you monitor progress?

    Does anyone know how to monitor the progress of a SHRINK SPACE command ?
    Session_Longops view shows nothing for that SID.

    you may customize the columns selected or the filters of the below query and monitor who is doing what, and if necessary you may start event 10046 level 8 trace - http://tonguc.wordpress.com/2006/12/30/introduction-to-oracle-trace-utulity-and-understanding-the-fundamental-performance-equation/
    SELECT sq.sql_text,
           se.status,
           se.username,
           se.osuser,
           se.terminal,
           se.machine,
           'ALTER SYSTEM KILL SESSION ''' || se.sid || ', ' || se.serial# ||
           ''' IMMEDIATE ;',
           se.sid,
           se.serial#,
           pr.spid,
           se.saddr,
           se.schemaname,
           se.program,
           se.logon_time,
           sq.hash_value,
           sq.address,
           sq.buffer_gets,
           sq.disk_reads,
           sq.executions,
           sq.fetches,
           sq.rows_processed,
           io.block_gets,
           io.consistent_gets,
           io.physical_reads,
           io.block_changes,
           io.consistent_changes,
           se.module,
           se.action,
           se.client_info,
           sw.event,
           sw.p1text,
           sw.p1,
           sw.p2text,
           sw.p2,
           pr.pga_used_mem,
           pr.pga_alloc_mem,
           pr.pga_freeable_mem,
           pr.pga_max_mem,
           'exec dbms_support.start_trace_in_session(' || se.sid || ', ' || se.serial# || ', ' ||
           'waits => TRUE' || ', ' || 'binds => TRUE);',
           'exec dbms_support.stop_trace_in_session(' || se.sid || ', ' || se.serial# || ');'
      FROM v$session se, v$sqlarea sq, v$process pr, v$session_wait sw, v$sess_io io
    WHERE status IN ('ACTIVE', 'KILLED', ' INACTIVE', ' CACHED', ' SNIPED')
       AND TYPE = 'USER'
       AND se.sql_hash_value = sq.hash_value(+)
       AND se.sql_address = sq.address(+)
       AND se.paddr = pr.addr
       AND se.sid = sw.sid
       AND se.sid = io.sid
    ORDER BY sq.sql_text, se.username, se.schemaname, se.osuser, se.program, se.sid

  • Delete extra spaces in table column

    hi how can i delete extra spaces in table column for example if table column value is store as 'ÄAAAAA ' how can i delete that extra space
    this is the column i what to delete extra spaces
    select SUBTYPES  from tablesubtype;am in
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Solaris: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    Edited by: adf0994 on 2012/12/03 11:30 AM
    Edited by: adf0994 on 2012/12/03 11:42 AM

    UPDATE tablesubtype
       SET SUBTYPES  = TRIM (SUBTYPES);Doing RTRIM alone will not suffice coz it'll only remove Right Spaces and NOT Left ones.
    I guess, in your case doing a TRIM will be more beneficial to be safe and prevent any left spaces in future.
    For intermediate spaces... try this.
    UPDATE tablesubtype
       SET SUBTYPES  = REGEXP_REPLACE (SUBTYPES, ' ', '');Hope this Helps,
    Ranit B.
    Edited by: ranit B on Dec 3, 2012 2:33 PM
    -- added regexp

  • "Invalid segment" when shrinking a partitioned table

    I'm encountering the following error when trying to shrink space compact for a partitioned table. Would you know how can I go about this?
    I need to make it work.
    SQL> alter table PS_SGSN_1_MONTH modify partition P_201304 shrink space compact;
    alter table PS_SGSN_1_MONTH modify partition P_201304 shrink space compact
    ERROR at line 1:
    ORA-10635: Invalid segment or tablespace type
    My Oracle DB version is 11gR2

    Yes, that would be the right thing to do to check how and where MV is being used and what downtime you can get to fix this. Check if you can change the Materialized view to create based on primary key instead of Row id.
    Steps would be
    1 drop the materialized views related
    2 drop the materialized views logs
    3 shrink the tables and indexes
    4 recreate the materialized views log
    5 recreate the materialized views
    Also, there is a bug with the primary key as well. Check this
    Bug 13709220 - ORA-10663 when shrinking a master table of an MVIEW with primary key (Doc ID 13709220.8)

  • Space between tables in dreamweaver

    Cellpad = 0, Cellspace = 0 and Border = 0 but there is still a space between tables. I checked in explorer and chrome, same thing. Suggestions?

    This is not a DW or even a table problem - it's a 'you' problem! ;-)
    What you are seeing is the space that is reserved below inline elements to accommodate text descenders. Make that image have the CSS style of "display:block" and you will see the gap vanish.

  • I need that this button must get displayed after an empty space below table

    Hi
    I have created a table and added a button at bottom of table.
    I need that this button must get displayed after an empty space below table.
    How can i get an empty space there.
    I have took a transparent container and selected a grid layout for it.
    Thanks.

    Thanks Apurva....inserting "Horizontal gutter" solved my problem.
    I need one more help.
    In this transparent container, i have to add a header text displaying caption for this table and then a section which will display some buttons and text, then this table will be displayed and at last this update button.
    i.e.
    1.  header text
    2.  area with few buttons and text(lables)
    3. Current table
    4. update button.
    for this as i specified i have used a transparent container with grid layout...
    Please guide me in this...
    Thanks....

  • Huge spaces between tables

    I cannot seem to eliminate the huge space between tables.  I have set the td to vertical align top but it seems to make no difference.  Example: http://blandheritage.org/GENEALOGY/numberingsystem.html

    There are no tables on that page.  Everything is either an absolutely positioned div, or a paragraph contained within an absolutely positioned div.  The huge space is caused by your (INLINE) positioning of the apDiv12 -
    <div id="apDiv12" style="position: absolute; left: 10px; top: 1016px; width: 994px; height: 1452px; z-index: 10">
    I count 90 such absolutely positioned elements on your page, which could be the poster child for why one shouldn't use absolute positioning as a primary layout method (http://www.apptools.com/examples/pagelayout101.php).  Just use your browser text size controls to increase the browser's display of text a couple of ticks and see what happens to your layout (in Safari I just use Command-+).  Two ticks, and the contents have overlapped so much that the page becomes unreadable.  I recognize it my be too late to inform you of this fundamental mistake in your approach on this page, but if I were you, I'd fix it.  Who would ramp up the text size like this?  Anyone with vision problems who may have their browsers already set at a large text display for readability - you have no control over that....
    The good news is that this is the only page I see on your site that is built this way - all other pages are table-based, and while that approach is also uber-retro, at least it doesn't suffer from this potential overlapping problem.

Maybe you are looking for

  • Samsung 325W Printer Problem - Connecting wirelessly

    Hi, I recently bought the above printer and installed it according to the instructions. Everything seems to be fine, but when I haven't used the printer for a day or so, my iMac 'loses' it and I have to reinstall it all again. This is obviously a PIT

  • Problem with closing Goods Receipt PO

    Hello, I want to close a Goods Receipt PO Document. When I use the code below, an error occurs ( Date deviates from due date range,'208040' ) : Public oGoodsRPO As SAPbobsCOM.Documents = CType(oComp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchas

  • Ipod wont restore, (-69)

    i dont know what to do my ipod wont update, or restore.it always says unkown error (-69). I cant find a corrupt file eather. Your responses are appriciated, thanks.

  • RE: node manager disconnection

    when we have this problem...we just remove the .btd & .btx files in %FORTE_ROOT\sysdata\envrepos on the offending client machine and bring the launcher distributed up again on that machine. I would be interested in knowing the cause and if there is a

  • Multilingual challenge questions

    How have people handled secondary login challenge policy questions in multilingual deployment? I tried using catalog keys for the questions in the policy, but they names get treated as literals (not replaced by localized catalog entries). Am I overlo