在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下:sql
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.”。oracle
& 说明:app
有关该错误的更多内容能够参考个人BLOG:http://blog.itpub.net/26736162/viewspace-2131338/ide
本文选自《Oracle程序员面试笔试宝典》,做者:小麦苗
DB宝分享的IT资料:https://mp.weixin.qq.com/s/Iwsy-zkzwgs8nYkcMz29ag
● 本文做者:小麦苗,只专一于数据库的技术,更注重技术的运用
● 做者博客地址:http://blog.itpub.net/26736162/abstract/1/
● 本系列题目来源于做者的学习笔记,部分整理自网络,如有侵权或不当之处还请谅解
● 版权全部,欢迎分享本文,转载请保留出处
● QQ:646634621 QQ群:23016159九、618766405
● 微信:lhrbestxh
● 微信公众号:DB宝
● 提供Oracle OCP、OCM、高可用(rac+dg+ogg)和MySQL最实用的技能培训
● 题目解答如有不当之处,还望各位朋友批评指正,共同进步
长按下图识别二维码或微信扫描下图二维码来关注小麦苗的微信公众号:DB宝,学习最实用的数据库技术。
本文分享自微信公众号 - DB宝(lhrdba)。
若有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一块儿分享。