oracle編譯無效物件

chenfengwww發表於2012-07-20

alter function function_name compile;
alter package package)name compile;
alter type type_name compile;
alter index index_name rebuild;[@more@]


select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type
from dba_objects
where status='INVALID' order by owner,object_type;


1. Oracle SQL *Plus 中 —— 用 spool 生成指令碼檔案,然後 @ 調入執行,程式碼如下:
spool ExecCompProc.sql
select 'alter procedure '||object_name||' compile;' from all_objects
where status = 'INVALID' and object_type = 'PROCEDURE' AND owner='UNMI';
spool off
@ExecCompProc.sql;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22036495/viewspace-1058869/,如需轉載,請註明出處,否則將追究法律責任。

相關文章