Oracle 用户登录错误次数修改

简介:

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

1
2
3
4
5
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次

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
[oracle@rhel6 ~]$ cat login.sh 
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
EOF
sqlplus zx/123 <<EOF
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来防止这种情况发生。

1
2
3
4
5
6
7
8
9
10
11
12
13
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无论使用多少次错误密码都不会导致账户锁定。


官方文档:http://docs.oracle.com/cd/E11882_01/network.112/e36292/authentication.htm#CHDEGBEG

参考文档:http://www.2cto.com/database/201203/124001.html



     本文转自hbxztc 51CTO博客,原文链接:http://blog.51cto.com/hbxztc/1892362,如需转载请自行联系原作者




相关文章
|
SQL 存储 Oracle
oracle错误代码大全(超详细)
本篇文章是对oracle错误代码进行了详细的总结与分析,需要的朋友参考下
1340 0
|
SQL Oracle 关系型数据库
解决Oracle的状态: 失败 -测试失败: IO 错误: The Network Adapter could not establish the connection
解决Oracle的状态: 失败 -测试失败: IO 错误: The Network Adapter could not establish the connection
1680 0
解决Oracle的状态: 失败 -测试失败: IO 错误: The Network Adapter could not establish the connection
|
存储 Oracle 关系型数据库
MySQL数据库: 添加列、修改列、删除列、修改列属性、修改表名(包括MySQL、SQLServer、Oracle)
MySQL数据库: 添加列、修改列、删除列、修改列属性、修改表名(包括MySQL、SQLServer、Oracle)
407 0
MySQL数据库: 添加列、修改列、删除列、修改列属性、修改表名(包括MySQL、SQLServer、Oracle)
|
Oracle 算法 关系型数据库
Oracle如何修改数据库的DBID和DBNAME?
Oracle如何修改数据库的DBID和DBNAME?
322 0
|
网络协议 Oracle 关系型数据库
Oracle rac 修改SCAN IP
Oracle rac 修改SCAN IP
659 0
|
SQL Oracle 关系型数据库
【数据库】解决 oracle: SQL 错误 [900] [42000]: ORA-00900: 无效 SQL 语句
【数据库】解决 oracle: SQL 错误 [900] [42000]: ORA-00900: 无效 SQL 语句
1945 0
【数据库】解决 oracle: SQL 错误 [900] [42000]: ORA-00900: 无效 SQL 语句
|
存储 Oracle 关系型数据库
常见Oracle错误都在这了: ORA-00257/ORA-00313/ORA-28000/ORA-28000
常见Oracle错误都在这了: ORA-00257/ORA-00313/ORA-28000/ORA-28000
常见Oracle错误都在这了: ORA-00257/ORA-00313/ORA-28000/ORA-28000
|
存储 Oracle 关系型数据库
oracle数据库 修改表空间数据文件大小,优化存储
oracle数据库 修改表空间数据文件大小,优化存储
|
Oracle 关系型数据库 数据安全/隐私保护
oracle学习25-手工删除oracle归档日志后操作步骤 和修改用户默认解锁时间
oracle学习25-手工删除oracle归档日志后操作步骤 和修改用户默认解锁时间
124 0
|
Oracle 关系型数据库 数据安全/隐私保护
oracle学习22-ora-01691和修改密码过期时间
oracle学习22-ora-01691和修改密码过期时间
116 0

推荐镜像

更多