0

当您撤销特权时,例如:

REVOKE select ON product FROM user2;

撤销是默认级联的,还是必须指定?

谢谢

4

1 回答 1

1

通过 WITH GRANT OPTION 授予的权限将在授予者撤销该权限时自动删除。

CREATE USER bob1 IDENTIFIED BY "Password";              

User created.                                           

GRANT create table, create session TO bob1;             

Grant succeeded.                                        

CREATE USER bob2 IDENTIFIED BY "Password";              

User created.                                           

GRANT create session TO bob2;                           

Grant succeeded.                                        

CREATE USER bob3 IDENTIFIED BY "Password";              

User created.                                           

GRANT create session TO bob3;                           

Grant succeeded.                                        

CONNECT bob1                                            
Enter password: *********                               
Connected.                                              

CREATE TABLE bobs_t (n NUMBER);                         

Table created.                                          

GRANT select ON bobs_t TO bob2 WITH GRANT OPTION;       

Grant succeeded.                                        

CONNECT bob2                                            
Enter password: *********                               

GRANT select ON bob1.bobs_t TO bob3;                    

Grant succeeded.                                        

SELECT * FROM user_tab_privs;                           

GRANTEE  Owner  TABLE_NAME  GRANTOR  PRIVILEGE  GRA HIE 
-------- ------ ----------- -------- ---------- --- --- 
BOB3     BOB1   BOBS_T      BOB2     SELECT     NO  NO  
BOB2            BOBS_T      BOB1     SELECT     YES NO  

2 rows selected.                                        

CONNECT bob3                                            
Enter password: *********                               

SELECT * FROM user_tab_privs;                           


GRANTEE  Owner  TABLE_NAME  GRANTOR  PRIVILEGE  GRA HIE 
-------- ------ ----------- -------- ---------- --- --- 
BOB3     BOB1   BOBS_T      BOB2     SELECT     NO  NO  

1 row selected.                                         

CONNECT bob1                                            

SELECT * FROM user_tab_privs;                           

GRANTEE  Owner  TABLE_NAME  GRANTOR  PRIVILEGE  GRA HIE 
-------- ------ ----------- -------- ---------- --- --- 
BOB3     BOB1   BOBS_T      BOB2     SELECT     NO  NO  
BOB2            BOBS_T      BOB1     SELECT     YES NO  

2 rows selected.                                        

REVOKE select ON bobs_t FROM bob2;                      

Revoke succeeded.                                       

SELECT * FROM user_tab_privs;                           

no rows selected  
于 2013-03-22T11:03:58.443 回答