1.创建用户
create user test4 identified by test4;
alter user test4 unlock;
grant connect,resource to test4;

2.创建一个概要文件,如果出现两次口令失误,那么将账户锁定
create profile two_error limit failed_login_attempts 2;

3.将概要文件分配给test4用户
alter user test4 profile two_error;
select username,PROFILE from dba_users where username=‘test4’;

4.test4尝试两次登陆使用错误密码,系统报出ORA-28000错误
[email protected]>conn test4/t;
ERROR:
ORA-28000: the account is locked

5.sys用户为test4解锁
alter user test4 account unlock;

6.sys删掉了two_error概要文件
//删除two_error后,test4用户又绑定到default profile上。
drop profile two_error cascade;

补充

概要文件作用是对用户访问数据做一些限制,下面简单介绍一下这些限制
Oracle通过设置概要文件实现输入两次错误密码导致用户被锁住

相关文章: