查看表约束
select * from all_constraints a, all_cons_columns b where a.constraint_type='p' and c.constraint_name=b.constraint_name and a.owner=b.owner and a.table_name='tb1';
删除表约束
alter table tb1 drop constraint 约束名;
添加约束
alter table tb1 add constraint 约束名 primary key('索引1','索引2');
查询索引(过滤主键索引)
select count(1) from user_indexes a, user_ind_columns b where a.table_name = b.table_name and a.index_name = b.index_name and a.table_name = 'tb1' and not exists (select 1 from all_constraint c where a.index_name=c.constraint_name and c.table_name='tb1')