oracle ORA-28040: 没有匹配的身份验证协议

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34398101/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 01:01:18  来源:igfitidea点击:

ORA-28040: No matching authentication protocol

oraclejdbc

提问by Deepan

I am facing this issue even after following the below settings.

即使按照以下设置,我也面临这个问题。

  1. Replacing ojdbc14.jarwith ojdbc6.jar[also tried ojdbc5.jar]

  2. Added "SQLNET.ALLOWED_LOGON_VERSION_SERVER=8" to sqlnet.ora file[under network/admin folder].

  1. 替换ojdbc14.jarojdbc6.jar[也尝试过ojdbc5.jar]

  2. SQLNET.ALLOWED_LOGON_VERSION_SERVER=8向 sqlnet.ora 文件[在网络/管理文件夹下]添加了“ ”。

This is happening after upgrading the DB from 11g to 12c.

这是在将数据库从 11g 升级到 12c 之后发生的。

回答by Jon Heller

JDBC drivers have both a Java version and an Oracle version. The versions are usually correlated, but it's possible for an ojdbc14.jar to support a later version of Oracle than a ojdbc6.jar. Make sure you are using the latest version of ojdbc6.jar.

JDBC 驱动程序有 Java 版本和 Oracle 版本。这些版本通常是相关的,但 ojdbc14.jar 可能支持比 ojdbc6.jar 更高的 Oracle 版本。确保您使用的是最新版本的 ojdbc6.jar。

Run this command to see which version of Oracle the driver was built for:

运行此命令以查看驱动程序是为哪个版本的 Oracle 构建的:

>java -jar ojdbc6.jar -getversion
Oracle 11.2.0.3.0 JDBC 4.0 compiled with JDK6 on Thu_Jun_28_00:38:25_PDT_2012
#Default Connection Properties Resource
#Mon Dec 21 12:38:41 CST 2015

For SQLNET.ORA changes, to be safe you should restart both the listener and the database. This sounds extreme, but there are some parameters that require restarting the database.

对于 SQLNET.ORA 更改,为了安全起见,您应该重新启动侦听器和数据库。这听起来很极端,但是有一些参数需要重新启动数据库

Also make sure that you are modifying all relevant SQLNET.ORA files. If the database's Oracle home is different than the listener's Oracle home you should modify both.

还要确保您正在修改所有相关的 SQLNET.ORA 文件。如果数据库的 Oracle 主目录与侦听器的 Oracle 主目录不同,您应该同时修改两者。

回答by Werner Bisschoff

ORA-28040: No matching authentication protocol

I faced a similar issue when trying to connect a

我在尝试连接时遇到了类似的问题

32-bit Oracle 11g Clientto a 64-bit Oracle 12c Server

32 位 Oracle 11g 客户端到64 位 Oracle 12c 服务器

I then proceeded to add the following to sqlnet.ora

然后我继续将以下内容添加到sqlnet.ora

SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8

I then experienced the following error

然后我遇到了以下错误

ORA-01017: invalid username/password: logon denied

Adding the following to the Client sqlnet.oraas well as the Server, I was able to connect an old version of Toad and PL/SQL to the new 12c Server.

将以下内容添加到客户端sqlnet.ora以及服务器,我能够将旧版本的 Toad 和 PL/SQL 连接到新的 12c 服务器。

SQLNET.AUTHENTICATION_SERVICES = (NONE)

回答by abarisone

First of all the difference between ojdbc driver's versions depends on the version of the JDK you use drivers with. So ojbdc14is suitable for JDK version 1.4, ojdbc5for JDK 1.5, and so on.

首先,ojdbc 驱动程序版本之间的差异取决于您使用驱动程序的 JDK 版本。Soojbdc14适用于 JDK 1.4 版,ojdbc5适用于 JDK 1.5 等。

I'm currently using ojdbc7.jarwith a 12c database version since my environment uses a JDK 1.7, so upgrade this first.

我目前使用ojdbc7.jar12c 数据库版本,因为我的环境使用 JDK 1.7,所以先升级它。

Having said that, in the Parameters for the sqlnet.ora Filefor Oracle 12c release page you can read:

话虽如此,在Oracle 12c 发布页面的 sqlnet.ora 文件参数中,您可以阅读:

Purpose

To set the minimum authentication protocol allowed for clients, and when a server is acting as a client, such as connecting over a database link, when connecting to Oracle Database instances.

Usage Notes

The term VERSION in the parameter name refers to the version of the authentication protocol, not the Oracle Database release.

If the version does not meet or exceed the value defined by this parameter, then authentication fails with an ORA-28040: No matching authentication protocol error.

目的

设置客户端允许的最低身份验证协议,以及当服务器充当客户端时(例如通过数据库链接进行连接),当连接到 Oracle 数据库实例时。

使用说明

参数名称中的术语 VERSION 是指身份验证协议的版本,而不是 Oracle 数据库版本。

如果版本不满足或超过此参数定义的值,则身份验证失败并显示 ORA-28040:无匹配身份验证协议错误。

The default for this property is 11.

此属性的默认值为 11。

Allowed values are 8,10,11,12 and 12a.

允许的值为 8、10、11、12 和 12a。

The recommended value is 12. Try this out.

推荐值是 12。试试这个。

Moreover there is a useful and interesting solution Database Administrators Stack Exchange

此外,还有一个有用且有趣的解决方案Database Administrators Stack Exchange

回答by Jean de Lavarene

You should use the latest JDBC thin driver (12.1.0.2) and JDK8. With this configuration your driver will support the latest version of the database password verifier and your issue should be resolved.

您应该使用最新的 JDBC 瘦驱动程序 (12.1.0.2) 和 JDK8。使用此配置,您的驱动程序将支持最新版本的数据库密码验证程序,您的问题应该得到解决。