Sunday, June 16, 2013

Target Pre SQL To Drop All Indexes


The Following Procedure may useful to drop all bit map indexes from a particular table.We can use Mapping parameters to pass the table name dynamically.

CREATE or REPLACE Procedure Drop_All_Indexes
Is
Cur Integer;
Begin
cur:= dbms_sql.OPEN_CURSOR();
For t in (Select index_name from INDEXES_INFO where table_name='EMP' AND uniqueness='NONUNIQUE' AND index_type='BITMAP') loop
Execute immediate ' drop index ' || t.index_name;
End loop;
dbms_sql.close_cursor(cur);
End;
/
EXECUTE Drop_All_Indexes;