在登陆时被告知test用户被锁
1、用dba角色的用户登陆,进行解锁,先设置具体时间格式,以便查看具体时间
SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
Session altered.
2、查看具体的被锁时间
SQL> select username,lock_date from dba_users where username='TEST';
USERNAME LOCK_DATE
TEST 2012-07-10 12:04:27
3、解锁
SQL> alter user test account unlock;
User altered.
4、查看是那个ip造成的test用户被锁
[oracle@hzwebdb11g admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 16-JUL-2012 21:11:17
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hzwebdb11g.qa.webex.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 15-MAY-2012 15:24:17
Uptime 62 days 5 hr. 47 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/OraBase/OraHome1/network/admin/listener.ora
Listener Log File /home/oracle/OraBase/diag/tnslsnr/hzwebdb11g/listener/alert/log.xml
查看/home/oracle/OraBase/diag/tnslsnr/hzwebdb11g/listener/alert/log.xml 日志
<msg time='2012-07-10T12:04:27.637-04:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='hzwebdb11g.qa.webex.com'
host_addr='10.224.188.34'>
<txt>10-JUL-2012 12:04:27 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=qawebdb.qa.webex.com)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=180)(DELAY=5))(CID=(PROGRAM=wbxmcs-01)(HOST=gm02lnmcs1001)(USER=root))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.224.182.161)(PORT=50034)) * establish * qawebdb.qa.webex.com * 0
</txt>
</msg>
发现10.224.182.161这个IP连接数据库失败锁住数据库,改掉这个server的密码
一般数据库默认是10次尝试失败后锁住用户
1、查看FAILED_LOGIN_ATTEMPTS的值
select * from dba_profiles
2、修改为30次
alter profile default limit FAILED_LOGIN_ATTEMPTS 30;
3、修改为无限次(为安全起见,不建议使用)
alter profile default limit FAILED_LOGIN_ATTEMPTS unlimited;
©著作权归作者所有:来自51CTO博客作者badboy6515的原创作品,谢绝转载,否则将追究法律责任
Oracle时间的Oracle数据库天地