How to rebuild index on a table in a faster way

Hi All,
We have using Oracle 9.2.0.3
On weekly basis we are loading around 20-30 million of data into a table using sqlloader.
Before loading the data into the table, we are dropping all the indexes adn rebuilding the same once done.
There are 6 index on the table and rebuilding them takes around 10-11 hours.
Is there any ways to reduce the time of index rebuilding.
Rgds,
Amol

Doing it that way a
alter session set skip_unusable_indexes=truemight also be necessary.

Similar Messages

  • How to create indexes using CREATE TABLE statement

    Hi,
    Can anyone please tell me how to create indexes using CREATE TABLE staement? This point is part SQL Expert exam (1Z0-047) and please guide me to use which books for this particular exam.
    Thanks in advance.

    Can anyone please tell me how to create indexes using CREATE TABLE staement?e.g. creating a primary key or a unique constraint will generate indexes along with the create table syntax:
    SQL> create table t (a integer primary key, b integer unique)
    Table created.
    SQL> select   index_name, index_type, uniqueness
      from   user_indexes
    where   table_name = 'T'
    INDEX_NAME                     INDEX_TYPE                  UNIQUENES
    SYS_C0016575                   NORMAL                      UNIQUE  
    SYS_C0016574                   NORMAL                      UNIQUE  
    2 rows selected.

  • How to shift index in a table

    Hey,
    My program collects 5 pieces of information per object from user. Some of the input data is in String format, rest are Integers. I create an object from this data and put in into a table. My table contains max 10 pieces of information.
    I have editing options for this data, which are erase one or all pieces, or modify a piece. I erase data by simply setting the index to null. Erasing one piece is incomplete atm, here's why:
    Say I have 5 pieces in table, and I erase the one with index of 0. I can't print my information because the table starts with a null value:
    int index = 0;
    if (table[index] != null) { System.out.println(data);} ..
    My guess is that I can solve this problem by decreasing the index of pieces greater than the modified one by 1. I can imagine that I'll be using for loop here. This is where I run out of ideas: is it possible to just modify the index, or do I have to rewrite the data again?
    Any help is appreciated,
    br,
    nomi

    I think using for loop would be the easiest way (?).
    I'm filling the table as simply as:
    items[index] = new table (value, quality..);Using LinkedList seems a bit far fetched for me. But
    again, if I am to use for loop, I think I would have
    to rewrite the data to appropriate index?Why is a List far fetched? Type of List you pick depends on how you use the list (whether you want RandomAccess, etc.).
    List items = new ArrayList(); // or LinkedList
    items.remove(index); // Remove the item at index.To use an array:
    Table [] items = new Table[20]; // whatever size
    items[index] = new Table(value, quality, ...);
    // To remove:
    System.arraycopy(items, index, items, index+1, items.length-(index+1));
    items[items.length-1] = null;

  • How to add index to PSA table?

    Hi , Experts
    as title, I want to add index to PSA table.
    my scenario is as below:
    We have already initialized 2LIS_03_BF with NOT  blcok business user(it's due to our company could not stop R/3 system, anyway), so there are 6 years data in the PSA table, it's very huge records in PSA more than 48 million records, because of we NOT stop R/3 business during initialization, so I have to search some common data  between delta records and full records(it's due to this common data contain duplicate record, I need find them and delete the duplicate record and make sure the data is correct).
    This is mean The selection is too expensive as it has to look for more than five thousand delta record between more than 48 million full records. fow now  I have already tigger this search job use a program, but it's still run for 7 days, still not finished yet, it drive me crazy.  so I mean if I can create a index for PSA table, and this action will drive the above compare work more quickly than before? or have any other way for my scenario?
    Thanks in advance.
    Best Regards,
    Bruce

    Hi,
    See the PSA Name in RSTSODS table and then in SE11 you can create Index. But the load will become slow if you don't drop the Index.
    Use 2LIS_03_BX, 2LIS_03_BF, 2LIS_03_UM to 0IC_C03 Cube and design the report.
    Use :See the steps how to load the data to 0IC_C03.
    Treatment of historical full loads with Inventory cube
    Setting up material movement/inventory with limit locking time
    If it is BI 7 then for BX in in DTP in Extraction Tab you need to select Extacrion mode = NON-Cumulative option.
    Thanks
    Surendra Kumar Reddy Koduru

  • Rebuild indexes on partitioned table

    Hi
    We have a very large table hh_advance which hold 1.5billion records and is partitioned by range
    we a index (non parititioned) index on this table.
    after adding partitions to hh_advance table the index has become unusable
    the size of index is too huge and we need to rebuild the index in least possible time
    what is the best used practice in this case
    thanx
    kb

    KB.. wrote:
    Hi
    We have a very large table hh_advance which hold 1.5billion records and is partitioned by range
    we a index (non parititioned) index on this table.
    after adding partitions to hh_advance table the index has become unusable
    the size of index is too huge and we need to rebuild the index in least possible time
    what is the best used practice in this casekb,
    you haven't mentioned your database version, but the best practice would be in many cases to use the "UPDATE \[GLOBAL\] INDEXES" clause of the ALTER TABLE command if you're at least on 9i or later to prevent any (global) indexes from becoming unusable.
    By the way, adding a partition to a range partitioned table shouldn't invalidate neither a global nor a local index.
    Regards,
    Randolf
    Oracle related stuff blog:
    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/

  • How to create index for particular table in R3

    Hi
    My load is taking too much time and it leads to process over due error. Does creating indexes on table in r3 side will solve this issue? If so how can we find out on which table does this particular data source depend. I went to maintain extract structure and findout only one table is supplying data for this data source.
    Is there any other factors depend to solve this.
    Thanks
    kk

    Hi,
    it will depend on the table.... Having an index created will speed up the loading but slow down the insert therefore slowing some process perhaps...
    May I ask which table it is? And which fields would you need to index?
    Are you sure that bottleneck is located in R/3? Analyze your loading time in the monitor and see if this is really the case.
    Otherwise you can create index for a table in Tx SE11; first check if an index is not already created...
    hope this helps,
    Olivier.

  • How to find indexes in sql tables

    Hi i need help for how to find the indexes for the sql tables.I had some tables in sql 2005 and i need to find indexes for that tables.Can anyone will help in this isssue.

    I think you can use one of the built-in db functions ... (but it depends upon which database you're using)
    in sql server:
    sp_helpindex tablename

  • How to rebuild index from different schema

    Hi All,
    I want to rebuild an Index of schema A from Schema B.
    Is there any grant needs to be give to Schema B in order to rebuild index of Schema A?
    Thanks,
    Tarak

    It is true what P. Forstmann said. However if you don't want to give the second user the ANY priviledge, then you can do a little workaround. Create a small procedure in Schema A that does the rebuild (maybe dynamically). Then grant execute rights on the procedure to Schema B.

  • How to stop indexing certain set of documents in Fast search for sharepoint 2010

    Hello
    Can someone help me to understand how to drop documents with the state as archived at the time of indexing, i meant how to stop indexing those documents in fast search for sharepoint 2010.
    Shweta
    Me

    Have you tried adding it to the exclude list?
    Include a file type in the content index (FAST Search
    Server 2010 for SharePoint)
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • How to rebuild index in E-Business

    Hi
    As on core DB side we can check index status for rebuild with command
    select owner,index_name,blevel,last_analyzed from dba_indexes where blevel>3 order by last_analyzed
    and after that
    alter index <index_name> rebuild compute statistics;
    my question is can we do the same with my e-business R12.1.2 and 10.2.0.4 database or there is some other recommendation. I want to do this for performance increase.
    Thanks
    Krishna

    Hi krishna,
    Also please see
    note 163208.1 bde_last_analyzed.sql - Verifies CBO Statistics
    note 174605.1 bde_chk_cbo.sql - Reports Database Initialization Parameters related to an Apps 12 or 11i instance
    note 396009.1 Database Initialization Parameters for Oracle Applications Release 12
    note 216205.1 Database Initialization Parameters for Oracle Applications 11i
    note 744143.1 Tuning performance on eBusiness suite
    note 169935.1 Troubleshooting Oracle Applications Performance Issues
    note 244040.1 Oracle E-Business Suite Recommended Performance Patches

  • How to use index of Oracle Table in EJB??

    Hello I have a Table Department and it's index on Dpt_Name column.
    I have created ejb - cmp in OC4J for Department Table.
    I am getting all the data but it is not in index on department, Where I have to specify index of table in Oc4j.
    Reply appriciated.
    Rajiv

    Rajive,
    An index is used automatically by the Database for faster retrieval of data. The query optimizer in the database determines whether to use an index and which index to use for a SQL statement and you don't have to specify the index in OC4J.
    If you have an index on deptname, then the index will be used when the SQL has a where clause like "where deptname = 'Personal' " or
    "where deptname like 'P%' ", etc. In case of CMP, if you have a finder method called findByDeptName and then this index will be used.
    For details on deciding on your indexing strategies please look at http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96590/adg06idx.htm#11977
    regards
    Debu Panda
    oracle

  • How to set index to tables?

    Hi,
    My database is having more than 50000 tables, I would like to set index to all my tables, please suggest me how to set index to 50000 tables...?
    Thanks
    Giri

    user10737570 wrote:
    Hi,
    My DB version 10.2.0.3.0 running on IBM-AIX....Thanks for it
    As is said earlier my DB consist of 50k tables.
    Each table consist of millions of rows.
    So, while I try to access some rows, It takes more time (especially while running long query)
    Now I decided to set index to the tables by giving
    create index fbind on fdtab(owner);
    so that an index has been created with taking nearly 5 hours.
    so there are thousands of tables left to set the index.....Its an utterly bad idea to create indexes assuming that their presence will make the queries faster. The data selection, predicates, conditions, statistics of the tables, good/bad sql and lastly, optimizer issues, they all play a very important role in the performance. Just assuming that with index creation , your queries will be faster, I don't think its a reasonable thought to have. You have got a lot of tables as per your saying , it would take huge resource and time to create indexes on all of the tables. In addition to this issue, not all the tables would be requiring the similar type of indexes as well. Some may require B-tree while others may rquire Bitmap. Also , you must note that indexes will make dmls more slower. So Ishall again suggest that you benchmark the creation of indexes with a little more care.
    HTH
    Aman....

  • Issue in rebuilding index after restoring database from sql server 2005 to 2012

    Hi All,
    We have recently restored a database named DBA_admin from our sql server 2005 instance to sql server 2012 and we have added the database to out weekly maintenance plan. After adding the database to maintenance plan the job is failing every weekend due to
    below error message.
    Error message from maintenance plan history:
    Executing the query "ALTER INDEX [PK_lsttype] ON [dbo].[lstAssign..." failed with the following error: "Invalid object name 'admin.dbo.databaselog'.
      ALTER_INDEX - dbo.PK_lsttype". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Below is the code within the maintenance plan which the rebuild index task is using for database dba_admin:
    USE [dba_admin]
    GO
    ALTER INDEX [PK_lstType] ON [dbo].[lstType] REBUILD PARTITION = ALL WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 98, DATA_COMPRESSION = PAGE)
    Please let me know if any one knows how to fix this issue.
    Thanks in Advance.

    Sorry for the confusion.
    Here is what is happening.
    The query is failing while trying to rebuild index [Pk_lsttype] on table [lstAssign], both these objects belong to database
    admin.
    I have verified the old instance there is table databaselog within the database
    dba_admin, but in new SQL instance within the database dba_admin the table is not present.
    Even I'm not sure of what this table databaselog has to do with rebuilding indexes on table
    lstAssign within the admin database.
    I have manually tried to execute the alter index command within the database
    admin and it is failing with the below error.
    ALTER_TABLE - dbo.Query_pnb_sms
    Msg 208, Level 16, State 1, Procedure ddlDatabaseTriggerLog, Line 39
    Invalid object name 'dba_admin.dbo.databaselog'.

  • How much time it take to rebuild an index for a table with 20 millions rows

    Hi all,
    i need to rebuild the index of a table containing 20 000 000 row (i don't know why the other people working on this didn't think of rebuilding the index regularly, because i asked and apparently it has never been done :cry: :cry:) i am not a sql developper nor a DBA so i can't mesure how long it take to rebuild the index, does any one have an idea (aproximativly of course :aie:), the other question is there any formula to use in order to calculate how often to rebuild the indexes (i can for example retieve how much rows are delated or inserted daily ...)
    Thanks again
    Taha

    taha wrote:
    :aie: that's why i am asking because i don't know (and to be sure which solution is best)
    so the table is like this (the columns) :
    45 varchar2, 5 timestamp, 30 Number no LOB columns, (15 indexes : 5 unique indexes and that those indexes uses at a maximum 4 columns)15 indexes - 100,000 deletes: this could mean 1,500,000 block visits to maintain index leaf blocks as the table rows are deleted. If you're unlucky this could turn into 1,500,000 physical block read requests; if you're lucky, or the system is well engineered this could be virtually no physical I/O. The difference in time could be huge. At any rate it is likely to be 1,500,000 redo entries at 250 - 300 bytes per entry for a total of about 400MB of redo (so how large are your redo logs and how many log switches are you going to cause).
    yes the tables is used by an application so (update, insert ) can take place at any time
    for the deletion , there is the batch which does a mass delete on the table ( 4 or 5 time each day)
    You haven't answered the question - how long does it take to do a sample batch delete.
    If you can enable SQL tracing, or take a before/after snapshot of v$sesstat or v$session_event for the session as it does the delete then you can get some idea of where the time is going - for all you know it might be spending most of its time waiting for a lock to do away.
    >
    "How many leaf blocks are currently allocated to the index(es) ?" how can i answer to this question ? may be if i check the all_objects table ?
    If you keep your statistics up to date then dba_indexes is a good place, cross-checked with dba_segments, and you can use the dbms_space package for more detail. I have a code sample on my blog which allows you to compare the current size of your indexes with the size they would be if rebuilt at some specific percentage: http://jonathanlewis.wordpress.com/index-sizing/ (It's such good code that Oracle Corp. has copied it into MOS note 989186.1)
    Regards
    Jonathan Lewis

  • How to rebuild BIA index ?

    Hello,
    I wonder how to rebuild a BI Accelerator index, without deleting it previously ?
    I hope this is not a silly question, cause I do not find for the moment if it is really possible.
    Thank you very much for your help.
    Benjamin

    Hi Benjamin,
    The concept of rebuild of index is to initially delete the index completely and create again. So, there is no option to rebuild the index without deleting it.
    For eg: Based on the initial data volumes, if BIA had decided not to split a fact table on  BIA side, and over a period of time, if the data volumes have increased. BIA triggers an alert indicating the difference of volumes in percentage between BI and BIA. At this point of time, based on the difference, you are required to rebuild the index.
    It then deletes the whole structure of index on BIA and then recreates the index structure. Thereby, it can decide to split the Fact table index based on the new volumes. This is one of the benefit of deleting the whole index structure and then creating again.
    Regards,
    Srini

Maybe you are looking for