阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Oracle 11g与112c中ORA-28040 错误解决

219次阅读
没有评论

共计 3488 个字符,预计需要花费 9 分钟才能阅读完成。

今天遇到一个连接 192.168.56.102 这个库报错
Java.sql.SQLException: ORA-28040: No matching authentication protocol

Oracle 12C 下查询此报错
oralce:/oracle/db/app/12.1.0/db/network/admin> 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
 //          be generated and allow authentication to proceed successfully.

Oracle 11g 下查询报错
oracle@oralce:/oracle/app/oracle/product/11.2.0/db/network/admin$ 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.

很明显,在 11G 和 12C 下的解决方案是不一样的。
在 11G 中的参数是 SQLNET_ALLOWED_LOGON_VERSION;
而在 12C 中的参数是 SQLNET.ALLOWED_LOGON_VERSION_SERVER 和 SQLNET.ALLOWED_LOGON_VERSION_CLIENT

因为我的环境是 12C 的,所以我使用 12C 的解决方式,设置以上 2 个参数。
因为我的环境上没有 sqlnet.ora 文件,所以新建了一个
 vi sqlnet.ora
 SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
 SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8

然后重启监听
lsnrctl reload

LSNRCTL for IBM/AIX RISC System/6000: Version 12.1.0.2.0 – Production on 13-JUN-2017 11:42:52

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
 TNS-01190: The user is not authorized to execute the requested listener command
 oralce:/oracle/db/app/12.1.0/db/network/admin>
 oralce:/oracle/db/app/12.1.0/db/network/admin>
 oralce:/oracle/db/app/12.1.0/db/network/admin> lsnrctl status

LSNRCTL for IBM/AIX RISC System/6000: Version 12.1.0.2.0 – Production on 13-JUN-2017 11:42:57

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
 STATUS of the LISTENER
 ————————
 Alias                    LISTENER
 Version                  TNSLSNR for IBM/AIX RISC System/6000: Version 12.1.0.2.0 – Production
 Start Date                09-JUN-2017 22:46:07
 Uptime                    3 days 12 hr. 56 min. 50 sec
 Trace Level              off
 Security                  ON: Local OS Authentication
 SNMP                      OFF
 Listener Parameter File  /oracle/gridhome/app/12.1.0/grid/network/admin/listener.ora
 Listener Log File        /oracle/grid/diag/tnslsnr/oralce/listener/alert/log.xml
 Listening Endpoints Summary…
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=135.10.89.101)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=135.10.89.103)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=oralce)(PORT=5500))(Security=(my_wallet_directory=/oracle/db/app/12.1.0/db/admin/zykgdb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
 Services Summary…
 Service “+ASM” has 1 instance(s).
  Instance “+ASM2”, status READY, has 1 handler(s) for this service…
 Service “zykgdb” has 1 instance(s).
  Instance “zykgdb2”, status READY, has 1 handler(s) for this service…
 Service “zykgdbXDB” has 1 instance(s).
  Instance “zykgdb2”, status READY, has 1 handler(s) for this service…
 The command completed successfully

如果是 RAC,那么就需要在 2 个节点都设置 sqlnet.ora 文件。

更多 Oracle 相关信息见 Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2017-06/145037.htm

 

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计3488字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中