set heading off; set feedback off; set termout off; set echo off; set lines 1000; spool c:\index_fk.sql; select 'spool c:\report.log;' from dual; select 'DROP INDEX ' || col.owner || '.' || substr(col.table_name, 1, 12) || '_' || substr(col.column_name, 1, 12) || '_IDX;' || chr(13) || chr(10) || 'CREATE INDEX ' || col.owner || '.' || substr(col.table_name, 1, 12) || '_' || substr( col.column_name, 1, 12) || '_IDX ON ' || col.owner || '.' || col.table_name || ' (' || col.column_name || ') TABLESPACE Votre Tablespace;' from dba_cons_columns col, dba_constraints c1 where col.owner = 'Votre Owner' and col.constraint_name = c1.constraint_name and constraint_type = 'R'; select 'spool off;' from dual; spool off; set heading on; set feedback on; set termout on; set echo on; @c:\index_fk.sql