database 在哪个表空间上建立索引

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5867320/
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-08 08:11:00  来源:igfitidea点击:

Index on which tablespace

databaseoraclejdbcindexingtablespace

提问by frewper

How to find out which 'tablespace' a particular 'index' belongs to. (oracle) (need to use it via jdbc)

如何找出特定“索引”属于哪个“表空间”。(oracle)(需要通过jdbc使用)

回答by Tony Andrews

The information is in the ALL_INDEXES(or USER_INDEXES) view:

信息在ALL_INDEXES(或 USER_INDEXES)视图中:

select tablespace_name
from all_indexes
where owner = 'MYSCHEMA'
and index_name = 'MYINDEX';

回答by Vadzim

user_indexes.tablespace_nameis null for partitioned indices.

user_indexes.tablespace_name对于分区索引为 null。

Viewing Information About Partitioned Tables and Indexessuggests that user_ind_partitionsview can be used to check containing tablespace for each separate index partition:

查看有关分区表和索引的信息建议user_ind_partitions可以使用视图来检查每个单独索引分区的包含表空间:

select index_name, partition_name, tablespace_name from user_ind_partitions
    where index_name = 'MYINDEX';