Created
June 19, 2014 15:18
-
-
Save lud/e40ee6288a1e72cd3baf to your computer and use it in GitHub Desktop.
Revisions
-
lud created this gist
Jun 19, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ DECLARE TYPE curs IS REF CURSOR; c curs; q varchar2(200); idx VARCHAR(200); tab VARCHAR(200); col VARCHAR(200); BEGIN q := 'select index_name,table_name,column_name from user_sdo_index_info'; OPEN c FOR q; LOOP FETCH c into idx,tab,col; EXIT WHEN c%NOTFOUND; SYS.dbms_output.put('Supression de l''index ' || idx || ' sur ' || tab); execute immediate 'drop index ' || idx; SYS.dbms_output.put_line(' ok'); SYS.dbms_output.put('Création de l''index ' || idx || ' sur ' || tab); execute immediate 'create index ' || idx || ' on ' || tab || '(' || col || ') INDEXTYPE IS mdsys.spatial_index'; SYS.dbms_output.put_line(' ok'); END LOOP; CLOSE c; END;