Script to Show Invalid Objects in the Database


SET ECHO OFF
SET FEEDBACK ON
SET PAGES 100
SET LINES 132

REM
REM || Title : show_invalid_objects.sql
REM ||
REM || Purpose : This scripts will show the invalid objects in the database.
REM || Look into the possiblity of recompiling these objects.
REM ||
REM || Release No : 1
REM ||
REM || Variables : None
REM ||
REM || Schema : system
REM ||
REM ||

col "NAME" FORMAT A38 HEADING 'Object Name'
col "OBJECT_TYPE" FORMAT A12 HEADING 'Object Type'
col "CREATED" FORMAT A10 HEADING 'Created'
col "STATUS" FORMAT A10 HEADING 'Status'

SELECT owner,
SUBSTR (object_name, 1, 38) name,
status,
object_type,
created
FROM dba_objects
WHERE status LIKE 'INVALID'
ORDER BY owner,
object_type,
SUBSTR (object_name, 1, 38) ,
created

SPOOL show_invalid_objects.lst
/
SPOOL OFF

 




This script is provided for educational purposes only. The script has been tested and appears to work as intended. However, you should always test any script before relying on it. No responsibility will be accepted for Lost or damage that may occur from it's use.