헤르메스 LIFE

[Oracle] 해당 DB의 모든 OBJECT를 볼수 있는 쿼리 본문

Database

[Oracle] 해당 DB의 모든 OBJECT를 볼수 있는 쿼리

헤르메스의날개 2010. 12. 16. 10:08
728x90

 

SELECT CASE OBJECT_TYPE
       WHEN 'DATABASE LINK' THEN 'DBLINKS'
       WHEN 'FUNCTION' THEN 'FUNCTIONS'
       WHEN 'INDEX' THEN 'INDEXES'
       WHEN 'PACKAGE' THEN 'PACKAGES'
       WHEN 'PROCEDURE' THEN 'PROCEDURES'
       WHEN 'SEQUENCE' THEN 'SEQUENCES'
       WHEN 'TABLE' THEN 'TABLES'
       WHEN 'TRIGGER' THEN 'TRIGGERS'
       WHEN 'VIEW' THEN 'VIEWS'
       WHEN 'SYNONYM' THEN 'SYNONYMS'
       WHEN 'GRANT' THEN 'GRANTS'
       WHEN 'CONSTRAINT' THEN 'CONSTRAINTS'
       ELSE OBJECT_TYPE
       END||'|'||
       CASE OBJECT_TYPE
       WHEN 'DATABASE LINK' THEN 'DB_LINK'
       ELSE OBJECT_TYPE
       END||'|'||OBJECT_NAME  OBJECT_LIST
  FROM USER_OBJECTS
 WHERE OBJECT_NAME NOT LIKE 'BIN$%'
   AND OBJECT_TYPE NOT LIKE '%PARTITION'
   AND OBJECT_TYPE NOT IN ('PACKAGE BODY')
 ORDER BY OBJECT_TYPE
;
728x90