Oracle用户管理--实验例题

33 篇文章 4 订阅
15 篇文章 0 订阅

用户管理实验

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

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

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

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

    create user rose identified by mrsoft;
    grant create session, create table to lily with admin option;
    conn lily/mrsoft
    grant create session,create table to rose;
    conn system/Oracle11 as sysdba;
    revoke system table from lily;
    
  5. 给用户rose授予表scott.emp select的权限以及sal列上的insert和update权限,然后rose再将这三个权限授给lily;

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

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

    alter role designer not identified;
    alter role designer identitfied by mrsoft;
    
  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_life_time 90
    password_grace_time 5
    alter user rose profile password_lift_time;
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值