Behavior of dependent objects. : user_objects « System Tables Data Dictionary « Oracle PL/SQL Tutorial






SQL>
SQL> COLUMN object_name FORMAT a20
SQL>
SQL> CREATE TABLE simple_table (f1 NUMBER);

Table created.

SQL>
SQL> CREATE OR REPLACE PACKAGE Dependee AS
  2    PROCEDURE Example(p_Val IN NUMBER);
  3  END Dependee;
  4  /

Package created.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY Dependee AS
  2    PROCEDURE Example(p_Val IN NUMBER) IS
  3    BEGIN
  4       INSERT INTO simple_table VALUES (p_Val);
  5    END Example;
  6  END Dependee;
  7  /

Package body created.

SQL>
SQL> CREATE OR REPLACE PROCEDURE Depender(p_Val IN NUMBER) AS
  2  BEGIN
  3    Dependee.Example(p_Val + 1);
  4  END Depender;
  5  /

Procedure created.

SQL>
SQL> SELECT object_name, object_type, status FROM user_objects WHERE object_name IN ('DEPENDER', 'DEPENDEE','SIMPLE_TABLE');

OBJECT_NAME          OBJECT_TYPE         STATUS
-------------------- ------------------- ----------
DEPENDEE             PACKAGE             VALID
DEPENDEE             PACKAGE BODY        VALID
DEPENDER             PROCEDURE           VALID
SIMPLE_TABLE         TABLE               VALID

4 rows selected.

SQL>
SQL> CREATE OR REPLACE PACKAGE BODY Dependee AS
  2    PROCEDURE Example(p_Val IN NUMBER) IS
  3    BEGIN
  4      INSERT INTO simple_table VALUES (p_Val - 1);
  5    END Example;
  6  END Dependee;
  7  /

Package body created.

SQL>
SQL> SELECT object_name, object_type, status FROM user_objects WHERE object_name IN ('DEPENDER', 'DEPENDEE','SIMPLE_TABLE');

OBJECT_NAME          OBJECT_TYPE         STATUS
-------------------- ------------------- ----------
DEPENDEE             PACKAGE             VALID
DEPENDEE             PACKAGE BODY        VALID
DEPENDER             PROCEDURE           VALID
SIMPLE_TABLE         TABLE               VALID

4 rows selected.

SQL>
SQL> DROP TABLE simple_table;

Table dropped.

SQL>
SQL> SELECT object_name, object_type, status FROM user_objects WHERE object_name IN ('DEPENDER', 'DEPENDEE','SIMPLE_TABLE');

OBJECT_NAME          OBJECT_TYPE         STATUS
-------------------- ------------------- ----------
DEPENDEE             PACKAGE             VALID
DEPENDEE             PACKAGE BODY        INVALID
DEPENDER             PROCEDURE           VALID

3 rows selected.

SQL>








30.90.user_objects
30.90.1.Check user_objects for object name
30.90.2.Check the package status in user_objects
30.90.3.Check function/procedure status
30.90.4.Check the status for all stored procedures is by using the Oracle data dictionary view USER_OBJECTS
30.90.5.Get invalid table objects by joining user_segments and user_objects
30.90.6.Get all invalid user objects in user_objects table
30.90.7.Create drop command by query the user_objects table
30.90.8.Create grant permission command by querying user_objects table
30.90.9.Query user_objects for all packages, procedures and functions
30.90.10.Query user_objects for user-defined data type
30.90.11.Recompile all invalid package
30.90.12.Query user_objects for all java classes
30.90.13.Query user_objects for all PL/SQL code
30.90.14.Get Object id from user_objects
30.90.15.Join sys.col$ and user_objects
30.90.16.Query user_objects for object status
30.90.17.Query user_objects for your functions and procedures
30.90.18.User and its average object id
30.90.19.Show the procedure is marked invalid **
30.90.20.Behavior of dependent objects.
30.90.21.Finding, Validating, and Describing Packages
30.90.22.If procedure is valid