View PL/SQL compilation errors

Source: Internet
Author: User

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

  1. SQL>Select*FromV $ version;
  2. BANNER
  3. ----------------------------------------------------------------
  4. OracleDatabase10g Enterprise Edition Release 10.2.0.4.0-64bi
  5. PL/SQL Release 10.2.0.4.0-Production
  6. CORE 10.2.0.4.0 Production
  7. TNSForSolaris: Version 10.2.0.4.0-Production
  8. NLSRTL Version 10.2.0.4.0-Production

2. Obtain invalid objects in the database

  1. SetLinesize 180
  2. Col object_name format a45
  3. SELECTOwner, object_name, object_type, status
  4. FROMDba_objects
  5. WHEREStatus ='Invalid'
  6. AND
  7. Object_typeIN('Processure','Function','Trigger','View','Package');
  8. OWNER OBJECT_NAME OBJECT_TYPE STATUS
  9. -----------------------------------------------------------------------------------------------------
  10. OTC_WRHS_POSITION OTC_WRHS_POSITION_PCK_tmp PACKAGE INVALID

3. Invalid compilation objects (there are many compilation methods which are not listed here)

  1. -- Note that the name of the object in this package contains lowercase characters. Therefore, double quotation marks are used for compiling.
  2. SQL>AlterPackage"OTC_WRHS_POSITION"."OTC_WRHS_POSITION_PCK_tmp"Compile body;
  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.