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

有帮助吗?

解决方案

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

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

其他提示

user_indexes.tablespace_name is null for partitioned indices.

Viewing Information About Partitioned Tables and Indexes suggests that user_ind_partitions view can be used to check containing tablespace for each separate index partition:

select index_name, partition_name, tablespace_name from user_ind_partitions
    where index_name = 'MYINDEX';
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top