--NRADMIN 계정
SELECT A.TABLE_NAME, A.TAB_SIZE, A.IDX_SIZE
FROM (SELECT B.TABLE_NAME, ROUND(NVL(SUM(A.BYTES)/1024/1024/1024,0),2) TAB_SIZE, ROUND((NVL(MAX(C.BYTES),0)+NVL(MAX(D.BYTES),0))/1024/1024/1024,2) IDX_SIZE, MAX(A.TABLESPACE_NAME) TABLESPACE_NAME FROM DBA_SEGMENTS A, DBA_TABLES B,(SELECT B.TABLE_NAME, SUM(A.BYTES) BYTES FROM DBA_SEGMENTS A, DBA_INDEXES B WHERE 1=1
AND A.OWNER LIKE 'NRADMIN' AND A.SEGMENT_NAME = B.INDEX_NAME AND A.SEGMENT_TYPE IN ('INDEX', 'INDEX PARTITION') GROUP BY B.TABLE_NAME) C ,(SELECT B.TABLE_NAME, SUM(A.BYTES) BYTES FROM DBA_SEGMENTS A, DBA_LOBS B WHERE 1=1
AND A.OWNER LIKE 'NRADMIN' AND A.SEGMENT_NAME = DECODE(A.SEGMENT_TYPE, 'LOBSEGMENT', B.SEGMENT_NAME, B.INDEX_NAME) AND A.SEGMENT_TYPE IN ('LOBSEGMENT','LOBINDEX','LOB PARTITION') GROUP BY B.TABLE_NAME) D WHERE 1=1
AND A.OWNER LIKE 'NRADMIN' AND A.SEGMENT_NAME = B.TABLE_NAME AND A.SEGMENT_TYPE IN ('TABLE','TABLE PARTITION') AND A.SEGMENT_NAME = C.TABLE_NAME(+) AND A.SEGMENT_NAME = D.TABLE_NAME(+) GROUP BY B.TABLE_NAME ORDER BY B.TABLE_NAME) A
WHERE 1=1 AND TABLE_NAME NOT LIKE UPPER(TRIM('ORG_'))||'%'
--AND TABLE_NAME IN ('SRC_1000_PK', 'TAR_1000_PK')
--AND TABLESPACE_NAME IN ('TS_NRADMIN')
ORDER BY 2 DESC;
SELECT GRANTEE, GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTEE = 'NOOPY';