大概情况是:从oracle11g开始,如果用户输入了错误的密码登录,那么随着登录错误次数的增加,每次登录前等待验证的时间也会增加,本意上是为了保护数据库被恶意登录的时候消耗太多db资源导致数据库消耗过高导致数据库服务器出问题,但是这里也引发了问题,如果使用错误密码登录过多,则会影响该用户的正常登录,也就是说密码有验证延迟导致你输入正确的密码登录也需要等待很久。给使用人员的体验就是数据库hang住了(其实你使用其它用户操作数据库完全正常)
演示:
SQL> set time on
17:49:18 SQL> conn gxgat/password
Connected.
17:49:45 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
17:49:51 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:49:58 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:50:02 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:50:08 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:50:12 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:50:22 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:51:25 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:51:34 SQL>
第一次的密码错误给出一个警告,后面的发现密码登录存在延迟(注意查看时间)
在测试过程中,一旦输入正确密码,验证成功过后,这个错误延时就会清0,从0开始重新计算数字了:
17:51:34 SQL> conn gxgat/password
Connected.
17:55:37 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
Warning: You are no longer connected to ORACLE.
17:55:55 SQL>
17:55:57 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:55:59 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:56:01 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:56:04 SQL> conn gxgat/error
ERROR:
ORA-01017: invalid username/password; logon denied
17:56:19 SQL>
通过设置Event屏幕密码延迟
ALTER SYSTEM SET EVENT = '28401 TRACE NAME CONTEXT FOREVER, LEVEL 1' SCOPE = SPFILE;