Total Pageviews

Monday 20 February 2012

Recompile all invalid objects ADCOMPSC.pls

How can I recompile all my invalid objects using ADCOMPSC.pls?
=================================================================

Within Applications, there is a script to compile INVALID objects - called ADCOMPSC.pls

Arguments for ADCOMPSC.pls:
1 - Schema to run in
2 - Password for schema
3 - Check errors for objects starting with #3

NOTE:      The order in which to compile Invalid Objects in schemas is
    SYS, SYSTEM, APPS and then all others.  APPS_DDL and APPS_ARRAY_DDL
        should exist in all schema's.  If you encounter an ORA-1555 error
        while running adcompsc.pls, just restart the script.

The script can be run as follows:

cd $AD_TOP/sql
sqlplus @adcompsc.pls SCHEMA_NAME SCHEMA_PASSWORD %

Example:  SQL> @adcompsc.pls apps apps %


What if I still have invalid objects than can not be resolved by ADCOMPSC.pls?
==============================================================================

If there are any objects still left INVALID, you can verify them by using
aderrchk.sql to record the remaining INVALID objects.  Aderrchk.sql use the
same syntax as adcompsc.pls.  This script is also supplied with the
Applications. You can send the aderrchk.sql to a file using the
spool command in sqlplus.

e.g. sqlplus x/y @aderrchk.sql SCHEMA_NAME SCHEMA_PASSWORD %

For objects will not compile, try the following:

select text
from user_source
where name = 'OBJECTNAME'
and text like '%Header%';

This script will give you the sql that creates the packages.  You can then
recreate the packages.  SQL>@packageheader     SQL>@packagebody
If recreating the package does not make the package valid you will have to
analyze the user_errors table to try to determine the cause of the invalid
package.

select text
from user_errors
where name = 'PACKAGENAME';

No comments:

Post a Comment