-- This script will create a SQL statement to drop indexes from the schema.
-- Primary keys, unique keys, foreign keys and general indexes are included.
-- Mark Reineck 1-8-1998

set feedback off set head off
set echo off
set recsep off
set pages 50000
set lines 150

-- Write the script to a file, otherwise it is useless

spool delindex.sql

-- Drop foreign keys

select 'alter table '||table_name||' drop constraint '||constraint_name||';' from user_constraints where r_constraint_name is not null;

-- Then drop all other indexes

select 'drop index '||index_name||';' from user_indexes;

spool off;

-- Reset some stuff

set feedback on;
set head on;
set echo on;