column currdate new_value pvmdt noprint
select ‘pvm_comp_’ || to_char(SYSDATE, ‘DDMONRRRR_HH24MI’) || ‘.sql’ currdate from v$instance;
spool &pvmdt
set lines 120 pages 2000
set head off
set feedback off
prompt set pages 5000 lines 120
prompt select ‘prompt ‘||a.owner||’.’||a.object_name||’ – ‘||a.object_type|| chr(10)||
prompt ‘alter ‘||
prompt decode(a.object_type,’PACKAGE BODY’,’PACKAGE’,object_type) || ‘ “‘||
prompt a.owner||'”.’||a.object_name||’ compile ‘||
prompt decode(a.object_type,’PACKAGE BODY’,’BODY;’,’;’)
prompt from
prompt dba_objects a
prompt where a.status = ‘INVALID’
prompt and object_id not in
prompt (
exec dbms_output.enable(NULL);
set serveroutput on size 1000000
declare
v_objid number(10);
total_count number(10);
v_counter number(10) := 1;
cursor c1 is select object_id from dba_objects where status=’INVALID’;
begin
select count(1) into total_count from dba_objects where status=’INVALID’;
for cur1 in c1 loop
dbms_output.put_line(cur1.object_id);
if v_counter < total_count then
dbms_output.put_line(‘,’);
end if;
v_counter := v_counter + 1;
end loop;
end;
/
prompt )
prompt /
set feedback on
spool off