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
Select all indexes of a type in Oracle
提问by Woot4Moo
How does one go about selecting all indexes of a specific type in Oracle 10g, for instance I want all of the bitmap
indexes 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 SELECT
access on, you can query all_indexes
rather than dba_indexes
. If you are only concerned with indexes in the current schema, you can query user_indexes
rather than dba_indexes
.
可能是您正在寻找的(尽管您可能只需要 where 的索引index_type = 'BITMAP'
。如果您只关心您有权SELECT
访问的表的索引,您可以查询all_indexes
而不是dba_indexes
。如果您只关心当前模式中的索引,您可以查询user_indexes
而不是dba_indexes
。