溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

PLSQL通過Oracle 11g客戶端連接Oracle 12c服務器錯誤 ORA-28040

發(fā)布時間:2020-08-11 21:55:09 來源:ITPUB博客 閱讀:505 作者:eric0435 欄目:關系型數(shù)據(jù)庫

PLSQL通過Oracle 11g客戶端連接Oracle 12c服務器錯誤 ORA-28040
環(huán)境描述:
oracle服務器端版本:oracle 12.2.0.1.0
oracle客戶端版本:oracle 11.2.0.1.0
PLSQL是11.4

因為PLSQL連接數(shù)據(jù)庫也是要通過Oracle客戶端,那么使用11g客戶端訪問oracle 12c應該也會得到如下錯誤:

C:\Users\Administrator>sqlplus sys/abcd@shardcat as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 20 22:22:07 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-28040: No matching authentication protocol

查看關于錯誤的詳細描述:

[oracle@shard1 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.

在服務器端查看表:dba_users,PASSWORD_VERSIONS 列是:11G 12C

SQL> select username, account_status,password_versions from dba_users where account_status='OPEN';
USERNAME                       ACCOUNT_STATUS                                                   PASSWORD_VERSIONS
------------------------------ ---------------------------------------------------------------- ----------------------------------
SYS                            OPEN                                                             11G 12C
SYSTEM                         OPEN                                                             11G 12C
GSMCATUSER                     OPEN                                                             11G 12C
JY                             OPEN                                                             11G 12C
MYGDSADMIN                     OPEN                                                             11G 12C
APP_SCHEMA                     OPEN                                                             11G 12C
6 rows selected.

服務器端:修改 sqlnet.ora 配置:(配置修改后,不需要重啟oracle服務器)我這里是新創(chuàng)建的sqlnet.ora,因為原來沒有創(chuàng)建

[oracle@shard1 admin]$ ls -lrt
總用量 12
-rw-r--r--. 1 oracle oinstall 1441 8月  28 2015 shrept.lst
drwxr-xr-x. 2 oracle oinstall   61 10月 12 2017 samples
-rw-r-----. 1 oracle oinstall  960 1月  18 2018 tnsnames.ora
-rw-r--r--  1 oracle oinstall  504 2月  17 12:58 listener.ora
[oracle@shard1 admin]$ vi sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=11

客戶端:再次嘗試連接,提示用戶名密碼錯誤:

C:\Users\Administrator>sqlplus sys/abcd@shardcat as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 20 22:16:06 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied

修改服務器端 sqlnet.ora 后,需要重新登錄sqlplus,再修改用戶密碼,否則修改用戶密碼后,標記的密碼版本仍然為11G 12C;重新登錄sqlplus,修改scott用戶密碼,并查看 PASSWORD_VERSIONS,多了一個 10G

[oracle@shard1 ~]$ sqlplus sys/abcd@shardcat as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Feb 17 13:07:28 2020
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> alter user sys identified by "abcd";
User altered.
SQL> select username, account_status,password_versions from dba_users where account_status='OPEN';
USERNAME                       ACCOUNT_STATUS                                                   PASSWORD_VERSIONS
------------------------------ ---------------------------------------------------------------- ----------------------------------
SYS                            OPEN                                                             10G 11G 12C
SYSTEM                         OPEN                                                             11G 12C
GSMCATUSER                     OPEN                                                             11G 12C
JY                             OPEN                                                             11G 12C
MYGDSADMIN                     OPEN                                                             11G 12C
APP_SCHEMA                     OPEN                                                             11G 12C
6 rows selected.

客戶端:再次嘗試登錄oracle 12c,成功:

C:\Users\Administrator>sqlplus sys/abcd@shardcat as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 20 22:22:39 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>

總結:oracle11g 客戶端連接 oracle 12c服務器,需要在服務器端配置 sqlnet.ora,并重新修改用戶密碼。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。

AI