set echo off
--------------------------------------------------------------------------------
-- compile.sql
--
-- Objects - Compile invalid objects for a specified user: functions, procedures, packages, views and triggers.
--
-- Usage: @compile owner object_name (%=wild card)
--
--------------------------------------------------------------------------------
define psize=0
define lsize=80
define workfile=compile.ddl
set verify off
set doc off
set feedback off
set linesize &&lsize
set pagesize &&psize
spool &&workfile
--
select 'alter '||decode(object_type,'PACKAGE BODY','PACKAGE',object_type)
||' '||owner||'.'||object_name||' compile'
||decode(object_type,'PACKAGE BODY',' BODY',null)||';'
from DBA_OBJECTS
where status <> 'VALID' and owner like upper('&1') and object_name like upper('&2')
order by owner, decode(object_type,'VIEW',0,'FUNCTION',1,'PROCEDURE',2,'PACKAGE',3,'PACKAGE BODY',4,5)
;
/*
REM prompt Enable Constraints
select 'alter table '||owner||'.'||table_name||' enable constraint '
||constraint_name||' ;' txt
from SYS.DBA_CONSTRAINTS
where status<>'ENABLED' and owner like upper('&&1')
order by owner,table_name,constraint_name
;
REM prompt REM Enable Triggers
select 'alter trigger '||owner||'.'||trigger_name||' enable ;' txt
from SYS.DBA_TRIGGERS
where status<>'ENABLED' and owner like upper('&&1')
order by owner,table_name,trigger_name
;
*/
--
spool off
set echo on
set verify on
set doc on
set feedback on
set pagesize 30
set linesize 80
start &&workfile
undefine psize
undefine lsize
undefine workfile
undefine 1
undefine 2
-- exit
|