Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Firstly create sample users "user_a" and "user_b":</p> <pre><code>SQL&gt; create user user_a identified by user_a default tablespace users temporary tablespace temp; SQL&gt; create user user_b identified by user_b default tablespace users temporary tablespace temp; SQL&gt; grant connect to user_a, user_b; SQL&gt; grant create session to user_a, user_b; SQL&gt; grant create table to user_a, user_b; SQL&gt; grant create view to user_a, user_b; SQL&gt; alter user user_a quota unlimited on users; SQL&gt; alter user user_b quota unlimited on users; </code></pre> <p>Now connect as USER_A and create sample objects:</p> <pre><code>SQL&gt; conn user_a/user_a Connected. SQL&gt; create table tbl_a(id number, text varchar2(200)); Table created. SQL&gt; create view view_a as select id, text from tbl_a; View created. </code></pre> <p>Then connect as USER_B and create sample objects:</p> <pre><code>SQL&gt; conn user_b/user_b Connected. SQL&gt; create table tbl_b(id number, text varchar2(200)); Table created. SQL&gt; create view view_b as select id, text from tbl_b; View created. </code></pre> <p>And finally connect back as USER_A a search grants for his table TBL_A:</p> <pre><code>SQL&gt; conn user_a/user_a Connected. SQL&gt; select count(1) from ALL_TAB_PRIVS where grantor = 'USER_A' and PRIVILEGE = 'SELECT' and GRANTEE = 'USER_B'; </code></pre> <p>Out is:</p> <pre><code> COUNT(1) ---------- 0 </code></pre> <p>Now grant select on view VIEW_A for USER_B:</p> <pre><code>SQL&gt; grant select on view_a to user_b; Grant succeeded. </code></pre> <p>And again try search grants for USER_B to view object VIEW_A from USER_A:</p> <pre><code>SQL&gt; select count(1) from ALL_TAB_PRIVS where grantor = 'USER_A' and PRIVILEGE = 'SELECT' and GRANTEE = 'USER_B'; </code></pre> <p>And now result is:</p> <pre><code> COUNT(1) ---------- 1 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload