暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

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

DB宝 2021-03-23
8641


问题

在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 parameterson both the
8//          client and on the serverto 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 11g12c以上版本中的解决方案是不同的。参数SQLNET_ALLOWED_LOGON_VERSIONOracle 12c中已经废弃,而是采用SQLNET.ALLOWED_LOGON_VERSION_CLIENTSQLNET.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.oraSQLNET.ALLOWED_LOGON_VERSION=8可以解决问题,但由于这个参数在12c已经废弃了,而是用SQLNET.ALLOWED_LOGON_VERSION_CLIENTSQLNET.ALLOWED_LOGON_VERSION_SERVER代替。如果继续使用该参数,会在告警日志中无穷无尽的报Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter.

& 说明:

有关该错误的更多内容可以参考我的BLOGhttp://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宝,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

    评论