限定用户登录失败的次数,默认为10次,如果10次都没有成功,该用户将被锁定。登录失败的次数是连续且累计的10次未成功的登录,两点注意:
(1)连续是指一直尝试登录始终不成功,若在10次之内有1次登录成功,前面尝试登录失败的次数则清零;若再次登录还可有10次尝试登录的失败机会;
(2)累计是指某一用户无论是当前会话登录,还是关闭数据库重启后登录,还关闭服务器并重启服务器登录。只要用户登录失败,在以上三种情况下系统都会累计失败次数,超过10次未成功登录,将会锁定登录失败的用户。

C:\>sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 2月 7 13:19:12 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options


SQL> create user test3 identified by test3;

用户已创建。

SQL> grant connect,resource to test3;

授权成功。

SQL> show user;
USER 为 "SYS"

SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


警告: 您不再连接到 ORACLE。
SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied

 

SQL> conn test3/test4
ERROR:
ORA-01017: invalid username/password; logon denied


SQL> conn test3/test4
ERROR:
ORA-28000: the account is locked

SQL> conn sys/juwang as sysdba
已连接。

\\不限制用户登录失败次数,执行下列语句,注意"DEFAULT",DEFAULT一定要大写字母
SQL> alter profile "DEFAULT" limit failed_login_attempts unlimited;

配置文件已更改

\\用户解锁
SQL> alter user test3 account unlock;

用户已更改。