Can I force oracle to rebuild index from table !

Posted on 2002-04-25
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 50 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.
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to recover a database from a user managed backup
Suggested Courses

617 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