使用profile管理用户口令
profile是口令限制, 资源限制的命令集合,当建立数据时,oracle会自动建立名为default的profile,用户没有指定profile时,那oracle会自动将default分配给用户。
(1)指定scott用户最多只能尝试3次登录,一旦超过3次,将锁定用户2天。
①创建profile文件
attempts的英文解释:尝试。
②给用户指定profile文件
(2)当我们希望删除用户,同时又保留用户的数据对象的时候,我们可以通过直接锁定用户来实现。
当scott三次登录失败后或者被锁定时,系统提示:ORA-28000: the account is locked
这个时候给用户scott解锁的操作如下
(1)指定scott用户最多只能尝试3次登录,一旦超过3次,将锁定用户2天。
①创建profile文件
attempts的英文解释:尝试。
create profile xx_profile limit failed_login_attempts 3 password_lock_time 2;
创建成功的提示:配置文件已创建②给用户指定profile文件
alter user scott profile xx_profile;
指定成功的提示:用户已更改。(2)当我们希望删除用户,同时又保留用户的数据对象的时候,我们可以通过直接锁定用户来实现。
alter user scott account lock;
(3)给用户解锁当scott三次登录失败后或者被锁定时,系统提示:ORA-28000: the account is locked
这个时候给用户scott解锁的操作如下
alter user scott account unlock;
解锁成功的提示:用户已更改。