Orcale Permission Role View Creation Method

  • 2021-07-18 09:16:45
  • OfStack

View the system permissions that the current user has
 
select * from user_sys_privs; 

System permissions granted by the system administrator--sys users
 
create user lisi identified by 123456 // Create a user  
grant create session to lisi // Grant permission to own the session  
grant create table to lisi // Grant permission to create tables  
grant create unlimited tablespace to lisi // Grant permissions without space restrictions  
revoke create session from lisi // Revoke authority  
revoke create table from lisi 
revoke create unlimited tablespace from lisi 

The current user has Yes permission on the object
 
select * from user_tab_privs; 

Object permissions Object creator grants or revokes permissions
For example: lisi user creates table tab
 
grant select on tab to wangwu // Alignment table tab The query condition of is granted to the wangwu Users  
grant all on tab to wangwu // Alignment table tab All operations of are granted to wangwu Users  
revoke select on tab from wangwu 
revoke all on tab from wangwu 

Permission transfer
sys - > A users- > B users
System permissions
 
grant ceate any table to lisi with admin option; // Li 4 Users can pass this permission to other users  

Object permissions
 
grant select on tabA to lisi with grant option; 

Role
 
create(drop) role myrole 
grant create session to myrole 
grant create table to myrole 
grant myrole to lisi 

Related articles: