有时候会遇到索引出问题,很蛋疼;
使主键失效:alter table tableName disable primary key;
使主键恢复:alter table tableName enable primary key;
删除主键:alter table tableName drop primary key;
使外键失效:alter table tableName disable constraint 外键名称;
使外键恢复:alter table tableName enable constraint 外键名称;
删除外键:alter table tableName drop constraint 外键名称;
alter table t_order_timing disable primary key;
alter table t_order_timing enable primary key;
select * from user_indexes where index_name='SYS_C0011324'
select * from user_ind_columns where index_name='SYS_C0011324'
delete t_order_timing where rowid in (
select rowid from (
select rowid,row_number()over(partition by order_id order by order_id) rn from t_order_timing)
where rn >1)
alter index SYS_C0011324 rebuild online;