在Oracle中,形成「ORA-28040: No matching authentication protocol」錯誤的緣由是什麼?程序員
該錯誤是因爲SQL*Plus的版本和數據庫服務器的版本不一致致使的,使用oerr命令來查看,在Oracle 11g下:面試
1[oracle@orcltest ~]$ oerr ora 28040
228040, 0000, "No matching authentication protocol"
3// *Cause: No acceptible authentication protocol for both client and server
4// *Action: Administrator should set SQLNET_ALLOWED_LOGON_VERSION parameter
5// on both client and servers to values that matches the minimum
6// version supported in the system.
7[oracle@orcltest ~]$
12c下:sql
1oracle@HQsPSL-R02:/oracle/app/oracle> oerr ora 28040
228040, 0000, "No matching authentication protocol"
3// *Cause: There was no acceptable authentication protocol for
4// either client or server.
5// *Action: The administrator should set the values of the
6// SQLNET.ALLOWED_LOGON_VERSION_SERVER and
7// SQLNET.ALLOWED_LOGON_VERSION_CLIENT parameters, on both the
8// client and on the server, to values that match the minimum
9// version software supported in the system.
10// This error is also raised when the client is authenticating to
11// a user account which was created without a verifier suitable for
12// the client software version. In this situation, that account's
13// password must be reset, in order for the required verifier to
14// be generated and allow authentication to proceed successfully.
15
能夠看到,該參數在Oracle 11g和12c以上版本中的解決方案是不一樣的。參數SQLNET_ALLOWED_LOGON_VERSION在Oracle 12c中已經廢棄,而是採用SQLNET.ALLOWED_LOGON_VERSION_CLIENT和SQLNET.ALLOWED_LOGON_VERSION_SERVER代替。因此,碰到該文件時,解決方案爲:數據庫
對於Oracle 12c如下版本,在文件$ORACLE_HOME/network/admin/sqlnet.ora中加入如下代碼:服務器
1SQLNET.ALLOWED_LOGON_VERSION=8
對於Oracle 12c及其以上版本,在文件$ORACLE_HOME/network/admin/sqlnet.ora中加入如下代碼:微信
1SQLNET.ALLOWED_LOGON_VERSION_SERVER=8 #控制能夠鏈接到12c數據庫的客戶端版本(client --->orace 12c db )
2SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8 #控制12c數據庫能夠連到哪些版本的數據庫(orace 12c db --->其它版本的oracle db),例如:控制經過DB LINK可鏈接到哪些版本的oracle庫。
不用重啓數據庫或者監聽,也不用重啓應用。網絡
須要注意的是,在Oracle 12c中,雖然在sqlnet.ora加SQLNET.ALLOWED_LOGON_VERSION=8能夠解決問題,但因爲這個參數在12c已經廢棄了,而是用SQLNET.ALLOWED_LOGON_VERSION_CLIENT和SQLNET.ALLOWED_LOGON_VERSION_SERVER代替。若是繼續使用該參數,會在告警日誌中無窮無盡的報「Using deprecated SQLNET.ALLOWED_LOGON_VERSION parameter.」。oracle
& 說明:app
有關該錯誤的更多內容能夠參考個人BLOG:http://blog.itpub.net/26736162/viewspace-2131338/ide
本文選自《Oracle程序員面試筆試寶典》,做者:小麥苗
DB寶分享的IT資料:https://mp.weixin.qq.com/s/Iwsy-zkzwgs8nYkcMz29ag
● 本文做者:小麥苗,只專一於數據庫的技術,更注重技術的運用
● 做者博客地址:http://blog.itpub.net/26736162/abstract/1/
● 本系列題目來源於做者的學習筆記,部分整理自網絡,如有侵權或不當之處還請諒解
● 版權全部,歡迎分享本文,轉載請保留出處
● QQ:646634621 QQ羣:23016159九、618766405
● 微信:lhrbestxh
● 微信公衆號:DB寶
● 提供Oracle OCP、OCM、高可用(rac+dg+ogg)和MySQL最實用的技能培訓
● 題目解答如有不當之處,還望各位朋友批評指正,共同進步
長按下圖識別二維碼或微信掃描下圖二維碼來關注小麥苗的微信公衆號:DB寶,學習最實用的數據庫技術。
本文分享自微信公衆號 - DB寶(lhrdba)。
若有侵權,請聯繫 support@oschina.cn 刪除。
本文參與「OSC源創計劃」,歡迎正在閱讀的你也加入,一塊兒分享。