Oracle UTL_RECOMP
Version 12.1.0.2

General Information
Library Note Morgan's Library Page Header
"I spent my entire adult life looking out for the well-being, the training, the equipping of the troops for whom I was responsible. I will not be lectured about what our military needs by a five-deferment draft dodger,"
~ Sen. Tammy Duckworth
Purpose 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 package can handle the recompile of any database or container with the sole exception of PDB$SEED which is, by definition, READ ONLY. If PDB$SEED contains invalid objects your database is toast or, at the least, PDB$SEED, is unusable.
AUTHID DEFINER
Constants
Name Data Type Value
COMPILE_LOG (Obsolete) PLS_INTEGER 2
NO_REUSE_SETTINGS (Obsolete) PLS_INTEGER 4
RANDOM_ORDER PLS_INTEGER 8
REVERSE_ORDER PLS_INTEGER 16
SPECS_ONLY PLS_INTEGER 32
TYPES_ONLY PLS_INTEGER 64
NEW_EDITION PLS_INTEGER 128
Dependencies
DBA_SCHEDULER_JOBS DBMS_SCHEDULER PLITBLM
DBA_SCHEDULER_RUNNING_JOBS DBMS_STATS SYS_STUB_FOR_PURITY_ANALYSIS
DBMS_INTERNAL_LOGSTDBY DBMS_UTILITY UTL_IDENT
DBMS_LOCK DEPENDENCY$ UTL_RECOMP_ALL_OBJECTS
DBMS_OBJECTS_APPS_UTILS GV$PARAMETER UTL_RECOMP_COMPILED
DBMS_RANDOM JOB_DEFINITION UTL_RECOMP_ERRORS
DBMS_REGXDB JOB_DEFINITION_ARRAY UTL_RECOMP_SORTED
Documented Yes
First Available 12.1.0
Security Model Owned by SYS with no privileges granted. As of version 11.2.0.2 supports TimesTen.
Source {ORACLE_HOME}/rdbms/admin/utlrcmp.sql
Subprograms
 
PARALLEL_SLAVE
An internal function that runs in each parallel thread to recompile invalid objects from utl_recomp_sorted utl_recomp.parallel_slave(flags IN PLS_INTEGER);
Internal to package
 
RECOMP_PARALLEL
Recompiles all objects using 4 parallel threads utl_recomp.recomp_parallel(
threads PLS_INTEGER := NULL,
schema  VARCHAR2    := NULL,
flags   PLS_INTEGER := 0);
exec utl_recomp.recomp_parallel(4);
Recompile schema objects using the default degree of parallelism exec utl_recomp.recomp_parallel(NULL, 'UWCLASS');
Recompiles all objects using 2 parallel threads and allows other applications to use the job queue concurrently exec utl_recomp.recomp_parallel(2, NULL, utl_recomp.random_order);
 
RECOMP_SERIAL
Recompile all objects sequentially utl_recomp.recomp_serial;
exec utl_recomp.recomp_serial;
Recompile all objects in a schema sequentially utl_recomp.recomp_serial(schema VARCHAR2 := NULL, flags PLS_INTEGER := 0);
exec utl_recomp.recomp_serial('UWCLASS');
 
UTL_RECOMP Related Queries
Are there invalid database objects SELECT owner, object_type, COUNT(*)
FROM dba_objects
WHERE status = 'INVALID'
GROUP BY owner, object_type;
Is a UTL_RECOMP job currently running SELECT job_name
FROM dba_scheduler_running_jobs
WHERE job_name LIKE 'UTL_RECOMP_SLAVE_%';

Related Topics
DBMS_UTILITY.COMPILE_SCHEMA
Packages
What's New In 12cR1
What's New In 12cR2

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2017 Daniel A. Morgan All Rights Reserved