create user myuser identified by mypassword default tablespace users;
/**
請輸入使用者名稱: myuser
輸入口令:
ERROR:
ORA-01045: user MYUSER lacks CREATE SESSION privilege; logon denied
建立使用者後,使用者並不能馬上登入
*/
grant create session to myuser;--分配串連許可權後使用者myuser可以正常使用pl/sql
grant create table to myuser;--給使用者myuser分配建立表的許可權
alter user myuser quota 100M on users;--給使用者myuser分配USERS資料表空間
grant create session to myuser with amdin option;--使用者myUser可以將自己的許可權往下分
grant create session,create table to myuser;--一次分配多個許可權
revoke create session,create table from myuser;--回收使用者權限,使用with admin option 會因傳播者許可權變更失效
--對象許可權 grant OP_TYPE on OBJECT_NAME to USER;
grant select,insert,update,delete,execute,index,references,alter on emp to myuser;
grant all on emp to myuser;
grant select on emp to myuser with grant option;
revoke update,insert on emp from myuser;
--利用角色指派許可權(角色是許可權的集合)
create role myrole;
grant select,update to myrole;
grant myrole to to myuser;
--角色繼承
grant roleA to roleB;
--roleB 繼承roleA