SELECT
a.OWNER
, A.column_id
,A.TABLE_NAME
, A.COLUMN_NAME
, C.COMMENTS
,A.DATA_TYPE
, A.DATA_LENGTH
, A.DATA_PRECISION
, A.DATA_SCALE
, A.NULLABLE
, B.POSITION KEY
, A.DATA_DEFAULT
, B.CONSTRAINT_NAME
, REPLACE(INITCAP(A.COLUMN_NAME),'_') AS CAMELCASE
FROM
(SELECT *
FROM all_tab_columns
WHERE 1=1
) A
,
(SELECT *
FROM all_col_comments
WHERE 1=1
) C
,
(SELECT X0.OWNER
,X0.TABLE_NAME
,X0.COLUMN_NAME
,X0.POSITION
,X0.CONSTRAINT_NAME
FROM ALL_CONS_COLUMNS X0
,ALL_INDEXES X1
WHERE X0.OWNER = X1.OWNER
AND X0.TABLE_NAME = X1.TABLE_NAME
AND X0.CONSTRAINT_NAME = X1.INDEX_NAME
) B
WHERE 1=1
AND A.OWNER = B.OWNER(+)
AND A.TABLE_NAME = B.TABLE_NAME(+)
AND A.COLUMN_NAME = B.COLUMN_NAME(+)
AND A.OWNER = C.OWNER(+)
AND A.TABLE_NAME = C.TABLE_NAME(+)
AND A.COLUMN_NAME = C.COLUMN_NAME(+)
and A.TABLE_NAME like '테이블명%'
and ( 1=2
or C.COMMENTS like '%주민번호%'
or C.COMMENTS like '%계좌번호%'
or C.COMMENTS like '%카드번호%'
or C.COMMENTS like '%비밀번호%'
or C.COMMENTS like '%바이오정보%'
or C.COMMENTS like '%전화번호%'
or C.COMMENTS like '%휴대번화번호%'
or C.COMMENTS like '%E-mail%'
or C.COMMENTS like '%이메일%'
or C.COMMENTS like '%사업자번호%'
or C.COMMENTS like '%IP주소%'
)
-- ORDER BY owner , table_name , column_id
;
'DB > oracle' 카테고리의 다른 글
CentOS6.5 / Oracle11g / The listener supports no services (0) | 2020.04.24 |
---|---|
oracle / random YYYYMMDD (0) | 2020.04.22 |
oracle / job / batch (0) | 2020.04.17 |
oracle / dbms_scheduler (0) | 2020.04.17 |
oracle / expdp / impdp (0) | 2020.04.17 |