ALTER PACKAGE

Recompile a stored package.

Syntax:

   ALTER PACKAGE [schema.]package_name COMPILE [DEBUG] PACKAGE [REUSE SETTINGS];

   ALTER PACKAGE [schema.]package_name COMPILE [DEBUG] SPECIFICATION [REUSE SETTINGS];

   ALTER PACKAGE [schema.]package_name COMPILE [DEBUG] BODY [REUSE SETTINGS];

An alternative to ALTER PACKAGE COMPILE is the built-in pl/sql package DBMS_UTILITY

Using DBMS_UTILITY is the preferred method for Oracle 8.0 and above.

Script to recompile invalid objects

Select decode( object_type, 'PACKAGE BODY', 'ALTER PACKAGE ' || OBJECT_NAME || ' COMPILE BODY;','ALTER ' || OBJECT_TYPE || ' ' || OBJECT_NAME || ' compile;' )
from user_objects
where status = 'INVALID'
order by object_type

“One of the healthiest ways to gamble is with a spade and a package of garden seeds” ~ Dan Bennett

Related Commands:

CREATE PACKAGE
DROP PACKAGE

Related Views:

 CODE_PIECES
 CODE_SIZE
 DBA_SOURCE      ALL_SOURCE      USER_SOURCE


© Copyright SS64.com 1999-2013
Some rights reserved