Compiling Invalid Objects

Financials ( Applications ) Release 10 saw the introduction of procedures, packages, triggers, views etc.. which resulted in a considerable performance improvement, as well as the requirement for a large Shared_pool.

Given the complexity of Oracle Application and the high level of interrelationships between objects, I have found that many of these package will for various reasons become "INVALID". In most cases this is due to in-house modifications, upgrades, installs or the database is just having a bad day.

As part of a general maintenance routine or after:

* Applying patches
* New releases
* Installs/upgrades
* Applying in-house modifications
* Operating system upgrades
* etc....
I use the following SQL*PLUS script to identify and re-compile invalid objects.

NOTE: Given the degree of interrelationships you may have to execute this script several times.
    set head off
    set pagesize 0
    set echo off
    set verify off
    set feedback off
    set termout off

    spool /tmp/recomp_ora_objects.sql

    SELECT 'ALTER '||
           decode(object_type, 'PACKAGE BODY', 'PACKAGE',
                  object_type) || ' ' ||
           owner||'.'||
           object_name||' compile' ||
           decode(object_type, 'PACKAGE BODY', ' BODY') || ';'
      FROM dba_objects
     WHERE status = 'INVALID'
       and object_type in ( 'PACKAGE',
                            'PACKAGE BODY',
                            'PROCEDURE',
                            'VIEW',
                            'TRIGGER' )
    /

    spool off

    set feedback on
    set echo on
    set termout on

    spool /tmp/recomp_ora_objects.log

    @/tmp/recomp_ora_objects.sql

    spool off

Have a Oracle Question
Do you have an Oracle Question?

Oracle Books
Oracle Certification, Database Administration, SQL, Application, Programming Reference Books

Oracle Application
Oracle Application Hints and Tips

Oracle Home
Oracle Database, SQL, Application, Programming Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.