-- 권한부여 스크립트 추출
SELECT  TABLE_NAME
,       COMMENTS
,       'GRANT UPDATE, SELECT, INSERT, INDEX, DELETE ON ' || OWNER || '.' || TABLE_NAME || ' TO USER1;'     AS "GRANT"
,       'REVOKE ALL ON ' || OWNER || '.' || TABLE_NAME || ' FROM USER1;'                                    AS "REVOKE"
FROM DBA_TAB_COMMENTS 
WHERE TABLE_NAME LIKE 'TBL_%';


-- 권한확인
SELECT * FROM DBA_SYS_PRIVS     WHERE GRANTEE IN ('USER1', 'USER2') ORDER BY GRANTEE;
SELECT * FROM DBA_ROLE_PRIVS    WHERE GRANTEE IN ('USER1', 'USER2') ORDER BY GRANTEE;
SELECT * FROM DBA_TAB_PRIVS     WHERE GRANTEE IN ('USER1', 'USER2') ORDER BY GRANTEE;

SELECT DISTINCT TABLE_NAME FROM DBA_TAB_PRIVS WHERE GRANTEE IN ('USER1', 'USER2') ORDER BY TABLE_NAME;