How to find out which 'tablespace' a particular 'index' belongs to. (oracle) (need to use it via jdbc)
Asked
Active
Viewed 3.5k times
2 Answers
18
The information is in the ALL_INDEXES (or USER_INDEXES) view:
select tablespace_name
from all_indexes
where owner = 'MYSCHEMA'
and index_name = 'MYINDEX';

Tony Andrews
- 129,880
- 21
- 220
- 259
-
4Potentially a partitioned index may cover several tablespaces. ALL_SEGMENTS is an alternative view – Gary Myers May 03 '11 at 13:14
1
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';

Vadzim
- 24,954
- 11
- 143
- 151