用户管理实验
-
创建一个用户lily, 口令为123456, 并设置默认表空间为users, 临时表空间为temp, 指定该用户在mytbs_1表空间上最多可使用的大小为10MB;
create user lily identified by 123456 default tablespace users temporary tablespace temp quota 10m on tbsp_1;
-
修改用户lily在表空间上的磁盘限额为20m, 并修改用户lily的新口令为mrsoft
alter user lily identified by mrsoft quota 20m on tbsp_1;
-
解除被锁定的账户scott, 修改口令为mrsoft
alter user scott account unlock identified by mrsort;
-
创建用户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;
-
给用户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;
-
创建一个名为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;
-
取消角色designer的密码,然后重新给该角色设置一个密码为mrsoft
alter role designer not identified; alter role designer identitfied by mrsoft;
-
创建一个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;
-
创建一个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;