

The compile jobs are run by job queue processes.We can recompile invalid objects using oracle supplied script These jobs create parallel compile job processes in dba_scheduler. Select 'Alter ' || decode(object_type,'PACKAGE BODY','PACKAGE',object_type) || ' ' || object_name || ' compile ' || decode(object_type,'PACKAGE BODY',' body ',' ') from user_objects where object_type in ('PACKAGE','PACKAGE BODY','PROCEDURE') and status = 'INVALID' order by object_type, object_name Spool just the package, package body, and Procedure set heading off Select 'alter '||object_type|| ' ' || owner ||'.'||object_name || ' compile ' from dba_objects where status='INVALID'

Generating the list and compiling all the objects set heading off In case you have lots of invalid objects, you can generate scripts that will generate the SQL for compiling the invalid objects In case you are doing a compilation with a DBA user, we need to put the owner name in this alteration command
#Oracle recompile invalid objects how to
In each of the above, please make sure you are in the right pluggable database in the case of the Multitenant database Manual Compilation How to compile the view in Oracle Alter view compile How to compile Procedure in Oracle Alter procedure compile How to compile Package and Package body in Oracleįirst, compile the package specification, and then the body Alter package compile Īlter package compile body How to compile Function in Oracle Alter function compile How to compile materialized view Alter materialized view Compile How to compile synonym alter synonym compile Īlter public synonym compile How to compile Trigger Alter trigger Compile Option (b) and (c) can be used with the DBA role but Option (1) can be done by the individual users also Now once we can find the invalid objects, there are many ways to compile the invalid objects We can either connect to the pluggable database using the service name or we can connect as sysdba and then switch to that container how to compile invalid objects in oracle If the database is Multitenant, we need to make sure we are in the right container before executing these commands. Select object_name,object_type from user_objects
