查看Oracle索引和视图的方法

如何查看Oracle索引是很多人提到的问题,下面就为您介绍查看Oracle索引和视图的方法,希望对您能有所帮助。

查看Oracle索引个数和类别

 
 
 
  1. select * from user_indexes where table='表名' ; 

查看索引被索引的字段

 
 
 
  1. SQL>select * from user_ind_columns where index_name=upper('&index_name'); 

查看某表的约束条件

 
 
 
  1. SQL>select constraint_name, constraint_type,search_condition, r_constraint_name   
  2. from user_constraints where table_name = upper('&table_name');   
  3.  
  4. SQL>select c.constraint_name,c.constraint_type,cc.column_name   
  5. from user_constraints c,user_cons_columns cc   
  6. where c.owner = upper('&table_owner') and c.table_name = upper('&table_name')   
  7. and c.owner = cc.owner and c.constraint_name = cc.constraint_name   
  8. order by cc.position;  

查看视图的名称

 
 
 
  1. SQL>select view_name from user_views; 

以上就是查看Oracle索引和视图的方法介绍。

 

 

 

【编辑推荐】

创建Oracle索引的方法

C#连接Oracle数据库查询数据

使用oracle存储过程分页的实例

Oracle数据库备份的三个常见误区

oracle RMAN备份的优化

 

THE END