日期:2014-05-17  浏览次数:21069 次

dba_indexes和dba_ind_columns里面的索引数量不一样的,是怎么回事
select count(distinct index_name) from dba_indexes

select count(distinct index_name) from dba_ind_columns

结果不一致,有人知道是怎么回事吗? 两个视图有啥区别?
SQL code

SQL> select count(distinct index_name) from dba_indexes;

COUNT(DISTINCTINDEX_NAME)
-------------------------
                     4788

SQL> select count(distinct index_name) from dba_ind_columns;

COUNT(DISTINCTINDEX_NAME)
-------------------------
                     3887



 

------解决方案--------------------
SQL code

--不一样很正常的,执行这个就应一样了
purge recyclebin;
/
--LOB类型的在dba_ind_columns是不存在的
select count(distinct index_name) from dba_indexes where index_type<>'LOB';
/
--正常情况下,此处会含有回收站中的
select count(distinct index_name) from dba_ind_columns;
/