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

Oracle PL/SQL Tutorial
1. Introduction
2. Query Select
3. Set
4. Insert Update Delete
5. Sequences
6. Table
7. Table Joins
8. View
9. Index
10. SQL Data Types
11. Character String Functions
12. Aggregate Functions
13. Date Timestamp Functions
14. Numerical Math Functions
15. Conversion Functions
16. Analytical Functions
17. Miscellaneous Functions
18. Regular Expressions Functions
19. Statistical Functions
20. Linear Regression Functions
21. PL SQL Data Types
22. PL SQL Statements
23. PL SQL Operators
24. PL SQL Programming
25. Cursor
26. Collections
27. Function Procedure Packages
28. Trigger
29. SQL PLUS Session Environment
30. System Tables Data Dictionary
31. System Packages
32. Object Oriented
33. XML
34. Large Objects
35. Transaction
36. User Privilege
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL/SQL Tutorial » System Tables Data Dictionary » user_segments 
30. 95. 1. Get invalid table objects
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. 95. user_segments
30. 95. 1. Get invalid table objects
30. 95. 2. select segment_name, segment_type from user_segments
30. 95. 3. select * from DBA_SEGMENTS where Segment_Type = 'ROLLBACK'
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.