Oracle7 Server Concepts

Contents Index Home Previous Next

How Oracle Executes Procedures and Packages

When you invoke a standalone or packaged procedure, Oracle performs these steps to execute it:

Verifying User Access

Oracle verifies that the calling user owns or has the EXECUTE privilege on the procedure or encapsulating package. The user who executes a procedure does not require access to any procedures or objects referenced within the procedure; only the creator of a procedure or package requires privileges to access referenced schema objects.

Verifying Procedure Validity

Oracle checks the data dictionary to see if the status of the procedure or package is valid or invalid. A procedure or package is invalid when one of the following has occurred since the procedure or package was last compiled:

A procedure is valid if it has not been invalidated by any of the above operations.

If a valid standalone or packaged procedure is called, the compiled code is executed.

If an invalid standalone or packaged procedure is called, it is automatically recompiled before being executed.

For a complete discussion of valid and invalid procedures and packages, recompiling procedures, and a thorough discussion of dependency issues, see Chapter 16, "Dependencies Among Schema Objects".

Executing a Procedure

The PL/SQL engine executes the procedure or package using different steps, depending on the situation:


Contents Index Home Previous Next