Get invalid table objects by joining user_segments and user_objects : user_objects « System Tables Data Dictionary « Oracle PL/SQL Tutorial






SQL> column object_name format a30
SQL> column tablespace_name format a30
SQL> column object_type format a12
SQL> column status format a1
SQL> column status format a10
SQL> break on object_type skip 1
SQL>
SQL> select object_type, object_name,
  2         decode(status,'INVALID','*','') status,
  3         tablespace_name
  4    from user_objects a, user_segments b
  5   where a.object_name = b.segment_name (+)
  6     and a.object_type = b.segment_type (+)
  7     and rownum < 50
  8   order by object_type, object_name
  9  /


OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
FUNCTION     COMPUTE_DISCOUNTS
             DELETEEMPLOYEE                 *
             EXITFUNC
             F_GETDIFF                      *
             GETAREA

INDEX        BIN$fKX+qNArQt+8GLZvNQJlrQ==$0            SYSTEM


OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------

PACKAGE      PKG                            *
             PKG_TEST1

PACKAGE BODY PKG_TEST1

PROCEDURE    ADD_NEW_EMPLOYEE               *
 clear columns;

OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
PROCEDURE    AUTHORS_SEL                    *
             AUTHOR_FIRST_NAME_UPD          *
             AUTHOR_SEL                     *
             BIND_TEST                      *
             CHANGEPRICE
             COMPILE_WARNING                *
             DELETEMYEMPLOYEE               *

OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
PROCEDURE    EMPLOYEE_COUNT                 *
             EMP_CHANGE_S                   *
             HELLO
             HELLOFLE                       *
             HIKE_PRICES
             INSERT_NUMBERS                 *
             MEASURE_USAGE                  *

OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
PROCEDURE    MULTIPLE_CURSORS_PROC
             MYPROCEDURE                    *
             MY_FIRST_PROC
             NAMED_BLOCK                    *
             P
             P_HELLO
             P_HELLOTO

OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------

TABLE        BIN$dgfyftgCSZSBnu0LqVJzrQ==$0            USERS
             BIN$zbJqSAxnQA2up7MHjGauHw==$0            USERS
             EMPLOYEE_TAB
             EMP_DEPT                                  SYSTEM
             PEOPLE                                    SYSTEM


OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
TRIGGER      EMP_NAME_CHANGE                *
             LOG_SHUTDOWN                   *
             LOG_STARTUP                    *

TYPE         ADDRESSTYPE
             ADDRESS_OBJ
             AOBJ

OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
TYPE         EMPLOYEETYPE
             PERSONTYPE
             PRODUCTTYPE

TYPE BODY    AOBJ
             EMPLOYEETYPE


OBJECT_TYPE  OBJECT_NAME                    STATUS     TABLESPACE_NAME
------------ ------------------------------ ---------- ------------------------------
VIEW         EMP_DATA                       *
             NEWYORKEMP                     *


49 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