在搭建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#10 | 12.1.0 | 11.2.0 | 11.1.0 | 10.2.0 | 10.1.0 | 9.2.0 | |
12.2.0 | Yes | Yes | Yes | No | No | No#3 | No#3 |
12.1.0 | Yes | Yes | Yes | Was | MDS #7 | No#3 | No#3 |
11.2.0 | Yes#9 | Yes | Yes | Was | MDS #7 | No | Was #5 |
11.1.0 | No | Was | Was | Was | Was #7 | Was #6 | Was #5 |
10.2.0 | No | MDS #7 | MDS #7 | Was #7 | MDS | Was | Was #5 |
10.1.0#4 | No | No | Was #6 | Was #6 | Was | Was | Was |
9.2.0 | No | No#8 | Was #5 | Was #5 | Was #5 | Was | Was |
Key:
Yes Supported ES Supported but fixes only possible for customers with Extended Support . LES or MDS Supported but fixes only possible for customer with a valid Limited Extended Support or Market-Driven Support contract respectively. Was Was 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. No Has never been Supported