希望小明用户可以查询emp表的同时,还可以把这种权限继续传给别人;
>conn scott;
>grant select on emp to xiaoming with grant option;
>create user xiaohong identified by 1234;
>grant create session to xiaohong;
>conn xiaoming/1234;
>grant select on scott.emp to xiaohong;
--如果是系统权限
system给xiaoming权限时:
>conn system/Hr123456
>grant connect to xiaoming with admin option;
如果scott把xiaoming用户权限收回,那么xiaohong的权限是否也收回??
>conn scott;
>revoke select on scott.emp from xiaoming;
>conn xiaohong/1000;
>select * from scott.emp;
答:xiaohong的权限也被收回
使用profile管理用户口令
创建profile文件(dba)
>CREATE PROFILE lock_account LIMIT FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 2;
>alter user xiaoming profile lock_account;
给用户解锁(dba)
>alter user xiaoming account unlock;
终止口令(dba)
> alter profile lock_account limit password_life_time 10 password_grace_time 2; --修改profile文件
>CREATE PROFILE myprofile LIMIT PASSWORD_LIFE_TIME 10 PASSWORD_GRACE_TIME 2;
>alter user xiaoming profile myprofile;
删除profile
>drop profile password_history[cascade]
转载于:https://my.oschina.net/869088067/blog/795587