Wednesday 10 June 2015

To identify the Indexes in table in oracle apps

select ind.table_name "Table Name"
     , ind.index_name "Index Name"
     , ind.status     "Status"
     , listagg( '(' || column_position || ')' || rpad(column_name, 30, ' '), ', ')
        within group (order by column_position) "Indexed Columns"
  from dba_ind_columns ind_col
     , dba_indexes     ind
 where ind.table_name in ( 'GL_BALANCES', 'GL_JE_LINES', 'GL_IMPORT_REFERENCES', 'GL_JE_HEADERS', 'GL_JE_BATCHES', 'GL_JE_SEGMENT_VALUES')
   and ind.index_name = ind_col.index_name
   and ind.owner = ind_col.index_owner
 group by ind.table_name, ind.index_name, ind.status
 order by 1,2;

No comments:

Post a Comment