一、创建过程create or replace procedure p_rebuild_all_index
(tablespace_name in varchar2)
as
sqlt varchar(200);
begin
for idx in (select index_name, tablespace_name, status from user_indexes where tablespace_name=tablespace_name and status="VALID" and temporary = "N") loop
begin
sqlt := "alter index " || idx.index_name || " rebuild ";
--dbms_output.put_line(idx.index_name);
--dbms_output.put_line(sqlt);
EXECUTE IMMEDIATE sqlt;
--错误后循环继续执行。
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SQLERRM);
end;
end loop;
end;二、测试方法declare
--表空间名称
tablespace_name varchar2(100);
begin
tablespace_name:="dddd";
p_rebuild_all_index(tablespace_name);
end; Oracle中存储过程的创建之根据条件采番篇Oracle 10g的LogMiner使用的准备过程与分析过程相关资讯 Oracle教程
- Oracle中纯数字的varchar2类型和 (07/29/2015 07:20:43)
- Oracle教程:Oracle中查看DBLink密 (07/29/2015 07:16:55)
- [Oracle] SQL*Loader 详细使用教程 (08/11/2013 21:30:36)
| - Oracle教程:Oracle中kill死锁进程 (07/29/2015 07:18:28)
- Oracle教程:ORA-25153 临时表空间 (07/29/2015 07:13:37)
- Oracle教程之管理安全和资源 (04/08/2013 11:39:32)
|
本文评论 查看全部评论 (0)