oracle 用户管理(二):
接上一篇博客:
1.对权限的维护:
举一个例子来说明:
希望xiaoming用户可以去查询scott的emp表,并且还希望小明可以把这个权限
继续给别人
--如果是对象权限的话,就加入with grant option
这么做:grant select on emp to xiaoming with grant option
--如果是系统权限的话,就加入with admin option
这么做:grant connect to xiaoming with admin optionaui
2.profile管理用户口令;
举个例子:(一般都是在system登录的前提下赋予命令的)
指定scott这个用户最多只能尝试3次登录,锁定时间为2天
sql>create profile scott(这个scott名字可以随便取) limit failed_login_attempts
3 password_lock_time 2;
sql>alter user scott profile aaa(指定scott用户)
3.给用户解锁(同上system登录前提下)
sql>alter user scott account unlock;
如:给scott用户解锁
sql>alter user
4.终止口令:
举例说明:
给用户tea创建一个profile文件,要求该用户每隔10天要修改自家的登录密码,
宽限期为2天,代码如下:
sql>create profile myprofile(这个myprofile名字可以随便取,但要和下面的
代码对应)limit password_life_time 10 password_grace_time 2;
sql>alter user tea profile myprofile(指定用户)
5.删除profile
sql>drop profile 名字
接上一篇博客:
1.对权限的维护:
举一个例子来说明:
希望xiaoming用户可以去查询scott的emp表,并且还希望小明可以把这个权限
继续给别人
--如果是对象权限的话,就加入with grant option
这么做:grant select on emp to xiaoming with grant option
--如果是系统权限的话,就加入with admin option
这么做:grant connect to xiaoming with admin optionaui
2.profile管理用户口令;
举个例子:(一般都是在system登录的前提下赋予命令的)
指定scott这个用户最多只能尝试3次登录,锁定时间为2天
sql>create profile scott(这个scott名字可以随便取) limit failed_login_attempts
3 password_lock_time 2;
sql>alter user scott profile aaa(指定scott用户)
3.给用户解锁(同上system登录前提下)
sql>alter user scott account unlock;
如:给scott用户解锁
sql>alter user
4.终止口令:
举例说明:
给用户tea创建一个profile文件,要求该用户每隔10天要修改自家的登录密码,
宽限期为2天,代码如下:
sql>create profile myprofile(这个myprofile名字可以随便取,但要和下面的
代码对应)limit password_life_time 10 password_grace_time 2;
sql>alter user tea profile myprofile(指定用户)
5.删除profile
sql>drop profile 名字