View the system permissions of the current user
Copy codeThe Code is as follows:
Select * from user_sys_privs;
System permission granted by the system administrator ----- sys user
Copy codeThe Code is as follows:
Create user lisi identified by 123456 // create a user
Grant create session to lisi // grant the session permission
Grant create table to lisi // grant the table creation permission
Grant create unlimited tablespace to lisi // grant unlimited permissions
Revoke create session from lisi // revoke permissions
Revoke create table from lisi
Revoke create unlimited tablespace from lisi
The current user has permissions on objects.
Copy codeThe Code is as follows:
Select * from user_tab_privs;
Object permission the Object Creator grants or revokes the permission
For example, the lisi user creates a table tab.
Copy codeThe Code is as follows:
Grant select on tab to wangwu // grant the query condition of the table tab to the wangwu user
Grant all on tab to wangwu // grant all operations on the table tab to the wangwu user
Revoke select on tab from wangwu
Revoke all on tab from wangwu
Transfer Permissions
Sys-> User A-> User B
System Permissions
Copy codeThe Code is as follows:
Grant ceate any table to lisi with admin option; // you can grant this permission to other users.
Object permission
Copy codeThe Code is as follows:
Grant select on tabA to lisi with grant option;
Role
Copy codeThe Code is as follows:
Create (drop) role myrole
Grant create session to myrole
Grant create table to myrole
Grant myrole to lisi