[oracle@pub19-node2 ~]$ sqlplus -v SQL*Plus: Release 19.0.0.0.0 - Production Version 19.5.1.0.0
當使用orapwd修改密碼文件之后,普通用戶通過tnsnames.ora文件登陸數據庫沒有問題,當涉及sysdba使用
密碼文件時則在輸入正確密碼之后,會報ORA-12514,在orapwd之前是沒有這個問題的。
[oracle@pub19-node2 dbs]$ orapwd file=+datadg dbuniquename=orcl format=12 sys=password sysdg=password force=y
[oracle@pub19-node2 ~]$ sqlplus system@czhprimary SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 3 08:09:45 2020 Version 19.5.1.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Enter password: Last Successful login time: Sun May 03 2020 07:56:27 +08:00 Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.5.1.0.0 SYSTEM@czhprimary >
[oracle@pub19-node2 ~]$ sqlplus sys@czhprimary as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 3 08:08:53 2020 Version 19.5.1.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Enter password: ERROR: ORA-12154: TNS:could not resolve the connect identifier specified Enter user-name:
當發生ORA-12514時,一般有如下幾個原因:
(1)tnsnames.ora文件未正確配置。
(2)sqlnet.ora文件未正確配置。
(3)由于客戶端與服務器端版本不同,未在sqlnet.ora文件中修改兼容性參數。
(4)密碼文件未正確配置
經過排查,以上問題均一一嘗試,均無法解決,隨去Mos搜索,找到文章如下:
Change in Password and Remote Connection Suddenly Yields : ORA-12154 TNS: Unable to Resolve Service Name (Doc ID 291709.1)
該問題發生在通過orapwd修改的密碼有@符號時,恰巧我修改的密碼包含@,所以在輸入密碼時需要添加雙引號如下:
[oracle@pub19-node2 ~]$ sqlplus sys@czhprimary as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 3 08:18:06 2020 Version 19.5.1.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Enter password: "1qaz@WSX" Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.5.1.0.0 08:18:15 SYS@czhprimary >
當發生該問題時,應該想到唯一修改的只有密碼文件,之前連接未有問題,也定位到時密碼文件問題,但是并未想到
會在輸入密碼時需要使用雙引號括起來,還是要多多思考。
Change in Password and Remote Connection Suddenly Yields : ORA-12154 TNS: Unable to Resolve Service Name (Doc ID 291709.1)
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。