{"id":11529,"date":"2016-08-10T09:35:49","date_gmt":"2016-08-10T14:35:49","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=11529"},"modified":"2016-09-21T11:12:09","modified_gmt":"2016-09-21T16:12:09","slug":"oracle-find-tables-being-granted-to-another-user","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=11529","title":{"rendered":"Oracle: Find Object Grants"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#TableView_Grants\">Table\/View Grants<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#user_tab_privs\">user_tab_privs<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#all_tab_privs\">all_tab_privs<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#dba_tab_privs\">dba_tab_privs<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Examples\">Examples<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#System_Object_Grants\">System Object Grants<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#dba_sys_privs\">dba_sys_privs<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#user_sys_privs\">user_sys_privs<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Role_Grants\">Role Grants<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#dba_role_privs\">dba_role_privs<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#user_sys_privs_1\">user_sys_privs<\/a>\n\t\t\t<\/li>\n<\/ol>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"TableView_Grants\"><h2>Table\/View Grants<\/h2><\/span>\n<span id=\"user_tab_privs\"><h3>user_tab_privs<\/h3><\/span>\n<p>* Contains object grants for which the current user is the<br \/>\n&#8211; object owner,<br \/>\n&#8211; grantor,<br \/>\n&#8211; or grantee.<\/p>\n<span id=\"all_tab_privs\"><h3>all_tab_privs<\/h3><\/span>\n<p>* Contains object grants<br \/>\n&#8211; all object grants from <em>user_tab_privs<\/em><br \/>\n&#8211; Plus object grants for which an enabled role or PUBLIC is the grantee, i.e. object grants via role or PUBLIC.<\/p>\n<span id=\"dba_tab_privs\"><h3>dba_tab_privs<\/h3><\/span>\n<p>* Contains all object grants in the entire database<\/p>\n<span id=\"Examples\"><h3>Examples<\/h3><\/span>\n<p>* Find All Tables Granted to A User<\/p>\n<pre lang=\"sql\">\r\nselect * from dba_tab_privs where grantee='A_USER';\r\n<\/pre>\n<p>* Find Tables Granted to Another User<br \/>\n&#8211; Login grantor schema<\/p>\n<pre lang=\"sql\">\r\nselect grantee, table_name\r\nfrom user_tab_privs\r\nwhere grantee = 'ANOTHER_USER';\r\n\r\nselect grantee, table_name\r\nfrom all_tab_privs\r\nwhere grantee = 'ANOTHER_USER';\r\n\r\n<\/pre>\n<span id=\"System_Object_Grants\"><h2>System Object Grants<\/h2><\/span>\n<span id=\"dba_sys_privs\"><h3>dba_sys_privs<\/h3><\/span>\n<p>* Contains system privileges granted to users and roles.<br \/>\n* This view does not display the USERNAME column<\/p>\n<span id=\"user_sys_privs\"><h3>user_sys_privs<\/h3><\/span>\n<p>* Contains system privileges granted to the current user.<br \/>\n* This view does not display the GRANTEE column,<br \/>\n* This view instead displays the USERNAME column.<\/p>\n<span id=\"Role_Grants\"><h2>Role Grants<\/h2><\/span>\n<span id=\"dba_role_privs\"><h3>dba_role_privs<\/h3><\/span>\n<p>* Contains roles granted to all users and roles in the database.<\/p>\n<span id=\"user_sys_privs_1\"><h3>user_sys_privs<\/h3><\/span>\n<p>* Contains roles granted to the current user.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table\/View Grants user_tab_privs * Contains object grants for which the current user is the &#8211; object owner, &#8211; grantor, &#8211; or grantee. all_tab_privs * Contains object grants &#8211; all object grants from user_tab_privs &#8211; Plus object grants for which an &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=11529\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[35],"tags":[567],"class_list":["post-11529","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-oracle"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-2ZX","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11529"}],"version-history":[{"count":3,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11529\/revisions"}],"predecessor-version":[{"id":11567,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/11529\/revisions\/11567"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}