오라클 스키마 조회 쿼리
-- 테이블 리스트 조회
SELECT * FROM all_all_tables;
SELECT * FROM dba_tables;
SELECT * FROM ALL_OBJECTS WHERE OBJECT_TYPE = 'TABLE';
SELECT * FROM tab;
SELECT * FROM tabs;
SELECT * FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE';
SELECT * FROM USER_TABLES;
-- 테이블 컬럼 조회
SELECT * FROM COL WHERE tname='{테이블명}';
SELECT * FROM COLS WHERE TABLE_NAME ='{테이블명}';
SELECT * FROM user_tab_columns WHERE tname='{테이블명}';
-- 테이블 PK 조회
SELECT A.TABLE_NAME
, A.CONSTRAINT_NAME
, B.COLUMN_NAME
, B.POSITION
FROM ALL_CONSTRAINTS A
, ALL_CONS_COLUMNS B
WHERE A.TABLE_NAME = '{테이블명}'
AND A.CONSTRAINT_TYPE = 'P'
AND A.OWNER = B.OWNER
AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
ORDER BY B.POSITION;
-- 테이블 트리거 조회
SELECT TRIGGER_NAME, STATUS
FROM USER_TRIGGERS
WHERE TABLE_NAME = '{테이블명}';