select do.owner ,  do.object_name 
from dba_objects do, dba_segments ds, dba_tables dt
where do.owner=ds.owner and do.owner=dt.owner
  and do.object_name = ds.segment_name and do.object_name=dt.table_name
  and ds.tablespace_name = 'DMSPACE';

select do.owner ,  do.object_name from dba_objects 

select 'alter index ' || do.owner || '.' || do.object_name || ' rebuild tablespace DMSPACE_tmp;' as cmd
from dba_objects do, dba_segments ds, dba_indexes di
where do.owner=ds.owner and do.owner=di.owner
  and do.object_type = 'INDEX'
  and do.object_name = ds.segment_name and do.object_name = di.index_name 
  and ds.tablespace_name='DMSPACE';