分类: Oracle
2011-02-14 15:08:22
This procedure compiles all procedures, functions, packages, and triggers in the specified schema.
Syntax
DBMS_UTILITY.COMPILE_SCHEMA ( schema VARCHAR2, compile_all BOOLEAN DEFAULT TRUE, reuse_settings BOOLEAN DEFAULT FALSE);Parameters
Table 116-12 COMPILE_SCHEMA Procedure Parameters
Parameter | Description |
---|---|
schema |
Name of the schema |
compile_all |
If TRUE, will compile everything within the schema regardless of whether it is VALID If FALSE, will compile only INVALID objects |
reuse_settings |
Indicates whether the session settings in the objects should be reused, or whether the current session settings should be adopted instead |
Exceptions
Table 116-13 COMPILE_SCHEMA Procedure Exceptions
Exception | Description |
---|---|
ORA-20000 |
Insufficient privileges for some object in this schema |
ORA-20001 |
Cannot recompile SYS objects |
ORA-20002 |
Maximum iterations exceeded. Some objects may not have been recompiled. |
Usage Notes
After calling this procedure, you should select from view ALL_OBJECTS for items with status of INVALID to see if all objects were successfully compiled.
To see the errors associated with INVALID objects, you may use the Enterprise Manager command:
SHOW ERRORS