DBA使用create user創建用戶
CREATE USER user
IDENTIFIED BY password;
例子:
create user zhouqi1
identified by 123456;
--授予登入權限
grant create session to zhouqi1;
--授予創表權限
grant create table to zhouqi1;
--授予用戶空間無限制,5M
alter user zhouqi1 quota unlimited on users;
alter user zhouqi1 quota 5m on users;
--更改用戶密碼
alter user zhouqi1
identified by 654321;
--創建角色並賦於權限
create root my_root;
grant create session ,create table,create view to my_root;
--授予角色給用戶
grant my_root to zhouqi1;
--授予用戶zhouqi1查詢,更新system用戶中emp1表的權限
grant select,update on system.emp1 to zhouqi1;
grant select on system.departments to zhouqi1;
--授予所有用戶都能查employees表
grant select ,update,delete on employees to public;
--收回在system用戶下的表departments查詢權限
revoke select on departments from system;
系統權限:create session等
對象權限 :