Home arrow Oracle arrow Page 3 - Managing PL/SQL Code

Display information about stored objects - Oracle

Creating the code for an application is just the first step; you must then manage it, and that includes everything from compiling to testing and debugging. This article, the first part in a nine-part series, covers these issues for PL/SQL. It is excerpted from chapter 20 of the book Oracle PL/SQL Programming, Fourth Edition, written by Steven Feuerstein and Bill Pribyl (O'Reilly; ISBN: 0596009771). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

TABLE OF CONTENTS:
  1. Managing PL/SQL Code
  2. Managing Code in the Database
  3. Display information about stored objects
  4. Display and search source code
By: O'Reilly Media
Rating: starstarstarstarstar / 10
October 18, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The USER_OBJECTS view contains the following key information about an object:

OBJECT_NAME
  
Name of the object

OBJECT_TYPE
  
Type of the object (e.g., 'PACKAGE', 'FUNCTION',
   'TRIGGER')

STATUS
  
Status of the object: VALID or INVALID

LAST_DDL_TIME
  
Timestamp indicating the last time that this object
   was changed.

The following SQL*Plus script displays the status of PL/SQL code objects:

  /* File on web: psobj.sql */
  SET PAGESIZE 66
  COLUMN object_type FORMAT A20
  COLUMN object_name FORMAT A30
  COLUMN status FORMAT A10
  BREAK ON object_type SKIP 1
  SPOOL psobj.lis
  SELECT object_type, object_name, status
    FROM user_objects
  
WHERE object_type IN (
      'PACKAGE', 'PACKAGE BODY', 'FUNCTION', 'PROCEDURE',
      'TYPE', 'TYPE BODY', 'TRIGGER')
   ORDER BY object_type, status, object_name
  /
  SPOOL OFF

The output from this script file contains the following list:

  OBJECT_TYPE   OBJECT_NAME       STATUS
  ------------  --------------    ---------
  FUNCTION      DEVELOP_ANALYSIS  INVALID 
                NUMBER_OF_ATOMICS INVALID

  PACKAGE       CONFIG_PKG        VALID
                EXCHDLR_PKG       VALID

Notice that a two of my modules are marked as INVALID. See the section “Recompiling Invalid Code” for more details on the significance of this setting and how you can change it to VALID.



 
 
>>> More Oracle Articles          >>> More By O'Reilly Media
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: