1,cmd控制台:

使用sqlplus 命令:sqlplus sys/密码@ip/orcl as sysdba;

2,先设置具体时间格式,以便查看具体时间

SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

3,查看具体的被锁时间

SQL> select username,lock_date from dba_users where username='TEST';

4,解锁

SQL> alter user test account unlock;

5,查看是那个ip造成的test用户被锁

查看$ORACLE_HOME/network/admin/log/listener.log日志

10-MAR-2009 08:51:03 * (CONNECT_DATA=(SID=lhoms)(SERVER=DEDICATED)(CID=(PROGRAM=oracle)(HOST=omstestdb)(USER=oraoms))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.69.1.11)(PORT=49434)) * establish * lhoms * 0

10-MAR-2009 08:51:03 * (CONNECT_DATA=(SID=lhoms)(SERVER=DEDICATED)(CID=(PROGRAM=oracle)(HOST=omstestdb)(USER=oraoms))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.69.1.11)(PORT=49435)) * establish * lhoms * 0

这样可知是上面10.69.1.11的ip尝试多次失败登陆造成的被锁

注:

一般数据库默认是10次尝试失败后锁住用户

6,查看FAILED_LOGIN_ATTEMPTS的值

SQL> select * from dba_profiles where RESOURCE_NAME = 'FAILED_LOGIN_ATTEMPTS';

7,修改为30次

SQL>  alter profile default limit FAILED_LOGIN_ATTEMPTS 30;

8,修改为无限次(为安全起见,不建议使用)

SQL> alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
01-13 18:46