create or replace procedure mtn_rebuild_all_idx
as
cursor indexCursor is
select * from user_indexes where table_owner='CMS4_CLEAN' and
index_type='NORMAL';
indexRow indexCursor%ROWTYPE;
sqlText varchar2(1024);
begin
open indexCursor;
loop
fetch indexCursor into indexRow;
exit when indexCursor%NOTFOUND;
sqlText :=' alter index ' || indexRow.index_name || ' rebuild ';
BEGIN
execute immediate (sqlText);
END;
end loop;
end;
本文介绍了一个用于Oracle数据库的PL/SQL过程,该过程能够遍历指定模式下的所有正常类型索引,并逐个进行重建,以优化数据库性能。
2572

被折叠的 条评论
为什么被折叠?



