oracle ORA-28040: 没有匹配的身份验证协议异常
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24100117/
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
ORA-28040: No matching authentication protocol exception
提问by Aman Adhikari
I am trying to connect my grails project to Oracle databse(Oracle 12c) in windows(8) system. However, whenever I run my application I get following exception :
我正在尝试将我的 grails 项目连接到windows(8) 系统中的Oracle 数据库(Oracle 12c)。但是,每当我运行我的应用程序时,都会出现以下异常:
Caused by: org.apache.commons.dbcp.SQLNestedException:
Cannot create PoolableConnectionFactory (ORA-28040:
No matching authentication protocol)
Caused by:
java.sql.SQLException: ORA-28040:
No matching authentication protocol
According to internet suggestion I also tried editing my *.ora
file but it is not working.
根据互联网建议,我也尝试编辑我的 *.ora
文件,但它不起作用。
I added following snippet in sqlnet.ora
file :
我在sqlnet.ora
文件中添加了以下代码段:
SQLNET.ALLOWED_LOGON_VERSION=10
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=10
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
Here i tried assigning (10,11,12) but neither of them is working.
在这里,我尝试分配 (10,11,12) 但它们都不起作用。
Can anyone please help me with this ?
任何人都可以帮我解决这个问题吗?
回答by Aman Adhikari
I deleted the ojdbc14.jarfile and used ojdbc6.jarinstead and it worked for me
我删除了ojdbc14.jar文件并使用ojdbc6.jar代替,它对我有用
回答by Simon
Here is some text I found at experts-exchange:
这是我在专家交流中找到的一些文字:
Bug 14575666
In 12.1, the default value for the SQLNET.ALLOWED_LOGON_VERSION parameter has been updated to 11. This means that database clients using pre-11g JDBC thin drivers cannot authenticate to 12.1 database servers unless theSQLNET.ALLOWED_LOGON_VERSION parameter is set to the old default of 8.
This will cause a 10.2.0.5 Oracle RAC database creation using DBCA to fail with the ORA-28040: No matching authentication protocol error in 12.1 Oracle ASM and Oracle Grid Infrastructure environments.
Workaround: Set SQLNET.ALLOWED_LOGON_VERSION=8 in the oracle/network/admin/sqlnet.ora file.
错误 14575666
在 12.1 中,SQLNET.ALLOWED_LOGON_VERSION 参数的默认值已更新为 11。这意味着使用 11g 之前的 JDBC 瘦驱动程序的数据库客户端无法对 12.1 数据库服务器进行身份验证,除非 SQLNET.ALLOWED_LOGON_VERSION 参数设置为旧的默认值 8。
这将导致使用 DBCA 创建 10.2.0.5 Oracle RAC 数据库失败并出现 ORA-28040:在 12.1 Oracle ASM 和 Oracle Grid Infrastructure 环境中没有匹配的身份验证协议错误。
解决方法:在 oracle/network/admin/sqlnet.ora 文件中设置 SQLNET.ALLOWED_LOGON_VERSION=8。
回答by CodeArt
This except for adding the following to sqlnet.ora
这除了将以下内容添加到 sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
If you get "ORA-01017: invalid username/password; logon denied" error, then you need to re-create your password.
如果您收到“ORA-01017:无效的用户名/密码;登录被拒绝”错误,那么您需要重新创建您的密码。
回答by Shardendu
I resolved this issue by using ojdbc8.jar. Oracle 12c is compatible with ojdbc8.jar
我通过使用 ojdbc8.jar 解决了这个问题。Oracle 12c 兼容 ojdbc8.jar
回答by Werner Bisschoff
Except for adding the following to sqlnet.ora
除了在sqlnet.ora添加以下内容
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
I also added the following to both the Client and Server, which resolved my issue
我还在客户端和服务器中添加了以下内容,这解决了我的问题
SQLNET.AUTHENTICATION_SERVICES = (NONE)
Also see post ORA-28040: No matching authentication protocol
另请参阅帖子 ORA-28040:没有匹配的身份验证协议
回答by Sandesh Gupta
I was using eclipse and after trying all the other answers it didn't work for me.
In the end, what worked for me was moving the ojdb7.jar
to top in the Build Path. This occurs when multiple jars have conflicting same classes.
我正在使用 eclipse,在尝试了所有其他答案后,它对我不起作用。最后,对我有用的ojdb7.jar
是将构建路径移动到顶部。当多个 jar 具有冲突的相同类时会发生这种情况。
- Select project in
Project Explorer
- Right click on
Project -> Build Path -> Configure Build Path
- Go to
Order and Export
tab and selectojdbc.jar
- Click button
TOP
to move it to top
- 选择项目在
Project Explorer
- 右键单击
Project -> Build Path -> Configure Build Path
- 转到
Order and Export
选项卡并选择ojdbc.jar
- 单击按钮
TOP
将其移至顶部
回答by Birhan Nega
Adding
添加
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
is the perfect solution sql.ora directory ..\product\12.1.0\dbhome_1\NETWORK\ADMIN
完美解决sql.ora目录..\product\12.1.0\dbhome_1\NETWORK\ADMIN
回答by Arumugaraj Kuthalingam
My Initial error is : ORA-28040: No matching authentication protocol exception
我的初始错误是:ORA-28040:没有匹配的身份验证协议异常
My DB version is 12.2 (Solaris) and client version is 11.2 ( windows). I have added below in both server and client sqlnet.ora
我的数据库版本是 12.2 (Solaris),客户端版本是 11.2 (windows)。我在服务器和客户端 sqlnet.ora 中添加了以下内容
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8 SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8 SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
while connecting, I have got invalid username and password hence I have recreated the password ( same password ) in database which is resolved my issue.
连接时,我的用户名和密码无效,因此我在数据库中重新创建了密码(相同的密码),这解决了我的问题。
回答by user435421
While for most cases replacing ojdbc driver jar will be the solution, my case was different.
虽然在大多数情况下替换 ojdbc 驱动程序 jar 将是解决方案,但我的情况有所不同。
If you are certain you are using correct ojdbc driver. Double check if you are actually connecting to the database you are thinking you are. In my case jdbc configuration (in Tomcat/conf) was pointing to different database that had different Oracle version.
如果您确定您使用的是正确的 ojdbc 驱动程序。仔细检查您是否真正连接到您认为的数据库。在我的情况下,jdbc 配置(在 Tomcat/conf 中)指向具有不同 Oracle 版本的不同数据库。
回答by Ali Mhamad Slim
just install ojdbc-full, That contains the 12.1.0.1 release.
只需安装 ojdbc-full,其中包含 12.1.0.1 版本。