編譯資料庫失效物件指令碼

foreverlee發表於2005-01-26
set heading off
set pages 9999
set linesize 500
set verify off
set echo off
SET FEED OFF
spool compile_invalid_object.sql
select 'alter '||object_type||' '||object_name||' compile;'
  from user_objects
 where status = 'INVALID'
   and object_type in ('VIEW','FUNCTION','JAVA SOURCE','JAVA CLASS','PROCEDURE','PACKAGE','TRIGGER');
select 'alter package '||object_name||' compile body;'
  from user_objects
 where status = 'INVALID'
   and object_type = 'PACKAGE BODY';
spool off
SET FEED ON
spool compile_invalid_object.log
@compile_invalid_object.sql
spool off[@more@]set heading off
set pages 9999
set linesize 500
set verify off
set echo off
SET FEED OFF
spool compile_invalid_object.sql
select 'alter '||object_type||' '||object_name||' compile;'
  from user_objects
 where status = 'INVALID'
   and object_type in ('VIEW','FUNCTION','JAVA SOURCE','JAVA CLASS','PROCEDURE','PACKAGE','TRIGGER');
select 'alter package '||object_name||' compile body;'
  from user_objects
 where status = 'INVALID'
   and object_type = 'PACKAGE BODY';
spool off
SET FEED ON
spool compile_invalid_object.log
@compile_invalid_object.sql
spool off

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

相關文章