【Oracle】用户管理

create user hywin identified by hywin; 创建用户

password 用户名  修改密码
alter user 用户名 identified by 新密码
drop user 用户名 [cascade]; 删除用户时,如用户已经创建了表,那么就需要在删除时带一个参数cascade。

grant connect to 用户名; 为某用户名授连接数据库的权限。connect为一种角色。

revoke select on emp from hywin; 收回hywin查询emp表的权限。

权限:

1系统权限(约140种)
用户对数据库的相关权限,建库、建表、修改密码等权限。create session

2对象权限(约25种)
用户对其他用户的数据对象操作的权限。(数据对象:表、视图、索引、触发器等)
select insert update delete all

grant select on emp to hywin; 为hywin授权可查询emp表。
select * from scott.emp;方案

角色:

1预定义角色
2自定义角色

connect 里面有7种权限。
dba 管理员角色
resource 可在任何一个表空间建表


desc 表名; 查看表结构


权限的维护
对象权限:后缀with grant option
grant select on emp to hywin with grant option;

系统权限:后缀with admin option
grant select on emp to hywin with admin option;

多级授权后收去中间用户的某些权限则此中间用户之前所授给其他用户的权限同时收回。


口令管理
profile

scott用户最多尝试三次登录,之后锁定2天。
create profile lock_account limit failed_login_attempts 3 password_lock_time 2; --lock_account 规则名称

alter user scott profile lock_account;

给用户解锁
alter user scott account unlock;

中止口令
create profile myprofile limit password_life_time 10 password_grace_time 2;十天修改一次密码,宽限两天。

alter user scott profile myprofile;

口令历史
create profile password_history limit password_life_time 10 password_grace_time 2 password_reuse_time 10;十天后可重用


删除profile
drop profile password_history [cascade]

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值