11

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

Vadzim
  • 24,954
  • 11
  • 143
  • 151
frewper
  • 1,385
  • 6
  • 18
  • 44

2 Answers2

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
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