• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2371
  • Last Modified:

Can I force oracle to rebuild index from table !

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)
1 Solution

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!
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.
anil27Author Commented:
thanks !
I have dropped and recrested it and the problem is solved.
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

   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!
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.

anil27Author Commented:
thanks Andrew for the insight.
anil27Author Commented:
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
by the way, how do you know the index is corruptted.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now