1.创建索引时出现: ORA-01408: 此列列表已索引
SQL> create index index_sc on sc(sno,cno) tablespace users pctfree 5 initrans 2 maxtrans 255 storage(minextents 1 maxextents 16382 pctincrease 0);
create index index_sc on sc(sno,cno) tablespace users pctfree 5 initrans 2 maxtrans 255 storage(minextents 1 maxextents 16382 pctincrease 0)
*
第 1 行出现错误:
ORA-01408: 此列列表已索引
2.查询是哪个索引占用了该列
SQL> select * from user_ind_columns where table_name = 'SC'
and column_name = 'CNO';
INDEX_NAME TABLE_NAME COLUMN_NAME COLUMN_POSITION COLUMN_LENGTH CHAR_LENGTH DESCEND
---------------------- ---------------------- ---------------------- -------
SYS_C0011195 SC SNO
3.解除该索引
SQL> alter table SC drop constraint SYS_C0011195;
4.重新创建索引
SQL> create index index_sc on sc(sno,cno) tablespace users pctfree 5 initrans 2 maxtrans 255 storage(minextents 1 maxextents 16382 pctincrease 0);
索引已创建。