Find TABLE and COLUMN PRIVILAGES
TABLE PRIVILLAGES
******************************************************
SELECT 'GRANT ',
PRIVILEGE,
' ON ',
TABLE_NAME,
' TO ',
GRANTEE,
';'
FROM DBA_TAB_PRIVS
WHERE OWNER = upper('&&owner')
AND TABLE_NAME = upper('&&table');
COLUMN PRIVILLAGES
*********************************************************
SELECT 'GRANT ',
PRIVILEGE,
' ( ',
COLUMN_NAME,
' ) ',
' ON ',
TABLE_NAME,
' TO ',
GRANTEE,
';'
FROM DBA_COL_PRIVS
WHERE OWNER = upper('&&owner')
AND TABLE_NAME = upper('&&table');
TABLE PRIVILLAGES
******************************************************
SELECT 'GRANT ',
PRIVILEGE,
' ON ',
TABLE_NAME,
' TO ',
GRANTEE,
';'
FROM DBA_TAB_PRIVS
WHERE OWNER = upper('&&owner')
AND TABLE_NAME = upper('&&table');
COLUMN PRIVILLAGES
*********************************************************
SELECT 'GRANT ',
PRIVILEGE,
' ( ',
COLUMN_NAME,
' ) ',
' ON ',
TABLE_NAME,
' TO ',
GRANTEE,
';'
FROM DBA_COL_PRIVS
WHERE OWNER = upper('&&owner')
AND TABLE_NAME = upper('&&table');
No comments:
Post a Comment