Wednesday, October 27, 2010

Compile apps schema or invalid objects in database in Oracle applications R12

Check Invalid Objects:
Connect sqlplus apps/***
SQL> select count(*) from dba_objects where status=’INVALID’;
This Query will result in total number of Invalid objects in database
Three ways to compile Invalid Objects  :
1st    From DB Tier
Login to DB Tier  as Oracle user.
Source the environment i.e. SID_hostname.env
$ cd $ORACLE_HOME/rdbms/admin
Now run utlrp.sql script this will compile invalids objects in database
        Sqlplus ‘/as sysdba’
        SQL> @ utlrp.sql   à if you are connecting sqlplus from $ORACLE_HOME/rdbms/admin.
                                       Otherwise specify full path if from another location.
         e.g
         SQL> @$ORACLE_HOME/rdbms/admin/ utlrp.sql  
          The following pl/sql block invokes UTL_RECOMP to recompile invalid objects in Database

        2nd From Apps Tier Using adadmin

Login to apps tier as Appsuser
       $ Source the environment i.e APPSSID_hostname.env
      $ adadmin
       Reply to the prompts.
                                                AD Administration Main Menu
   --------------------------------------------------

   1.    Generate Applications Files menu

   2.    Maintain Applications Files menu

   3.    Compile/Reload Applications Database Entities menu

   4.    Maintain Applications Database Entities menu
   5.    Change Maintenance Mode

                  6.    Exit AD Administration

  Select Option 3 and press enter

Compile/Reload Applications Database Entities
   ---------------------------------------------------

   1.    Compile APPS schema

   2.    Compile menu information

   3.    Compile flexfields

   4.    Reload JAR files to database

   5.    Return to Main Menu

Select option 1. Compile APPS Schema.
Once you select option 1 it will start compiling Invalids.

 3rd. From SQL (Individual objects)

a)      Identity Invalid Object
 “SQL> select object_name, owner, object_type from all_objects where status like ‘INVALID’ ”
b)      SQL> alter [object] [object_name] compile;
E.g select OBJECT_NAME OBJECT_TYPE from user_objects where status 'INVALID';
               compile the objects accordingly....
               ALTER PACKAGE my_package COMPILE;
               ALTER PACKAGE my_package COMPILE BODY;
               ALTER PROCEDURE my_procedure COMPILE;
               ALTER FUNCTION my_function COMPILE;
               ALTER TRIGGER my_trigger COMPILE;
               ALTER VIEW my_view COMPILE;
SQ> show err à will display errors

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete