您的位置:首页 > 数据库 > Oracle

Oracle 12C ORA-01017/ORA-28040问题总结

2017-08-23 09:48 597 查看
在搭建12.2.0版本双节点RAC项目环境以后,测试链接其他客户端连接时出现了登陆的问题,客户端版本10.2.0.1 链接报错如下:

[root@12c bin]# oerr ora 28040
28040, 0000, "No matching authentication protocol"
// *Cause:  No acceptible authentication protocol for both client and server
// *Action: Administrator should set SQLNET_ALLOWED_LOGON_VERSION parameter
//          on both client and servers to values that matches the minimum
//          version supported in the system.
[root@12c bin]# sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 8月 23 08:49:44 2017

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

请输入用户名:  system@cdb
输入口令:
ERROR:
ORA-28040: 没有匹配的验证协议
按照官方说法在服务端sqlnet.ora下需要添加如下参数,由于客户还有9i的客户端需要连接,这两个参数设置为了9

SQLNET.ALLOWED_LOGON_VERSION_SERVER= 9
SQLNET.ALLOWED_LOGON_VERSION_CLIENT= 9


第一个问题,RAC环境下listener用的是grid ,那么此时是不是应该在grid的ORACLE_HOME下修改sqlnet还是在oracle 的ORACLE_HOME下修改?

答案是在oracle 的ORACLE_HOME下修改sqlnet.ora 。如果是新安装的RAC,默认sqlnet.ora文件 是不存在的自己创建一个即可。

修改完毕后不需要重启监听或者数据库。重新登陆,此时出现如下错误。

[root@12c bin]# sqlplus 

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 8月 23 08:57:46 2017

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

请输入用户名:  system@cdb
输入口令: 
ERROR:
ORA-28040: 没有匹配的验证协议

请输入用户名:  system@cdb
输入口令: 
ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝

请输入用户名:  system/oracle@cdb
ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝


在原来主机上测试登陆结果如下,可以确认密码没有问题。

连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter user system identified by oracle;

用户已更改。

SQL> exit
从 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 断开
[oracle@12cr2 admin]$ vim sqlnet.ora
[oracle@12cr2 admin]$ sqlplus system/oracle

SQL*Plus: Release 12.2.0.1.0 Production on 星期三 8月 23 09:00:32 2017

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

上次成功登录时间: 星期三 8月  23 2017 08:56:50 +08:00

连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>
这个问题开始也是百思不得解,但是偶然发现新建的用户可以正常登陆

连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> alter session set container=pdb1;

会话已更改。

SQL> create user t1 identified by t1 ;

用户已创建。

SQL> grant connect,resource to t1;

授权成功。


在10.2.0.1客户端登陆,system显示用户名口令无效,但是使用新建的t1可以正常登陆。

[root@12c bin]# sqlplus system/oracle@pdb1

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 8月 23 09:33:55 2017

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

ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝

请输入用户名:  t1/t1@pdb1

连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
那么问题应该出在密码上,此时修改一遍密码还是用的原密码。

SQL> alter user system identified by oracle;
alter user system identified by oracle
*
第 1 行出现错误:
ORA-65066: 指定更改必须应用于所有容器

SQL> alter session set container=cdb$root;

会话已更改。

SQL> alter user system identified by oracle;

用户已更改。
在10g客户端登陆,此时登陆正常。

[root@12c bin]# sqlplus system/oracle@pdb1

SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 8月 23 09:39:20 2017

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

连接到:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


结果总结如下:

应该是oracle密码版本写入的时候使用的时11g和12c配置的规则,导致正确密码也无法通过验证。

在sqlnet.ora文件新增了SQLNET.ALLOWED_LOGON_VERSION_SERVER=n,SQLNET.ALLOWED_LOGON_VERSION_CLIENT=n后密码虽然支持n以上版本,但是此时由于密码规则事先写入,导致低版本客户端无法识别。

此时只需要alter user_name identified by passwd ;修改一遍即可了。官方明确说了不支持10g以下客户端,虽然是个BUG,但是保险起见还是把低版本客户端升级比较好。

Client

Version
Server Version
12.2.0#1012.1.011.2.011.1.010.2.010.1.09.2.0
12.2.0YesYesYesNoNoNo#3No#3
12.1.0YesYesYesWasMDS #7No#3No#3
11.2.0Yes#9YesYesWasMDS #7NoWas #5
11.1.0NoWasWasWasWas #7Was #6Was #5
10.2.0NoMDS #7MDS #7Was #7MDSWasWas #5
10.1.0#4NoNoWas #6Was #6WasWasWas
9.2.0NoNo#8Was #5Was #5Was #5WasWas
Key:

YesSupported
ESSupported but fixes only possible for customers with Extended Support .
LES or MDSSupported but fixes only possible for customer with a valid Limited Extended Support or Market-Driven Support contract respectively.
WasWas a supported combination but one of the releases is no longer covered by any of Premier Support, Primary Error Correct support, Extended Support, nor Extended Maintenance Support. Fixes are no longer possible.
NoHas never been Supported
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息