Tharindu Chathuranga
Tharindu Chathuranga

Reputation: 25

Oracle data dictionary

Considering the following information from the Oracle data dictionary When the following command is executed, to obtain the information

SELECT grantee,owner,table_name,grantor, privilege, grantable
FROM user_tabs_privs;

enter image description here

What is the SQL statements that have been issued to cause these grants to exist in the dictionary? Also for each statement which user has executed the statement?

Upvotes: 0

Views: 238

Answers (2)

fred wu
fred wu

Reputation: 55

after you run the following steps, you can get the result you want

(1) firstly login as Ann,run the SQL statement: grant select on project to Billy with grant option; (2) still as Ann, runt the SQL statement: grant delete on employee to marlam ; (3) login as Billy, run the SQL statement: grant select on project to leah ;

Upvotes: 0

Littlefoot
Littlefoot

Reputation: 142753

Review this example and compare it to your output; you'll see which command leads to which result.

User mike:

SQL> show user
USER is "MIKE"
SQL> SELECT grantee,owner,table_name,grantor, privilege, grantable
  2  FROM user_tab_privs;

no rows selected

User scott will grant a few things to mike:

SQL> connect scott/tiger
Connected.
SQL> grant select on test to mike;

Grant succeeded.

SQL> grant delete on dept to mike with grant option;

Grant succeeded.

Back to mike, see what has happened:

SQL> connect mike/lion
Connected.
SQL> SELECT grantee,owner,table_name,grantor, privilege, grantable
  2  FROM user_tab_privs;

GRANTEE OWNER  TABLE_NAME GRANTOR    PRIVILEGE  GRANTABLE
------- ------ ---------- ---------- ---------- ----------
MIKE    SCOTT  DEPT       SCOTT      DELETE     YES
MIKE    SCOTT  TEST       SCOTT      SELECT     NO

SQL>

Upvotes: 2

Related Questions