如何在Oracle SQL中显示索引 [英] How to show indexes in Oracle SQL
问题描述
我已经在Oracle SQl中创建了索引-
I have created an index in Oracle SQl-
在国家(首都)上创建索引ind_cname
create index ind_cname on country(capital)
执行后,我收到一条成功消息.现在,我想查看创建的索引. 请帮助显示索引的语法.
When executed I got a success message.Now I want to see the created Index. Please help in the syntax to show index.
我是Oracle的新手.我想要一个查询,该查询显示表的索引.
I am new to Oracle .I want a query which shows indexes for the table.
谢谢
推荐答案
如果您具有特权,则可以使用ALL_INDEXES或USER_INDEXES视图.该查询将是:
If you have the privileges, you can use the ALL_INDEXES or USER_INDEXES views. The query would be:
SELECT *
FROM all_indexes
WHERE table_name = 'COUNTRY';
如果要获取索引中包含的列的某些信息,可以从ALL_IND_COLUMNS中选择那些信息.有关这些视图的文档,请参见静态数据字典视图:从ALL_ALL_TABLES到ALL_MVIEWS
If you want some information on the columns included in the index, you can select those from ALL_IND_COLUMNS. Documentation regarding these views can be found here Static Data Dictionary Views: ALL_ALL_TABLES to ALL_MVIEWS
这篇关于如何在Oracle SQL中显示索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!