Saturday, June 13, 2015

Find and recompile invalid object for particular table/objects.

SELECT DISTINCT NAME, TYPE, STATUS, 'ALTER '||REPLACE (TYPE, 'PACKAGE BODY', 'PACKAGE')||' '||NAME||' COMPILE;' RECOMPILE_SCRIPTS
  FROM USER_SOURCE U, USER_OBJECTS O
 WHERE     O.OBJECT_NAME = U.NAME
       AND UPPER (TEXT) LIKE '%TABLE_NAME%'
       AND UPPER(STATUS)<>'VALID'

No comments:

Post a Comment