温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》
  • 首页 > 
  • 教程 > 
  • 数据库 > 
  • 【故障处理】ORA-28040: No matching authentication protocol

【故障处理】ORA-28040: No matching authentication protocol

发布时间:2020-05-31 23:35:56 来源:网络 阅读:1695 作者:小麦苗best 栏目:数据库

【故障处理】ORA-28040: No matching authentication protocol

1.1  BLOG文档结构图

【故障处理】ORA-28040: No matching authentication protocol 

1.2  前言部分

1.2.1  导读和注意事项

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~

告警日志中频繁出现Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameterORA-28040: No matching authentication protocol错误,9i的客户端连接到12c高版本的解决方案

Windows下使用oerr命令

Tips

本文在itpubhttp://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和微信公众号(xiaomaimiaolhr有同步更新

文章中用到的所有代码相关软件相关资料及本文的pdf版本都请前往小麦苗的云盘下载小麦苗的云盘地址见:http://blog.itpub.net/26736162/viewspace-1624453/

若网页文章代码格式有错乱,下载pdf格式的文档来阅读

本篇BLOG,代码输出部分一般放在一行一列的表格中。

本文如有错误或不完善的地方请大家多多指正,ITPUB留言或QQ皆可,您的批评指正是我写作的最大动力。

1.3  故障分析及解决过程

1.3.1  故障环境介绍

 

项目

source db

db 类型

RAC

db version

12.1.0.2.0

db 存储

ASM

OS版本及kernel版本

SuSE Linux Enterprise Server(SLES 1164

 

1.3.2  故障发生现象及报错信息

告警日志中频繁出现Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter

JDBC连接Oracle12c报如下错误:

Caused by: java.sql.SQLException: ORA-28040: No matching authentication protocol

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)

        at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:294)

        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:357)

        at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:441)

        at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165)

        at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)

        at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)

        at java.sql.DriverManager.getConnection(DriverManager.java:582)

        at java.sql.DriverManager.getConnection(DriverManager.java:154)

 

 

或者使用9i的客户端去连接12c的数据库就会报ORA-28040: No matching authentication protocol这个错误。

1.3.3  故障分析及解决过程

使用oerr命令来查看,在Oracle 11g下:

[oracle@orcltest ~]$ 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.

[oracle@orcltest ~]$

 

12c下:

oracle@HQsPSL-PSCV-R02:/oracle/app/oracle> oerr ora 28040

28040, 0000, "No matching authentication protocol"

// *Cause:  There was no acceptable authentication protocol for

//          either client or server.

// *Action: The administrator should set the values of the

//          SQLNET.ALLOWED_LOGON_VERSION_SERVER and

//          SQLNET.ALLOWED_LOGON_VERSION_CLIENT parameters, on both the

//          client and on the server, to values that match the minimum

//          version software supported in the system.

//          This error is also raised when the client is authenticating to

//          a user account which was created without a verifier suitable for

//          the client software version. In this situation, that account's

//          password must be reset, in order for the required verifier to

 

可以看到,该参数在11g和12c下的解决方案是不同的。

查询了一下参数SQLNET.ALLOWED_LOGON_VERSION发现该参数在12c中以废弃,而是采用SQLNET.ALLOWED_LOGON_VERSION_CLIENT和SQLNET.ALLOWED_LOGON_VERSION_SERVER代替

客户说是之前碰到了ORA-28040: No matching authentication protocol的错误才加上该参数的。

解决:在Oracle用户(不是grid用户)下,将$ORACLE_HOME/network/admin/sqlnet.ora文件原来的SQLNET.ALLOWED_LOGON_VERSION=8注释掉(如果没有sqlnet.ora文件,那么就创建一个),修改为如下的行:

SQLNET.ALLOWED_LOGON_VERSION_SERVER=8

SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8

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

区别如下:

SQLNET.ALLOWED_LOGON_VERSION_SERVER:控制可以连接到12c数据库的客户端版本(client --->orace 12c db

SQLNET.ALLOWED_LOGON_VERSION_CLIENT:控制12c数据库可以连到哪些版本的数据库(orace 12c db  --->其它版本的oracle db),例如:控制通过DB LINK可连接到哪些版本的oracle库。

所以,该案例中主要起作用的是需要配置SQLNET.ALLOWED_LOGON_VERSION_SERVER

特别需要注意:

1)如果是RAC,因为RAC是使用grid的监听器,因此很多人以为是在“/u02/app/12.1.0/grid/network/admin/sqlnet.ora” 加“SQLNET.ALLOWED_LOGON_VERSION_SERVER=8”,其实这是错的,而是仍然在$ORACLE_HOME/network/admin/sqlnet.ora加“SQLNET.ALLOWED_LOGON_VERSION_SERVER=8

2上面所说的版本,是指dba_users.password_versions的版本。

 

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

【故障处理】ORA-28040: No matching authentication protocol 

 

另外,对于JDBC的报错也可以下载支持oracle12c的jdbc驱动jar链接:http://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html

注:本地jdk版本为1.6,则下载ojdbc6.jarjdk版本为1.7,则下载ojdbc7.jar

如下图所示:

【故障处理】ORA-28040: No matching authentication protocol 

也可以在在ORACLE安装目录lib库目录下载ojdbc7.jar包,然后把这个ojdbc7.jar加载到开发环境中

[oracle@orcltest dbhome_1]$ ll $ORACLE_HOME/jdbc/lib/ojdbc*

-rw-r--r-- 1 oracle oinstall 3447295 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc5dms_g.jar

-rw-r--r-- 1 oracle oinstall 2617019 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc5dms.jar

-rw-r--r-- 1 oracle oinstall 3425922 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc5_g.jar

-rw-r--r-- 1 oracle oinstall 2095661 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc5.jar

-rw-r--r-- 1 oracle oinstall 4486070 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc6dms_g.jar

-rw-r--r-- 1 oracle oinstall 3327656 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc6dms.jar

-rw-r--r-- 1 oracle oinstall 4462913 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc6_g.jar

-rw-r--r-- 1 oracle oinstall 2714016 Aug 23  2011 /u02/app/oracle/product/11.2.0/dbhome_1/jdbc/lib/ojdbc6.jar

[oracle@orcltest dbhome_1]$

 

 

1.3.4  官方文档及MOS的解释

有关该问题,MOS上有很多文档可以供参考。

http://docs.oracle.com/database/121/UPGRD/deprecated.htm#UPGRD60010

【故障处理】ORA-28040: No matching authentication protocol【故障处理】ORA-28040: No matching authentication protocol


1.3.4.1  12c中弃用和不支持的特性

https://docs.oracle.com/database/121/UPGRD/deprecated.htm#BABEDDGA

 

【故障处理】ORA-28040: No matching authentication protocol

 

1.4  ORA-28040故障模拟

小麦苗有7、89101112c的数据库,所以顺便模拟一下这个错误。

服务端为12c的数据库,客户端为9i,我们在客户端尝试连接12c的数据库:

Microsoft Windows [版本 10.0.10240]

(c) 2015 Microsoft Corporation. All rights reserved.

 

D:\Users\xiaomaimiao>set ORACLE_HOME=D:\Program_files\u01\app\oracle\product\ora92

 

D:\Users\xiaomaimiao>set ora

ORACLE10G=D:\Program files\app\oracle\product\10.2.0\db_1

ORACLE11G=D:\Program_files\u01\app\oracle\product\11.2.0.1\dbhome_1

ORACLE8I=D:\Program files\app\oracle\product\ora8i

ORACLE_HOME=D:\Program_files\u01\app\oracle\product\ora92

 

D:\Users\xiaomaimiao>cd %ORACLE_HOME%/bin

 

D:\Program_files\u01\app\oracle\product\ora92\bin>sqlplus -v

 

SQL*Plus: Release 9.2.0.1.0 - Production

 

 

D:\Program_files\u01\app\oracle\product\ora92\bin>tnsping ora12c

 

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 19-DEC-2016 17:44:59

 

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

 

Used parameter files:

D:\Program_files\u01\app\oracle\product\ora92\network\admin\sqlnet.ora

 

 

Used TNSNAMES adapter to resolve the alias

Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.59.128)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = lhrdb12c)))

OK (10 msec)

 

D:\Program_files\u01\app\oracle\product\ora92\bin>sqlplus lhr/lhr@ora12c

 

SQL*Plus: Release 9.2.0.1.0 - Production on Mon Dec 19 17:45:07 2016

 

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

 

ERROR:

ORA-28040: No matching authentication protocol

 

 

Enter user-name:

 

 

可以看到报ORA-28040: No matching authentication protocol的错误。

我们服务端的$ORACLE_HOME/network/admin/sqlnet.ora添加如下的行:

SQLNET.ALLOWED_LOGON_VERSION_SERVER=8

SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8

重新尝试连接:

D:\Program_files\u01\app\oracle\product\ora92\bin>sqlplus lhr/lhr@ora12c

 

SQL*Plus: Release 9.2.0.1.0 - Production on Mon Dec 19 17:51:54 2016

 

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

 

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

 

SQL>

 

可以看到已经正常连接了。

如果将服务端的$ORACLE_HOME/network/admin/sqlnet.ora中的SQLNET.ALLOWED_LOGON_VERSION_SERVER=8和SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8注释掉,而换成SQLNET.ALLOWED_LOGON_VERSION=8,如下:

SQLNET.ALLOWED_LOGON_VERSION=8

# SQLNET.ALLOWED_LOGON_VERSION_SERVER=8

# SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8

 

尝试连接数据库:

D:\Program_files\u01\app\oracle\product\ora92\bin>sqlplus lhr/lhr@ora12c

 

SQL*Plus: Release 9.2.0.1.0 - Production on Mon Dec 19 17:56:29 2016

 

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

 

 

Connected to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

 

SQL>

 

可以正常连接,但是查看告警日志的时候有如下的输出:Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter. 而且,每连接一次数据库就输出一行该数据,和我们之前分析的问题是一致的。

1.5  Windows下使用oerr命令

由于客户的环境是12c Linux的,而自己没有12cLinux环境,安装较为麻烦,索性就安装了一个Windows版本的。结果执行oerr ora 的时候报错了:

C:\Users\xiaomaimiao>oerr ora 10041

oerr: Cannot access the message file E:\app\oracle\product\12.1.0\dbhome_1\rdbms\mesg\oraus.msg

No such file or directory

 

C:\Users\xiaomaimiao>oerr ora 01555

oerr: Cannot access the message file E:\app\oracle\product\12.1.0\dbhome_1\rdbms\mesg\oraus.msg

No such file or directory

 

 

经查看报错的文件(E:\app\oracle\product\12.1.0\dbhome_1\rdbms\mesg\oraus.msg)的确没有,而且任何*.msg文件都不存在,那就从12c的Linux下把相关的$ORACLE_HOME/rdbms/mesg/*.msg文件都拷贝到Windows的环境下:

[oracle@orcltest mesg]$ pwd

/u02/app/oracle/product/11.2.0/dbhome_1/rdbms/mesg

[oracle@orcltest mesg]$ ll *.msg          

-rw-r--r-- 1 oracle oinstall    4070 Jul 25  2008 amduus.msg

-rw-r--r-- 1 oracle oinstall    6298 Apr 14  2011 asmcmdus.msg

-rw-r--r-- 1 oracle oinstall    5886 Aug  3  2007 dbvus.msg

-rw-r--r-- 1 oracle oinstall   23309 Jan 28  2010 dgmus.msg

-rw-r--r-- 1 oracle oinstall  175881 May 11  2011 diaus.msg

-rw-r--r-- 1 oracle oinstall   49483 Jan 28  2010 expus.msg

-rw-r--r-- 1 oracle oinstall   15148 Nov  8  2009 gimus.msg

-rw-r--r-- 1 oracle oinstall   47609 Feb 18  2009 impus.msg

-rw-r--r-- 1 oracle oinstall    3585 Nov  3  2009 kfedus.msg

-rw-r--r-- 1 oracle oinstall    3457 Nov  6  2008 kfodus.msg

-rw-r--r-- 1 oracle oinstall    1792 Mar  1  2009 kfsgus.msg

-rw-r--r-- 1 oracle oinstall   26775 Nov  1  1999 kgpus.msg

-rw-r--r-- 1 oracle oinstall    3113 Sep  3  1997 kopus.msg

-rw-r--r-- 1 oracle oinstall   72528 Sep 17  2011 kupus.msg

-rw-r--r-- 1 oracle oinstall    4651 Sep  3  1997 lcdus.msg

-rw-r--r-- 1 oracle oinstall   22043 Nov 27  2006 nidus.msg

-rw-r--r-- 1 oracle oinstall  129827 May  5  2011 ocius.msg

-rw-r--r-- 1 oracle oinstall     734 Mar  8  2010 opwus.msg

-rw-r--r-- 1 oracle oinstall 4922454 Sep 17  2011 oraus.msg

-rw-r--r-- 1 oracle oinstall  178311 Aug 25  2009 qsmus.msg

-rw-r--r-- 1 oracle oinstall  391272 Sep 17  2011 rmanus.msg

-rw-r--r-- 1 oracle oinstall   40078 Jul 30  2001 sbtus.msg

-rw-r--r-- 1 oracle oinstall  123863 May 22  2010 smgus.msg

-rw-r--r-- 1 oracle oinstall   20433 Jan 13  2010 udeus.msg

-rw-r--r-- 1 oracle oinstall   20572 Jan 13  2010 udius.msg

-rw-r--r-- 1 oracle oinstall  143025 Jul 27  2009 ulus.msg

[oracle@orcltest mesg]$

 

然后执行就OK了。

C:\Users\xiaomaimiao>oerr ora 01555

01555, 00000, "snapshot too old: rollback segment number %s with name \"%s\" too small"

// *Cause: rollback records needed by a reader for consistent read are

//         overwritten by other writers

// *Action: If in Automatic Undo Management mode, increase undo_retention

//          setting. Otherwise, use larger rollback segments

 

 

About Me

...............................................................................................................................

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

本文在itpub(http://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和个人微信公众号(xiaomaimiaolhr)上有同步更新

本文itpub地址:http://blog.itpub.net/26736162/viewspace-2131338/

本文博客园地址:http://www.cnblogs.com/lhrbest/p/6219687.html

本文pdf小麦苗云盘地址:http://blog.itpub.net/26736162/viewspace-1624453/

● QQ群:230161599     微信群:私聊

联系我请加QQ好友(642808185),注明添加缘由

2016-12-19 15:00 ~ 2016-12-25 19:00农行完成

文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

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

...............................................................................................................................

手机长按下图识别二维码或微信客户端扫描下边的二维码来关注小麦苗的微信公众号:xiaomaimiaolhr,免费学习最实用的数据库技术。

【故障处理】ORA-28040: No matching authentication protocol

 

【故障处理】ORA-28040: No matching authentication protocolcdn.qqmail.com/zh_CN/htmledition/p_w_picpaths/function/qm_open/ico_mailme_02.png">

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI