Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01502 error in case of unusable unique index and bulk dml

872581Nov 27 2012 — edited Nov 28 2012
Hi, all.

The db is 11.2.0.3 on a linux machine.

I made a unique index unusable, and issued a dml on the table.
Howerver, oracle gave me ORA-01502 error.

In order to avoid ORA-01502 error, do I have to drop the unique index ,and do bulk dml, and recreate the index?

Or Is there any other solution without re-creating the unique index?
create table hoho.abcde as
select level col1 from dual connect by level <=1000 

10:09:55 HOHO@PD1MGD>create unique index hoho.abcde_dx1 on hoho.abcde (col1);

Index created.

10:10:23 HOHO@PD1MGD>alter index hoho.abcde_dx1 unusable;

Index altered.

Elapsed: 00:00:00.03
10:11:27 HOHO@PD1MGD>delete from hoho.abcde where rownum < 11;
delete from hoho.abcde where rownum < 11
*
ERROR at line 1:
ORA-01502: index 'HOHO.ABCDE_DX1' or partition of such index is in unusable state
Thanks in advance.
Best Regards.
This post has been answered by Mohamed Houri on Nov 28 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2012
Added on Nov 27 2012
9 comments
6,212 views