Getting a Database List : user_segments « System Tables Views « Oracle PL / SQL

Oracle PL / SQL
1. Aggregate Functions
2. Analytical Functions
3. Char Functions
4. Constraints
5. Conversion Functions
6. Cursor
7. Data Type
8. Date Timezone
9. Hierarchical Query
10. Index
11. Insert Delete Update
12. Large Objects
13. Numeric Math Functions
14. Object Oriented Database
15. PL SQL
16. Regular Expressions
17. Report Column Page
18. Result Set
19. Select Query
20. Sequence
21. SQL Plus
22. Stored Procedure Function
23. Subquery
24. System Packages
25. System Tables Views
26. Table
27. Table Joins
28. Trigger
29. User Previliege
30. View
31. XML
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 Tutorial
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 » System Tables Views » user_segments 
Getting a Database List
  
SQL>
SQL>
SQL> column object_name format a30
SQL> column tablespace_name format a30
SQL> column object_type format a12
SQL> column status format a1
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;

OBJECT_TYPE  OBJECT_NAME                    S TABLESPACE_NAME
------------ ------------------------------ - ------------------------------
CLUSTER      C_COBJ#                          SYSTEM
             C_FILE#_BLOCK#                   SYSTEM
             C_OBJ#                           SYSTEM
             C_TS#                            SYSTEM
             C_USER#                          SYSTEM

INDEX        I_CCOL1                          SYSTEM
             I_CDEF1                          SYSTEM
             I_CDEF2                          SYSTEM
             I_CDEF4                          SYSTEM
             I_COBJ#                          SYSTEM

OBJECT_TYPE  OBJECT_NAME                    S TABLESPACE_NAME
------------ ------------------------------ - ------------------------------
INDEX        I_COL2                           SYSTEM
             I_COL3                           SYSTEM
             I_CON1                           SYSTEM
             I_CON2                           SYSTEM
             I_FILE#_BLOCK#                   SYSTEM
             I_FILE1                          SYSTEM
             I_FILE2                          SYSTEM
             I_IND1                           SYSTEM
             I_OBJ#                           SYSTEM
             I_OBJ1                           SYSTEM
             I_OBJ2                           SYSTEM

OBJECT_TYPE  OBJECT_NAME                    S TABLESPACE_NAME
------------ ------------------------------ - ------------------------------
INDEX        I_OBJ3                           SYSTEM
             I_PROXY_DATA$                    SYSTEM
             I_PROXY_ROLE_DATA$_1             SYSTEM
             I_TAB1                           SYSTEM
             I_TS#                            SYSTEM
             I_TS1                            SYSTEM
             I_UNDO1                          SYSTEM
             I_UNDO2                          SYSTEM
             I_USER1                          SYSTEM

TABLE        BOOTSTRAP$                       SYSTEM

OBJECT_TYPE  OBJECT_NAME                    S TABLESPACE_NAME
------------ ------------------------------ - ------------------------------
TABLE        CCOL$
             CDEF$
             CLU$
             COL$
             CON$                             SYSTEM
             FET$
             FILE$                            SYSTEM
             ICOL$
             IND$
             OBJ$                             SYSTEM
             PROXY_DATA$                      SYSTEM

OBJECT_TYPE  OBJECT_NAME                    S TABLESPACE_NAME
------------ ------------------------------ - ------------------------------
TABLE        PROXY_ROLE_DATA$                 SYSTEM
             SEG$
             TAB$
             TS$
             UET$
             UNDO$                            SYSTEM
             USER$


49 rows selected.

SQL>
SQL> column status format a10
SQL>
SQL>

   
  
Related examples in the same category
1. Check if an object is valid by querying user_segments table
2. select segment_name, segment_type from user_segments
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.