Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-02429: cannot drop index

Re: ORA-02429: cannot drop index

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 28 Jun 1999 17:49:52 GMT
Message-ID: <377fb574.19211013@newshost.us.oracle.com>


A copy of this was sent to "cristian" <cristian_at_senior.com.br> (if that email address didn't require changing) On Mon, 28 Jun 1999 13:49:39 -0300, you wrote:

>“ORA-02429: cannot drop index used for enforcement of unique/primary key”
>
>I am using Oracle 8.0.5.
>This error happen when I try to turn off an unique index that has the same
>columns that the primary key and that was created before the primary key.
>This script create the error:
>CREATE TABLE TESTEINDICE (COL1 NUMBER(4,0) NOT NULL, COL2 NUMBER(4,0) NOT
>NULL, COL3 NUMBER(4,0) NOT NULL) ;
>CREATE UNIQUE INDEX TESTEINDICEIndice2 ON TESTEINDICE (COL1,COL2);
>ALTER TABLE TESTEINDICE ADD(PRIMARY KEY (COL2,COL1));
>--> DROP INDEX TESTEINDICEIndice2; ( This statement create the error ).
>
>How can I erase this index?
>
>

the creation of the primary key 'took over' that index. normally, a primary key typically (not in the case of deferable constraints) creates a unique index. since a set of columns may be indexed only once -- the constraint "assumes control" of that existing index.

to drop the index, drop the constraint (as the constraint cannot be enforced without that index -- you haven't lost anything).

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Jun 28 1999 - 12:49:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US