创建和管理用户作业

创建和管理用户作业

1. 创建一个口令认证的数据用户usera_exer,口令为usera,默认表空间为USERS,配额为10MB,初始账户为锁定状态。(需要在system或sys用户下创建。)

gjI70kH.png

2. 为usera_exer用户授予create session权限、scott.emp的select权限和update权限,同时允许该用户将获得的权限授予其他用户。

TJKadOa.png

3. 创建一个口令认证的数据库用户userb_exer,口令为userb。

cMdbUFV.png

4. 将用户usera_exer的账户解锁。

I0Ga3Um.png

5. 用usera_exer登录数据库,查询和更新scott.emp中的数据,同时,将scott.emp的select和update权限授予用户 userb_exer。
usera_exer登录数据库

jeLq4wD.png

查询scott.emp中的数据

l07NxVk.png

更新scott.emp中的数据

xrOjgLl.png

将scott.emp的select和update权限授予用户 userb_exer。

0hZeSyn.png

参考代码
create user usera_exer identified by usera 
default tablespace users quota 10M on users account lock;

grant create session to usera_exer with admin option;
grant select,update on scott.emp to usera_exer with grant option;

create user userb_exer identified by userb;

alter user usera_exer account unlock;

conn usera_exer/usera;
select * from scott.emp;
update scott.emp set ename='ASIA' where ename='KING';
grant select,update on scott.emp to userb_exer;

转载于:https://www.cnblogs.com/zhangyazhou/p/9941404.html

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值