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!

Was an index created manually or by creation of a constraint

oraLaroMay 21 2019 — edited May 21 2019

12.1.0.2

This follows on from more work I have on table maintenance where Im trying to recreate indexes. 

create table tin1 (col1 number);

alter table tin3 add primary key (col1);

select index_name, generated from from dba_indexes where table_name = 'TIN3';

SYS_C003005169     Y

So generated = Y when we alter table add primary key

However

create table tin2  (col1 number)

alter table tin1 add constraint pk_tin2 primary key(col1);

select index_name, generated from from dba_indexes where table_name = 'TIN2'

PK_TIN2 N

Generated = N and the index name is same as constraint.

As generated = N  how can we tell the index above was created by the generation of a constraint and not manually?

This matters for the order in which I run a script whether I recreate an index manually or not.

also curious, I would have thought there be a connection somewhere as if you drop the constraint/mark it disabled then the index drops as well.

Comments
Post Details
Added on May 21 2019
11 comments
2,272 views