REM -----------------------------------------------
REM  Compila tutti gli oggetti invalidi
REM -----------------------------------------------

SET PAGES 0 TRIMS ON ECHO OFF VERIFY OFF FEEDBACK OFF TERMOUT OFF

TTITLE OFF
CLEAR COLUMN

SPOOL compile.tmp

PROMPT SET ECHO ON VERIFY OFF FEEDBACK ON TERMOUT ON
PROMPT SPOOL compile.res
PROMPT 


SELECT 'ALTER ' || Decode(object_type, 'PACKAGE BODY', 'PACKAGE', object_type) 
  || ' ' || owner || '.' || object_name || ' COMPILE;' command_line1, 
  'show errors' command_line2
FROM all_objects 
WHERE status = 'INVALID'
ORDER BY owner
/

SPOOL OFF

@compile.tmp

SET PAGES 0 TRIMS ON ECHO OFF VERIFY ON FEEDBACK ON TERMOUT ON

PROMPT 
PROMPT ****************************************************************
PROMPT *
PROMPT * Ancora oggetti invalidi:
PROMPT * 
PROMPT ****************************************************************

COLUMN owner FORMAT a10 HEADING "Owner"
COLUMN object_name FORMAT a30 HEADING "Object"
COLUMN object_type FORMAT a13 HEADING "Type"
COLUMN status FORMAT a7 HEADING "Status"

SELECT owner, object_name, object_type, status
FROM all_objects 
WHERE status = 'INVALID'
ORDER BY owner
/

SET PAGES 24 TRIMS ON ECHO OFF VERIFY ON FEEDBACK ON TERMOUT ON

CLEAR COLUMN

SPOOL OFF

PROMPT
PROMPT ****************************************************************
PROMPT
PROMPT Output salvato in compile.res
PROMPT