Oracle UTL_RECOMP
Version 12.1.0.2

General Information
Library Note Morgan's Library Page Footer
The Library is currently in the process of being upgraded from Oracle Database Version 12.1.0.1 to 12.1.0.2. Demos are being upgraded to reflect the new Container paradigm as well as EBR (Edition Based Redefinition) and may contain references to CDBs, PDBs, and other objects you may not be familiar with such as CDB_OBJECTS_AE: Welcome to 12c.

Interested in Oracle GoldenGate? Check out the IGGOUG,
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
CDB_OBJECTS DBMS_REGXDB JOB_DEFINITION_ARRAY
DBA_SCHEDULER_JOBS DBMS_SCHEDULER PLITBLM
DBA_SCHEDULER_RUNNING_JOBS DBMS_STATS SYS_STUB_FOR_PURITY_ANALYSIS
DBMS_INTERNAL_LOGSTDBY DBMS_UTILITY UTL_RECOMP_ALL_OBJECTS
DBMS_LOCK DEPENDENCY$ UTL_RECOMP_COMPILED
DBMS_OBJECT_UTILS GV$PARAMETER UTL_RECOMP_ERRORS
DBMS_RANDOM JOB_DEFINITION 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

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-2014 Daniel A. Morgan All Rights Reserved