mysql 密码错误次数_Oracle 用户登录密码错误次数修改

Oracle默认允许用户输入10次错误密码,超过10次后账户就会被锁定

sys@ORCL>select * from dba_profiles where profile='DEFAULT' and resource_name='FAILED_LOGIN_ATTEMPTS';

PROFILE    RESOURCE_NAME              RESOURCE_TYPE    LIMIT

--------------- ------------------------------ ------------------------ -------------------

DEFAULT    FAILED_LOGIN_ATTEMPTS          PASSWORD        10

测试zx用户,使用错误的密码连接11次

[oracle@rhel6 ~]$ cat login.sh

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

sqlplus zx/123 <

EOF

[oracle@rhel6 ~]$ sh login.sh

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:16 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:17 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:19 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:22 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:26 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:31 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:37 2017

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

ERROR:

ORA-01017: invalid username/password; logon denied

Enter user-name:

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 16 17:09:45 2017

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

ERROR:

ORA-28000: the account is locked

#提示用户被锁定

#查询视图zx用户被锁定

sys@ORCL>select username,account_status,profile from dba_users where username='ZX';

USERNAME  ACCOUNT_STATUS    PROFILE

---------- -------------------- ---------------

ZX    OPEN        DEFAULT

基于这个特性,如果在生产上修改了数据库用户密码,但是应用部分没有修改完全,则应用启动后有问题的应用会一直尝试连接数据库导致数据库用户被锁定,影响业务正常运行。可以修改用户尝试登录次数为ulimited来防止这种情况发生。

12345678910111213 sys@ORCL>alter user zx account unlock;

User altered.

sys@ORCL>alter profile default limit failed_login_attempts unlimited;

Profile altered.

sys@ORCL>select * from dba_profiles where profile='DEFAULT' and resource_name='FAILED_LOGIN_ATTEMPTS';

PROFILE    RESOURCE_NAME              RESOURCE_TYPE    LIMIT

--------------- ------------------------------ ------------------------ -------------------

DEFAULT    FAILED_LOGIN_ATTEMPTS          PASSWORD        UNLIMITED

至此,用户zx无论使用多少次错误密码都不会导致账户锁定。

0b1331709591d260c1c78e86d0c51c18.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值