国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

在Oracle中重編譯所有無效的存儲過程

2024-08-29 13:32:26
字體:
來源:轉載
供稿:網友

  sql_plus中,

spool execcompproc.sql
select 'alter procedure '||object_name||' compile;
' from all_objects where status = 'invalid' and object_type = 'procedure';
spool off
@execcompproc.sql;

  整理成一個存儲過程

create or replace procedure zl_compile_invalid_procedure as
strsql varchar2(200);
begin
for x in (select object_name from all_objects where status = 'invalid'
and object_type = 'procedure') loop
strsql := 'alter procedure ' || x.object_name || ' compile';
begin
 execute immediate strsql;
 exception
--when others then null;  
when others then dbms_output.put_line(sqlerrm);  
end;
end loop;
end;

  執行

exec zl_compile_invalid_procedure;

  如果要看到無法重編譯的過程的出錯信息,需要執行前設置set serverout on

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黑水县| 黄陵县| 邹城市| 宝丰县| 延长县| 中山市| 喜德县| 河源市| 大埔区| 古丈县| 桐乡市| 齐齐哈尔市| 东平县| 肃南| 丰镇市| 荣成市| 临朐县| 新郑市| 信宜市| 武安市| 扶余县| 无锡市| 嘉兴市| 镇江市| 朝阳市| 彰化市| 万州区| 乐业县| 鹤岗市| 东方市| 莆田市| 临潭县| 胶州市| 双江| 孝感市| 西畴县| 类乌齐县| 石家庄市| 沂源县| 平安县| 揭东县|