Compiling invalid objects is one of the common tasks of DBAs and database developers. The following two methods are provided to capture errors during compilation.
I. Current Database Version Information and invalid objects
1. view the current database version
- SQL>Select*FromV $ version;
- BANNER
- ----------------------------------------------------------------
- OracleDatabase10g Enterprise Edition Release 10.2.0.4.0-64bi
- PL/SQL Release 10.2.0.4.0-Production
- CORE 10.2.0.4.0 Production
- TNSForSolaris: Version 10.2.0.4.0-Production
- NLSRTL Version 10.2.0.4.0-Production
2. Obtain invalid objects in the database
- SetLinesize 180
- Col object_name format a45
- SELECTOwner, object_name, object_type, status
- FROMDba_objects
- WHEREStatus ='Invalid'
- AND
- Object_typeIN('Processure','Function','Trigger','View','Package');
- OWNER OBJECT_NAME OBJECT_TYPE STATUS
- -----------------------------------------------------------------------------------------------------
- OTC_WRHS_POSITION OTC_WRHS_POSITION_PCK_tmp PACKAGE INVALID
3. Invalid compilation objects (there are many compilation methods which are not listed here)
- -- Note that the name of the object in this package contains lowercase characters. Therefore, double quotation marks are used for compiling.
- SQL>AlterPackage"OTC_WRHS_POSITION"."OTC_WRHS_POSITION_PCK_tmp"Compile body;