Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Can I force oracle to rebuild index from table !

Posted on 2002-04-25
Medium Priority
Last Modified: 2010-08-05
I a having a problem of corrupt index. I tried rebuild option but is still giving problem. After reading the usage I realised rebuild does not refer to data table but creates index from existing index.
any ideas ? how can I refer to table to rebuild the index orI have to drop and recreate it (which i don't want to do)
Question by:anil27
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

p_yaroslav earned 150 total points
ID: 6967862

Usually you have to drop and recreate corrupted index.
Ihave like problem on Oracle 8.0.5. Only after recreating index - all become OK!

Best regards!
LVL 48

Expert Comment

ID: 6967864
Building indexes Oracle tries to use existing indexes. If you want to get a brand new index drop the corrupted index. The index creation will take more time as yet, but your new index will reflect the current situation. To help Oracle to index the table fast use big temparary tablespace for the implicit sorting which Oracle does indexing tables.

Author Comment

ID: 6968099
thanks !
I have dropped and recrested it and the problem is solved.
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

LVL 22

Expert Comment

ID: 6968582
   In your comment (and it was very nice of you to provide feedback) you said that Yaroslav's answer solved your problwm, yet you graded it with a B.  Was this a mistake?  If so, we can get a moderator to fix it.  Remember, that the grades are to indicate whether or not the posted information directly led to your solution.  It's not about how hard it was or whether or not you liked the answer.  Grades are important for those searching for solutions in the knowledge base - they probably won't look at a "B" answer and yet that answer solved your problem.  Please post one more time to clarify this for us.

Good luck!

Expert Comment

ID: 6970336
There was a bug in older versions of Oracle8 (and maybe even up to 8.1.6). If an index already exists on a set of columns (say col1, col2, col3), and then you create an index that is a subset of that index (col1), Oracle will build the index by reading from the concatenated index, rather than the table. This is normal behavior. However, the bug was causing the index to be corrupted, and just doing a rebuild of the index would not fix it.  The only way to do it properly was to create the subset index first, then create the concatenated index afterwards, forcing Oracle to read from the table for each index.

Of course, if you just migrated to 8.1.7, the problem went away.


Author Comment

ID: 6970389
thanks Andrew for the insight.

Author Comment

ID: 6970404
DrSql !
I have graded the answer as per my expectations and I have reasons for it :
The solution I accepted as answer is the one which actually worked and first posted so accepted. But this solution is not comprehensive as mentioned by scwertner the temporary tablespace may be required on some platforms. Moreover I asked for some insight into how can I make Oracle to look in to table again for reindexing which Andrew tried to answer.
I may be wrong but this is my perception about grading.
I hope I answered your concerns.
thanks & regards

Expert Comment

ID: 11000077
by the way, how do you know the index is corruptted.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question