您好,登錄后才能下訂單哦!
本篇內(nèi)容主要講解“怎么解決Oracle低版本客戶端連接報(bào)ORA-28040和ORA-01017錯誤”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“怎么解決Oracle低版本客戶端連接報(bào)ORA-28040和ORA-01017錯誤”吧!
Oracle 11g 的生命周期已經(jīng) ,18c 也已經(jīng)正式發(fā)布,那么在安裝Oracle 18c 之后,如果已低版本的客戶端來連接18c ,就會報(bào)如下兩個錯誤:
ORA-28040: No matching authentication protocol ORA-01017: invalid username/password; logon denied
他們會先后出現(xiàn),當(dāng)解決ORA-28040錯誤后,就會出現(xiàn)ORA-01017錯誤。 這里重現(xiàn)一下錯誤并提供解決方法。
數(shù)據(jù)庫服務(wù)端版本:
[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
根據(jù)MOS文檔 (ID 755605.1),ORA-28040的錯誤需要在Oracle 用戶(非grid用戶)的sqlnet.ora 文件中添加:
SQLNET.ALLOWED_LOGON_VERSION=8
或者使用更高版本的客戶端。
但實(shí)際上,根據(jù)MOS文檔(ID 2111876.1), 在Oracle 12c 以后的版本,
SQLNET.ALLOWED_LOGON_VERSION 參數(shù)已經(jīng)棄用了,應(yīng)該使用以下2個參數(shù)代替:
SQLNET.ALLOWED_LOGON_VERSION_SERVER = n
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = n
這里的n默認(rèn)為11. 第一個參數(shù)是客戶端連接到服務(wù)器的時候啟作用,第二個是做為客戶端去連接其它數(shù)據(jù)庫的時候啟作用。例如創(chuàng)建db link。
其他可選值如下:
12a | for Oracle Database 12c Release 1 (12.1) release 12.1.0.2 or later |
12 | for the critical patch updates CPUOct2012 and later Oracle Database 11g authentication protocols (recommended) |
11 | for Oracle Database 11g authentication protocols (default) |
10 | for Oracle Database 10g authentication protocols |
8 | for 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]$
修改后即可生效,在連接報(bào)錯如下:
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
從錯誤提示看是用戶名或者密碼錯誤,實(shí)際上這里用戶名和密碼沒有問題。 這里的問題是我們配置的sqlnet對之前已經(jīng)存在的帳號并沒有生效,他們還保持在之前的兼容性。
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的版本已經(jīng)加上了10G。 實(shí)際上,現(xiàn)在這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低版本客戶端連接報(bào)ORA-28040和ORA-01017錯誤”有了更深的了解,不妨來實(shí)際操作一番吧!這里是億速云網(wǎng)站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。