1 PACKAGE utl_recomp IS
2
3 $if utl_ident.is_oracle_server <> TRUE and
4 utl_ident.is_timesten <> TRUE $then
5 $error 'utl_recomp is not supported in this environment' $end
6 $end
7
8 /*
9 * Option flags supported by recomp_parallel and recomp_serial
10 * RANDOM_ORDER - Use a random order for parallel recompilation.
11 * *Note*: This is an internal testing mode that will
12 * be slower than the default.
13 * REVERSE_ORDER - Use reverse-dependency order for parallel
14 * recompilation.
15 * *Note*: This is an internal testing mode that will
16 * be slower than the default.
17 * SPECS_ONLY - Only recompile specifications. With this flag set
18 * only the following objects types will get recompiled:
19 * VIEWS, SYNONYMS, PROCEDURE, FUNCTION, PACKAGE,
20 * TYPE, LIBRARY.
21 * This mechanism can be used to allow lazy revalidation
22 * to take care of validating package bodies, type bodies
23 * triggers etc.
24 * TYPES_ONLY - Only recompile type specifications
25 * NEW_EDITION - Only recompile invalid objects in the current edition.
26 * This is useful for validating new or changed objects in
27 * a new edition that may have been left invalid by the
28 * installation process.
29 */
30 COMPILE_LOG CONSTANT PLS_INTEGER := 2; /* Obsolete */
31 NO_REUSE_SETTINGS CONSTANT PLS_INTEGER := 4; /* Obsolete */
32 RANDOM_ORDER CONSTANT PLS_INTEGER := 8;
33 REVERSE_ORDER CONSTANT PLS_INTEGER := 16;
34 SPECS_ONLY CONSTANT PLS_INTEGER := 32;
35 TYPES_ONLY CONSTANT PLS_INTEGER := 64;
36 NEW_EDITION CONSTANT PLS_INTEGER := 128;
37
38 /*
39 * NAME:
40 * recomp_parallel
41 *
42 * PARAMETERS:
43 * threads (IN) - Number of recompile threads to run in parallel
44 * If NULL, 0, or negative, RECOMP_PARALLEL computes a
45 * default degree of parallelism as the product of
46 * Oracle parameters "cpu_count" and
47 * "parallel_threads_per_cpu". On a Real Application
48 * Clusters installation, the degree of parallelism
49 * is the sum of individual settings on each node in
50 * the cluster.
51 * schema (IN) - Schema in which to recompile invalid objects
52 * If NULL, all invalid objects in the database
53 * are recompiled.
54 * flags (IN) - Option flags supported (as described above).
55 *
56 * DESCRIPTION:
57 * This procedure is the main driver that recompiles invalid objects
58 * in the database (or in a given schema) in parallel in dependency
59 * order. It uses information in dependency$ to order recompilation
60 * of dependents after parents.
61 *
62 * NOTES:
63 * The parallel recompile exploits multiple CPUs to reduce the time
64 * taken to recompile invalid objects. However, please note that
65 * recompilation writes significant amounts of data to system tables,
66 * so the disk system may be a bottleneck and prevent significant
67 * speedups.
68 */
69 PROCEDURE recomp_parallel(threads PLS_INTEGER := NULL,
70 schema VARCHAR2 := NULL,
71 flags PLS_INTEGER := 0);
72
73 /*
74 * NAME:
75 * recomp_serial
76 *
77 * PARAMETERS:
78 * schema (IN) - Schema in which to recompile invalid objects
79 * If NULL, all invalid objects in the database
80 * are recompiled.
81 * flags (IN) - Option flags supported (as described above).
82 *
83 * DESCRIPTION:
84 * This procedure recompiles invalid objects in a given schema or
85 * all invalid objects in the database.
86 */
87 PROCEDURE recomp_serial(schema VARCHAR2 := NULL, flags PLS_INTEGER := 0);
88
89 /*
90 * NAME:
91 * parallel_slave
92 *
93 * PARAMETERS:
94 * flags (IN) - Option flags supported (see recomp_parallel)
95 *
96 * DESCRIPTION:
97 * This is an internal function that runs in each parallel thread.
98 * It picks up any remaining invalid objects from utl_recomp_sorted
99 * and recompiles them.
100 */
101 $if utl_ident.is_oracle_server $then
102 PROCEDURE parallel_slave(flags PLS_INTEGER);
103 $else
104 /* parallel_slave is not supported */
105 $end
106
107 END;