Oracle的用户、角色及权限相关操作
1、创建用户
create user KD identified by 123456;
2、授予连接数据库的权限
grant connect to KD;
3、将Scott用户的emp表授权给KD可以查询
grant select on scott.emp to KD; grant create table to KD;
4、回收权限
revoke select on scott.emp from KD;
5、表的增删改权限授权
grant select,inset,delete,update on scott.emp to KD; revoke select,inset,delete,update on scott.emp from KD;
6、删除用户
SQL 错误: ORA-01940: 无法删除当前连接的用户
退出已经连接得KD用户后再执行
drop user KD;
会提示:错误: ORA-01922: 必须指定 CASCADE 以删除 'KD'
drop user KD cascade;
7、查看当前用户所拥有的权限
select * from session_privs;
8、查看当前用户所拥有的角色
select * from user_role_privs;
9、查看角色所有的权限
select * from dba_sys_privs; select * from dba_sys_privs where grantee='CONNECT'; --create session select * from dba_sys_privs where grantee='RESOURCE'; /* create trigger create sequence create type create procedure create cluster create operator create indextype create table */ select * from dba_sys_privs where grantee='DBA'; --有最高权限 所有的权限都有
创建一个开发人员并授权:
create user CURRY identified by 123456; create connet,resource to CURRY;
10、用户解锁
alter user HR account unlock;
11、修改用户密码
alter user HR identified by 123456;
相关推荐
娜娜 2020-06-22
Hody 2020-08-16
FightFourEggs 2020-08-16
yanghuatong 2020-08-16
LuoXinLoves 2020-08-09
Justdoit00 2020-06-26
Streamoutput 2020-02-09
LuoXinLoves 2019-11-03
Carlos 2020-06-16
zhangchaoming 2020-06-04
FightFourEggs 2020-05-28
Carlos 2020-05-26
流云追风 2020-05-14
Kingonion 2020-05-04
langyue 2020-05-03
zjyhll 2020-04-26
oraclemch 2020-04-19