ALTER Index Rebuild online

My database is out 10 gr 2. Sometimes, I pass command ALTER INDEX < index name > REBUILD online on the indexes that are 500 MB in size. It takes about ten minutes to run the command. The database alert log shows no activity for the first six minutes, and DML is allowed on the associated table. At about minute seven journal alerts shows the first of a series of five online redo logs switches. They are each 100 MB.

During the time that online redo logs, DML execution sessions cannot fill. When the new version of the index was created again online records switching station, the original copy of the index disappears, the ALTER INDEX command ends, and blocking for DML ceases.

I read that the DML statements are not affected by executing ALTER INDEX REBUILD online, but experience shows that the blocking of the above sessions. Can someone explain to me what is happening in the different stages of the index rebuild? Is there something I can do to eliminate the blocking of the DML statements during the period when redo online record switch?

Thank you
Bill

Bill,

A useful reference for you:
http://jonathanlewis.WordPress.com/2009/06/05/online-rebuild/

Another very useful reference - of many articles:
http://richardfoote.WordPress.com/category/index-rebuild/

For what reason you rebuild the index?

Charles Hooper
Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
http://hoopercharles.WordPress.com/
IT Manager/Oracle DBA
K & M-making Machine, Inc.

Tags: Database

Similar Questions

  • ALTER index rebuild (parallel nologing) vs (parallel nologging)

    The below statements have difference the behavior of oracle or it is just the other way to use the syntax:

    SQL > create index test_idx on test (owner, table_name, nom_tablespace);

    The index is created.


    What is the best way to use?

    SQL > alter index test_idx reconstruction nologging parallel 16;

    The index is modified.

    SQL > alter index rebuild nologging test_idx parallel (16 degrees);

    The index is modified.

    SQL > alter index rebuild nologging test_idx parallel (measure 16);

    The index is modified.


    and

    SQL > alter index test_idx connection parallel 1.

    The index is modified.


    SQL > alter index test_idx parallel 1 operating forest;

    The index is modified.


    All I'm trying to understand y - no difference in the statements of reconstruction? I have

    If you read the link below, I'm sure you cela and the rest doubts will never be around you...!
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_1008.htm

    Logging and parallel clauses are optional, and there is no effect on the order of the optional clauses.

    Concerning
    Girish Sharma

  • schedule the index rebuild online

    Hello

    I need to schedule a task at the level of the database to rebuild the index online each month. all script exist? as the procedure to call on every month to rebuild indexes for the 5 tables identified in our project?

    It is in production

    We run in oracle 10g in the solaris platform.

    Dear Raman,

    I have no why yon need this.

    Try this, you can change next_date and interval you condition

    declare
      VJOBNUMBER BINARY_INTEGER;
    begin
      DBMS_JOB.SUBMIT( job => VJOBNUMBER, NEXT_DATE => sysdate, interval => 'SYSDATE + 30', WHAT => 'BEGIN
    FOR S IN (SELECT ''alter index'' || INDEX_NAME || '' rebuild;'' A FROM ALL_INDEXES)
    LOOP
    EXECUTE IMMEDIATE S.A;
    END LOOP;
    END;');
      DBMS_OUTPUT.PUT_LINE('Job number assigned: ' || TO_CHAR(VJOBNUMBER));
    end;
    
  • ALTER INDEX REBUILD and large waste area

    Hello world.

    Concerns the RDBMS EE 10.2.0.2 on a box with 16CPUs. Non-standard initialization parameters:

    db_16k_cache_size = 3G
    pga_aggregate_target = 3G
    SGA_MAX_SIZE = 12G
    SGA_TARGET = 5G
    workarea_size_policy = AUTO

    I have a large table partitioned on a monthly basis with a local couple of bitmap index on this subject. Table and index are stored in different areas of storage. The index tablespace is

    EXTENT MANAGEMENT UNIFORM LOCAL 1 M SIZE
    16K BLOCKSIZE
    SEGMENT SPACE MANAGEMENT AUTO

    Nightly batch processing allows a few partitions index unusable then inserts/adds one part of the data and rebuilds the index with

    ALTER INDEX... REBUILD PARTITION... NOLOGGING PARALLEL

    When you are finished, query on DBA_IND_PARTITIONS shows that, for all the index, partition value SCOPES is much greater than the value of used BYTES, for example one of the partitions has 106 DEGREES (1 MB each so he made 106 MB space) while only 15 MB for the BYTES.

    I understand that during the reconstruction of the parallel process slave create segments in the tablespace of the index of destination so that spend a lot more space than this segment takes finally. But it also means that the space is not released. (Deallocation/shrinkage will not help). Same thing can be demonstrated by the queries on DBA_SEGMENTS and DBA_FREE_SPACE. Because of this behavior, I have huge waste of space in the tablespace to index.

    Can someone help, please?
    Przemek

    Allocate space for parallel process slave is documented in the book 'Data warehousing database Oracle 10 g 2', chapter 25 "run in parallel to assistance.

    user2038804 wrote:
    Concerns the RDBMS EE 10.2.0.2 on a box with 16CPUs. Non-standard initialization parameters:

    When you are finished, query on DBA_IND_PARTITIONS shows that, for all the index, partition value SCOPES is much greater than the value of used BYTES, for example one of the partitions has 106 DEGREES (1 MB each so he made 106 MB space) while only 15 MB for the BYTES.

    Przemek,

    I can confirm that there is a bug in 10.2.0.2 leading to inconsistent information related to size in DBA_SEGMENTS / DBA_EXTENTS after an index rebuild in parallel to a big clue, maybe a bug 4771672 in 10.2.0.3. If I remember correctly the information of MEASUREMENT is correct and the information provided in DBA_SEGMENTS is misleading.

    The Metalink note suggests to use DBMS_SPACE_ADMIN Procedure TABLESPACE_FIX_SEGMENT_EXTBLKS to correct erroneous information in the dictionary, but I don't know if it was the one we used when encountering the problem.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • Internal components of the online index rebuild.

    Hi all

    What happens in the index rebuild online compared to the simple index rebuild?

    Why this task consumes temporary space in the tablespace where index?

    How to get access index is accepted when online index rebuilding... What happens internally?

    -Yasser
  • ALTER INDEX with parallel and Nologging

    I want to move some indexes to a different tablespace. For this I use the SQL below:

    XYZ ALTER INDEX REBUILD TABLESPACE TS_INDX01 NOLOGGING PARALLEL 8;

    I use NOLOGGING and PARALLEL thinking it will speed up the process of movement. But now I'm confused because I think that this will change the index property, as in, when we create an index specify us certain parallels and logging properties.

    So I want to understand:

    1. the SQL above to change the properties of the index?

    2. How can I check the existing nologging and parallel properties of an index?

    SQL> create table temp (no integer, name varchar2(100));
    
    Table created.
    
    SQL> create index temp_idx on temp(no);
    
    Index created.
    
    SQL> select degree, logging from user_indexes where index_name = 'TEMP_IDX';
    
    DEGREE                                   LOG
    ---------------------------------------- ---
    1                                        YES
    
    SQL> drop index temp_idx;
    
    Index dropped.
    
    SQL> create index temp_idx on temp(no) nologging parallel 5;
    
    Index created.
    
    SQL> select degree, logging from user_indexes where index_name = 'TEMP_IDX';
    
    DEGREE                                   LOG
    ---------------------------------------- ---
    5                                        NO
    
    SQL> alter index temp_idx parallel 1 logging
      2  ;
    
    Index altered.
    
    SQL> select degree, logging from user_indexes where index_name = 'TEMP_IDX';
    
    DEGREE                                   LOG
    ---------------------------------------- ---
    1                                        YES
    
  • Index rebuild VS analysis static calculation index VS DBMS_STATS. GATHER_INDEX_S

    Hello

    I have little doubt below the topics listed. Please explain each topics and where we need to use for the same thing. Can I use any of that? What are the subjects of these advantages and disadvantages?

    (1) index rebuild and index rebuild online
    (2) analyze index-static calculation and validate the strcture
    (3) DBMS_STATS. GATHER_INDEX_STATS

    In order to make good use of the cost based optimizer, you create statistics for data in the database.

  • At the same time index rebuild...

    OK, so I have a question that has puzzled me a bit. I think I understand the theory, but I am not convinced, so looking for 3xp3rt thoughts.

    I have the following table with the indexes following:

    Departments of instance name table Name Index
    AWESOME_DETAIL 20 1 AWESOME_DETAIL_B8

    The table itself has a DEGREE of 2 BODIES 1 value.

    What is happening is when the following is executed:

    ALTER INDEX REBUILD AWESOME_DETAIL_B8.

    the table is read in series, despite the index with a DOP of 20. However, when we do the following:

    ALTER INDEX REBUILD PARALLEL OF 20 AWESOME_DETAIL_B8

    The table is read with the parallelism and the treatment is faster (no surprise on the second part).

    When the index is rebuilt with the first statement, the degree of parallel remained unchanged at 20. If we run the second statement, and the index have had a degree of parallelism of the 2, then I expect the degree of parallelism of the index itself will be replaced by 20 (because I've seen this before).

    Is this expected behavior? Is the first statement saying Oracle "Hey, this rebuild operation does not have parallel" and the second statement saying: 'Hey, I'm specifying options of storage here, my friend, do in parallel of 20'.

    Essentially, the first statement is a pure DDL operation and the second statement is a DDL operation with storage options, where the change? And DDL operations ignore the declaration of principles on the subject, unlike, for example, a SELECT statement.

    I tried with a DISPLACEMENT of ALTER TABLE and saw the same behavior: without specifying PARALLEL in my statement, it read the table in series. When I specified PARALLEL, it read the table in parallel.

    Mark

    When you specify PARALLEL creating / REBUILD / MOVE, the degree is used for the C/R/M. it is always "in place" for all the readings (and will be used in DML If ALTER SESSION ACTIVATE PARALLEL_DML has been paid).
    However, the degree of PARALLEL set of the GET on the table / index is not automatically reused for the next RECONSTRUCTION/MOVE (although the degree that has been set remains!)

    Is the first statement saying Oracle "Hey, this rebuild operation does not have parallel" and the second statement saying: 'Hey, I'm specifying options of storage here, my friend, do in parallel of 20'.

    Yes, precisely.

    See http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/clauses006.htm#g1058315

    NOPARALLEL
    Specify NOPARALLEL for serial execution. It is the default value.

    Hemant K Collette

  • An index rebuild

    Hello
    I must set my DB and move some tables from one tablaspace to another.
    For example, a PRODUCT stored on tablespace TBL_1 table I wrote a script like this:

    ALTER table PRODUCT move tablespace TBL_2
    storage
    *(*
    initial 1 M
    According to 1 M
    PCTINCREASE 0
    *);*

    Its index to perform a script like this?

    ALTER index rebuild of IDX_PRODUCT;

    I just want to rebuid the index because I guess that after having pass the array to another tablaspace, the index is no longer gets its records, but I don't need to move the index to a different tablespace.
    My alter index statement above is fair?
    My version is Oracle 8.1.7.
    Thank you

    Yes.
    ALTER index rebuild of tablespace ;

  • ALTER table move online in an encrypted tablespace

    Hello

    Our DBA want to put all our data in encrypted storage.

    Once they create encrypted tablespaces, we will have to do «alter table move online...» "orders for encrypted storage space around the tables.

    Has anyone here done already?   Keeps the table moved really 'on-line' (available at query/insert/update) during the move?  Or will we have to wait some time stop/downtime while the tables are moved?
    What about the tables with long or CRAFT?

    Thank you!

    KSandberg and to add to the recall of John that only ITO tables can be moved online, if the table needs to be moved offline the indexes would be invalid until rebuilt.  If the table is an IOT I suggest you rebuild the index online after the move because even if the indexes are always used the logical ROWID is more pointing to the correct location and access of the index will be less effective that will you rebuild the index.

    - -

    The dbms_redefinition package could be an alternative solution if you need to move the tables no - ITO online.

    - -

    HTH - Mark D Powell.

  • Is to rename an index, an online operation?

    Hi all

    I need to rename an index on a table full and large and I was wondering if it would be an online operation: can users continues work when I do that? I can't find the answer in the documentation.

    Kind regards.

    "online" means that the command can be issued.  Know if it will be successful depends on whether it is active DML

    Demo:

    Session 1:

    SQL > create table hkc_test_10 (id_column number, data_col varchar2 (15));

    Table created.

    SQL > create index hkc_test_10_ndx on hkc_test_10 (id_column);

    The index is created.

    SQL > insert into hkc_test_10
    2 Select rownum, ' line:' | TO_CHAR (rowNum)
    3 double
    4. connect by level<>

    999 lines were created.

    SQL >

    Session 2 Session 1 did not:

    AnotherSQLSessn > select index_name from user_indexes where table_name = 'HKC_TEST_10 ';

    INDEX_NAME
    ------------------------------
    HKC_TEST_10_NDX

    1 selected line.

    AnotherSQLSessn > alter index rename hkc_test_10_ndx ndx_hkc_test_10;
    ALTER index rename hkc_test_10_ndx ndx_hkc_test_10
    *
    ERROR on line 1:
    ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

    AnotherSQLSessn >

    Hemant K Collette

  • For the loop index rebuild

    DB version 10.2
     BEGIN
          FOR vIdxList IN (select INDEX_NAME from user_indexes where table_name in('PORT') and index_type='NORMAL')
          LOOP
       EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || ' REBUILD nologging parallel 4 ';
          5      dbms_output.put_line('-----------------');
             --EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || 'NOPARALLEL';
          END LOOP;
          begin
         FOR vIdxList IN (select INDEX_NAME from user_indexes where table_name in('PORT') and index_type='NORMAL')
         LOOP
         EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || 'NOPARALLEL';
         end loop;
         end;
       END;
       /
    When I try to do more high I am hit with ORA-02242 after reconstitution with nologging parallel 4. But when I run manually
     ALTER INDEX'  <index_name> NOPARALLEL 
    then ok.

    Some can help me please

    ERROR on line 1:
    ORA-02242: no option specified for the ALTER INDEX statement
    ORA-06512: at line 11 level
    BEGIN
          FOR vIdxList IN (select INDEX_NAME from user_indexes where table_name in('EMPLOYEES') and index_type='NORMAL')
          LOOP
              EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || ' REBUILD nologging parallel 4 ';
              EXECUTE IMMEDIATE 'ALTER INDEX ' || vIdxList.INDEX_NAME || ' NOPARALLEL ';
           END LOOP;
    END;
    / 
    
  • index rebuild

    During the rebuilding of the index on the production of databases what precautions because a DBA will take? If dba disable the application or not?
    When online index rebuilding, what performance question will come on the production database?


    Thanks in advance

    Reconstruction on-line during the index of what will be the impact on the database?

    1 space of index segments can be roughly doubled as Oracle retains the original index segment during the reconstruction. It creates a new index segment, he switches rapidly, then deletes the old.
    2 CPU will be consumed
    3 oracle perhaps fully analyze the old index, other index or table.

    If a user makes a request at the time of the index to rebuild which will have an impact on this user?

    a shared lock on the table will be held
    brief exclusive lock tables and indexes metadata will be held during the switch.

  • Index rebuild required after truncate the table and load data

    Hello


    I have a situation that we truncate tables bit and then we loaded data [only content] on these tables. What you need to rebuild the index online is necessary or not?


    And another question is if we drop a few clues is the total amount of space is released or not. And re-create indexes will use the same amount of space. As I don't have disk space more? In this situation, rebuild the index online will be a better idea...

    Can you please on this...


    truncate the table some the few loading tables + reconstruction markings online is the best (or) droping little tables, a few tables loading + re-create the index is better

    Can you suggest the best way... We have a time that it currently we don't have enough space on the disk... [Option should not effect the space]

    user13095767 wrote:
    Ok. I have it...

    u want to say if we disbale the index while loading... Next, we need to spend the time to build.

    If the indexes are enabled, then rebuild again is not necessary after loading tables...

    Please answer if my understanding is correct...

    above is correct

    >

    If so, how abt the differences in the space occupied by the spaces of storage during the index rebuild and re-create... T he acquires more space if recreate us [deletion and creation] or rebuild online is preferable to an index...?

    space used is the same for all options.

  • ALTER INDEX problem

    Hello

    Someone has modified the table and made Index unusable. How to make it usable again?

    ALTER INDEX 'REP_ODI35 '. "' AK_COL ' UNUSABLE;

    Kindly help

    Thank you
    Concerning
    Gatha

    Hello

    rebuild your index...

    ALTER index index-name rebuild

Maybe you are looking for