NAME
utlrcmp.sql – Utility package for dependency-based recompilation of invalid objects sequentially or in parallel.

DESCRIPTION
This script provides a packaged interface to recompile invalid PL/SQL modules, Java classes, indextypes and operators in a database sequentially or in parallel.

This script is particularly useful after a major-version upgrade. A major-version upgrade typically invalidates all PL/SQL and Java objects. Although invalid objects are recompiled automatically on use, it is useful to run this script ahead of time (e.g. as one of the last steps in your migration), since this will either eliminate or minimize subsequent latencies caused due to on-demand automatic recompilation at runtime.

PARALLELISM AND PERFORMANCE
Parallel recompilation can exploit multiple CPUs to reduce the time taken to recompile invalid objects. The degree of parallelism is specified by the first argument to utl_recomp.recomp_parallel(). In general, a parallelism setting of one thread per available CPU provides a good initial setting.

EXAMPLES
1. Recompile all objects sequentially:

execute utl_recomp.recomp_serial();

2. Recompile objects in schema SCOTT sequentially:

execute utl_recomp.recomp_serial(‘SCOTT’);

3. Recompile all objects using 4 parallel threads:

execute utl_recomp.recomp_parallel(4);

4. Recompile objects in schema JOE using the number of threads
specified in the paramter JOB_QUEUE_PROCESSES:

execute utl_recomp.recomp_parallel(NULL, ‘JOE’);

5. Recompile all objects using 2 parallel threads, but allow
other applications to use the job queue concurrently:

In other words – after it is installed you can use it to recompile your objects. You need privileges from the SYS environment on the utl_recomp package to use it. An advantage right now is that the source is not WRAPPED, disadvantage – you need the dba to install it. Nethertheless my “buikgevoel”says that it will be production worthy soon. As usual the moment has a “production” marker, the source will be WRAPPED by Oracle…

]]>By: Anton Schefferhttps://technology.amis.nl/2005/04/11/recompiling-invalid-objects/#comment-2029
Mon, 11 Apr 2005 15:42:26 +0000/?p=503#comment-2029The Oracle Documentation states that the only types allowed for dbms_ddl.alter_compile are: PACKAGE, PACKAGE BODY, PROCEDURE, FUNCTION, or TRIGGER. So it is not possible to compile invalid views with this procedure.
]]>