oracle自動生成編譯所有函式、儲存過程、觸發器的語句

hljhrbsjf發表於2006-02-19
set feedback off
set heading off
set linesize 1000
set pagesize 0
set pause off
set trimspool on
set verify off

spool tmp.sql;
select 'alter '||object_type||' '||owner||'.'||object_name||' compile;'
from dba_objects
where status = 'INVALID'
and object_type in ('FUNCTION','JAVA SOURCE','JAVA CLASS','PROCEDURE','PACKAGE','TRIGGER');
select 'alter package '||owner||'.'||object_name||' compile body;'
from dba_objects
where status = 'INVALID'
and object_type = 'PACKAGE BODY';
spool off;
@tmp[@more@]

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

相關文章