-
创建一个用户lily,口令为123456,并设置默认的表空间为users,临时表空间temp,指定该用户在users表空间上最多可使用的大小为10MB;
create user lily identifed by 123456 defualt tablespace users temporary tablespace temp quota 10m on users;
-
修改用户lily在表空间上的磁盘限额为20MB,并修改用户lily的新口令为mrsoft;
alter user lily identified by mrsoft quota 20m on users;
-
解除被锁定的账户scott,修改口令为mrsoft;
alter user scott unlock identified by mrsoft;
-
创建用户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;
-
给用户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;
-
创建一个名为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;
-
取消角色designer的密码,然后重新给该角色设置一个密码为mrsoft;
alter role no identified; alter role designer identified 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;
-
创建一个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;
Oracle 用户操作练习
最新推荐文章于 2022-11-30 22:08:46 发布