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

【DB笔试面试851】在Oracle中,造成“ORA-28040: No matching ...”错误的原因是什么?

2021-04-14 23:49 1021 查看


         问题

在Oracle中,造成“ORA-28040: No matching authentication protocol”错误的原因是什么?


     




         答案          


 该错误是由于SQL*Plus的版本和数据库服务器的版本不一致导致的,使用oerr命令来查看,在Oracle 11g下:

1[oracle@orcltest ~]$ oerr ora 28040
228040, 0000, "No matching authentication protocol"
3// *Cause:  No acceptible authentication protocol for both client and server
4// *Action: Administrator should set SQLNET_ALLOWED_LOGON_VERSION parameter 
5//          on both client and servers to values that matches the minimum 
6//          version supported in the system.
7[oracle@orcltest ~]$ 
     


12c下:

1oracle@HQsPSL-R02:/oracle/app/oracle> oerr ora 28040
228040, 0000, "No matching authentication protocol"
3// *Cause:  There was no acceptable authentication protocol for 
4//          either client or server.
5// *Action: The administrator should set the values of the
6//          SQLNET.ALLOWED_LOGON_VERSION_SERVER and 
7//          SQLNET.ALLOWED_LOGON_VERSION_CLIENT parameters, on both the
8//          client and on the server, to values that match the minimum 
9//          version software supported in the system. 
10//          This error is also raised when the client is authenticating to 
11//          a user account which was created without a verifier suitable for
12//          the client software version. In this situation, that account's 
13//          password must be reset, in order for the required verifier to
14//          be generated and allow authentication to proceed successfully.
15
     


可以看到,该参数在Oracle 11g和12c以上版本中的解决方案是不同的。参数SQLNET_ALLOWED_LOGON_VERSION在Oracle 12c中已经废弃,而是采用SQLNET.ALLOWED_LOGON_VERSION_CLIENT和SQLNET.ALLOWED_LOGON_VERSION_SERVER代替。所以,碰到该文件时,解决方案为:

对于Oracle 12c以下版本,在文件$ORACLE_HOME/network/admin/sqlnet.ora中加入以下代码:

1SQLNET.ALLOWED_LOGON_VERSION=8
     


对于Oracle 12c及其以上版本,在文件$ORACLE_HOME/network/admin/sqlnet.ora中加入以下代码:

1SQLNET.ALLOWED_LOGON_VERSION_SERVER=8 #控制可以连接到12c数据库的客户端版本(client --->orace 12c db )
2SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8 #控制12c数据库可以连到哪些版本的数据库(orace 12c db  --->其它版本的oracle db),例如:控制通过DB LINK可连接到哪些版本的oracle库。
     


不用重启数据库或者监听,也不用重启应用。

需要注意的是,在Oracle 12c中,虽然在sqlnet.ora加SQLNET.ALLOWED_LOGON_VERSION=8可以解决问题,但由于这个参数在12c已经废弃了,而是用SQLNET.ALLOWED_LOGON_VERSION_CLIENT和SQLNET.ALLOWED_LOGON_VERSION_SERVER代替。如果继续使用该参数,会在告警日志中无穷无尽的报“Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter.”。

& 说明:

有关该错误的更多内容可以参考我的BLOG:http://blog.itpub.net/26736162/viewspace-2131338/

 



本文选自《Oracle程序员面试笔试宝典》,作者:小麦苗


DB宝分享的IT资料:https://mp.weixin.qq.com/s/Iwsy-zkzwgs8nYkcMz29ag
 

● 本文作者:小麦苗,只专注于数据库的技术,更注重技术的运用

● 作者博客地址:http://blog.itpub.net/26736162/abstract/1/

● 本系列题目来源于作者的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

● QQ:646634621  QQ群:230161599、618766405

● 微信:lhrbestxh

● 微信公众号:DB宝

● 提供Oracle OCP、OCM、高可用(rac+dg+ogg)和MySQL最实用的技能培训

● 题目解答若有不当之处,还望各位朋友批评指正,共同进步

长按下图识别二维码或微信扫描下图二维码来关注小麦苗的微信公众号:DB宝,学习最实用的数据库技术。


本文分享自微信公众号 - DB宝(lhrdba)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐