oracle中的索引查看

1、创建索引  create index 索引名 on 表名(列名);

2、删除索引  drop index 索引名;

 3、创建组合索引  create index 索引名 on 表名(列名1,,列名2);

--在数据库中查找表名
select * from user_tables where  table_name like 'tablename%';
 --查看该表的所有索引(注意后面表名称大写,小写查询不到)
select * from all_indexes where table_name = 'tablename';
 --查看该表的所有索引列
select* from all_ind_columns where table_name = 'tablename';
mysql表中的索引使用 show index from ‘table’;但是oracle中不适用。
oracle中表的索引信息存在 user_indexes 和 user_ind_columns 两张表里面,
其中,
user_indexes 系统视图存放是索引的名称以及该索引是否是唯一索引等信息,
user_ind_columns 统视图存放的是索引名称,对应的表和列等

 

 

 

 

 

 

 

 

 



posted on 2020-05-27 23:14  小破孩楼主  阅读(1182)  评论(0编辑  收藏  举报