iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >怎么解决Oracle低版本客户端连接报ORA-28040和ORA-01017错误
  • 717
分享到

怎么解决Oracle低版本客户端连接报ORA-28040和ORA-01017错误

2024-04-02 19:04:59 717人浏览 八月长安
摘要

本篇内容主要讲解“怎么解决oracle低版本客户端连接报ORA-28040和ORA-01017错误”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么解决Orac

本篇内容主要讲解“怎么解决oracle低版本客户端连接报ORA-28040和ORA-01017错误”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么解决Oracle低版本客户端连接报ORA-28040和ORA-01017错误”吧!

Oracle 11g 的生命周期已经 ,18c 也已经正式发布,那么在安装Oracle 18c 之后,如果已低版本的客户端来连接18c ,就会报如下两个错误:

ORA-28040: No matching authentication protocol
ORA-01017: invalid username/passWord; loGon denied

他们会先后出现,当解决ORA-28040错误后,就会出现ORA-01017错误。 这里重现一下错误并提供解决方法。

1. 问题重现

数据库服务端版本:

[oracle@www.cndba.cn dbs]$ sqlplus / as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Mon Aug 27 06:42:49 2018
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

客户端11.2.0.4,连接正常:

C:/Users/Dave>sqlplus system/oracle@192.168.56.168:1522/dave
SQL*Plus: Release 11.2.0.4.0 Production on Fri Aug 31 09:24:53 2018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
SQL>

但是11.2.0.1不行:

D:/instantclient_11>sqlplus system/oracle@192.168.56.168:1522/dave
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 31 10:51:52 2018
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-28040: No matching authentication protocol
2. 处理ORA-28040错误

根据MOS文档 (ID 755605.1),ORA-28040的错误需要在Oracle 用户(非grid用户)的sqlnet.ora 文件中添加:
SQLNET.ALLOWED_LOGON_VERSION=8
或者使用更高版本的客户端。

但实际上,根据MOS文档(ID 2111876.1), 在Oracle 12c 以后的版本,
SQLNET.ALLOWED_LOGON_VERSION 参数已经弃用了,应该使用以下2个参数代替:
SQLNET.ALLOWED_LOGON_VERSION_SERVER = n
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = n

这里的n默认为11. 第一个参数是客户端连接到服务器的时候启作用,第二个是做为客户端去连接其它数据库的时候启作用。例如创建db link。

其他可选值如下:



12afor Oracle Database 12c Release 1 (12.1) release 12.1.0.2 or later
12for the critical patch updates CPUOct2012 and later Oracle Database 11g authentication protocols (recommended)
11for Oracle Database 11g authentication protocols (default)
10for Oracle Database 10g authentication protocols
8for Oracle8i authentication protocol

这里修改如下:

[oracle@www.cndba.cn admin]$ cat sqlnet.ora 
# sqlnet.ora Network Configuration File: /u01/app/oracle/product/18.3.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
[oracle@www.cndba.cn admin]$

修改后即可生效,在连接报错如下:

C:/Users/Dave>sqlplus system/oracle@192.168.56.168:1522/dave
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 31 14:49:53 2018
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
3. 处理ORA-01017错误

从错误提示看是用户名或者密码错误,实际上这里用户名和密码没有问题。 这里的问题是我们配置的sqlnet对之前已经存在的帐号并没有生效,他们还保持在之前的兼容性。

SQL> set pages 100
SQL> select username,password_versions from dba_users;
USERNAME               PASSWORD_VERSIONS
------------------------------ ----------------------------------
SYS                       11G 12C
SYSTEM                   11G 12C
OUTLN                   11G 12C
SYS$UMF                11G 12C
DBSNMP                   11G 12C
APPQOSSYS               11G 12C
DBSFWUSER               11G 12C
GGSYS                   11G 12C

这里的解决方法就是对用户修改下密码:

SQL> alter user sys identified by oracle;
User altered.
SQL> alter user system identified by oracle;
User altered.

查看密码版本:

SQL> select username,password_versions from dba_users;
USERNAME               PASSWORD_VERSIONS
------------------------------ ----------------------------------
SYS                         11G 12C
SYSTEM                   10G 11G 12C

注意这里虽然SYS并没有改变,但是SYSTEM的版本已经加上了10G。 实际上,现在这2个用户都可以连接了:

C:/Users/Dave>sqlplus system/oracle@192.168.56.168:1522/dave
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 31 14:58:35 2018
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
连接到:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
SQL>
C:/Users/Dave>sqlplus sys/oracle@192.168.56.168:1522/dave as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期五 8月 31 14:58:54 2018
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
连接到:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
SQL>

到此,相信大家对“怎么解决Oracle低版本客户端连接报ORA-28040和ORA-01017错误”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

您可能感兴趣的文档:

--结束END--

本文标题: 怎么解决Oracle低版本客户端连接报ORA-28040和ORA-01017错误

本文链接: https://www.lsjlt.com/news/63074.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作