oracle 选择Oracle中某个类型的所有索引

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16106754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 01:35:42  来源:igfitidea点击:

Select all indexes of a type in Oracle

sqloracleindexingoracle10g

提问by Woot4Moo

How does one go about selecting all indexes of a specific type in Oracle 10g, for instance I want all of the bitmapindexes that are declared.

如何在 Oracle 10g 中选择特定类型的所有索引,例如我想要bitmap声明的所有索引。

I imagine the query would be something like this:

我想查询会是这样的:

select * from system_indexes where type = 'bitmap'

but that is definitely not correct.

但这绝对是不正确的。

回答by Justin Cave

SELECT *
  FROM dba_indexes
 WHERE index_type IN ('BITMAP', 'FUNCTION-BASED BITMAP' )

is probably what you're looking for (though you may want just the indexes where index_type = 'BITMAP'. If you are only concerned with indexes on tables that you have SELECTaccess on, you can query all_indexesrather than dba_indexes. If you are only concerned with indexes in the current schema, you can query user_indexesrather than dba_indexes.

可能是您正在寻找的(尽管您可能只需要 where 的索引index_type = 'BITMAP'。如果您只关心您有权SELECT访问的表的索引,您可以查询all_indexes而不是dba_indexes。如果您只关心当前模式中的索引,您可以查询user_indexes而不是dba_indexes