Oracle 用户操作练习

  1. 创建一个用户lily,口令为123456,并设置默认的表空间为users,临时表空间temp,指定该用户在users表空间上最多可使用的大小为10MB;

    create user lily identifed by 123456 
    defualt tablespace users 
    temporary tablespace temp
    quota 10m on users;
    
  2. 修改用户lily在表空间上的磁盘限额为20MB,并修改用户lily的新口令为mrsoft;

    alter user lily identified by mrsoft
    quota 20m on users;
    
  3. 解除被锁定的账户scott,修改口令为mrsoft;

    alter user scott unlock identified by mrsoft;
    
  4. 创建用户rose,口令为mrsoft后,将创建session和创建table的权限授权给lily,然后lily再将这两个权限传递给rose,最后回收lily的创建表的权限;

    --创建user
    create user rose identified by mrsoft;
    --赋于创建session和table的权限
    grant create session,create table to lily with admin opeion;
    --lily将权限转移该rose
    conn lily/mrsoft;
    grant create session, create table to rose;
    --回收lily创建table的权限
    conn system/Oracle11;
    revoke create table from lily;
    
  5. 给用户rose授予表scott.emp, select的权限以及sal列上的insert和update权限,然后rose再将这三个权限授给lily;

    conn system/Oracle;
    alter user unlock scott identified by tiger;
    conn scott/tiger;
    grant select, insert(sal), update(sal) on emp to rose with grant opeion;
    conn rose/mrsoft;
    grant select, insert(sal), update(sal) on scott.emp to lily;
    
  6. 创建一个名为designer的角色,该角色的口令为123456,并给角色designer授予create view和create table的权限,并把角色designer授权给用户lily;

    conn system/Oracle11;
    create role designer identified by 123456;
    grant create view, create table to designer;
    grant designer to lily;
    
  7. 取消角色designer的密码,然后重新给该角色设置一个密码为mrsoft;

    alter role no identified;
    alter role designer identified by mrsoft;
    
  8. 8.创建一个profile文件,命名为lock_account,要求设置连续失败次数为8,超过该次数后,账户将被锁定7天,然后将profile文件分配给用户lily;

    create profile lock_account limit
    failed_login_attempts 8
    password_lock_time 7;
    alter user lily profile lock_account;
    
  9. 创建一个profile文件,命名为password_lift_time,并设置用户的密码有效期为90天,密码宽限期为5天,然后将此profile文件分配给用户rose。

    create profile password_lift_time limit
    password_lift_time 90
    password_grace_time 5;
    alter user rose profile password_lift_time;
    
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值