如何检索用户具有SELECT权限的所有表的列表(直接授予或通过指定的角色授予)?
答案 0 :(得分:2)
select owner||'.'||table_name from user_tab_privs where privilege='SELECT'
union
select rtp.owner||'.'||rtp.table_name from user_role_privs urp, role_tab_privs rtp
where urp.granted_role = rtp.role and rtp.privilege='SELECT'
union
select user||'.'||table_name from user_tables;
答案 1 :(得分:1)
select table_name from TABLE_PRIVILEGES where grantee='USER' and select_priv='Y'
union
select table_name from user_tables