title: How to join USER_TABLES with its corresponding indexes in USER_OBJECTS?
body: <p>I have for in loop to rebuild indexes of certain tables that have changed primary key.  Anyway to select only indexes of these tables from <code>USER_OBJECTS</code> linking with <code>TABLE_NAME</code> in <code>USER_TABLES</code>, also to exclude any IOT table's index. </p>
  
  <pre><code> FOR r IN (SELECT OBJECT_NAME AS OBJ FORM USER_OBJECTS WHERE OBJECT_TYPE = 'INDEX') LOOP
          l_sql := 'ALTER INDEX '||r.obj||' REBUILD'||'';
          EXECUTE IMMEDIATE l_sql;
   END LOOP; 
  </code></pre>
  
  <p>Above code just simply rebuild all indexes in the schema (included IOT, hence hit error <code>ORA-28650: Primary index on an IOT cannot be rebuilt</code>)</p>