ora-01017 和oracle database link

來源:互聯網
上載者:User

標籤:

DB link ,建立完了後總是報密碼錯誤.我感到奇怪.明明密碼是對的.怎麼可能錯誤呢.

SQL> create public database link kk40 connect to khfx identified by xffsf3 using ‘1004‘

SQL> select * from ;

select * from

ORA-01017: invalid username/password; logon denied
ORA-02063: 緊接著 line (起自 KK40)

SQL> create public database link kk40 connect to khfx identified by "xffsf3" using ‘1004‘ 
Database link created

SQL> select * from ;
DUMMY
-----
X

原來加上雙引號才可以啊! 記錄一下.

=====================================================================

一、建立dblink 原始語句:

  create public database link db_lsxy

  connect to lsxy  identified by lsxy

  using ‘(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.xxx.xxx.xxx)(PORT = 2261)))(CONNECT_DATA = (SERVICE_NAME = serName)))‘;

  注意:這裡使用者密碼都是小寫。

  二、建立dblink 後使用時提示如下錯誤:

  ORA-01017: invalid username/password; logon denied

  ORA-02063: preceding line from <link_name>

  三、問題分析:

  根據ORA-01017的提示是串連到另一方的使用者密碼錯誤,於是直接使用配置的使用者密碼(lsxy/lsxy)登入資料庫發現正常登入,進一步的查看建立好後的dblink 語句,其中使用者名稱都轉化為了大寫,由此猜測密碼是否也被轉化為了大寫從而導緻密碼錯誤。

  根據猜測百度了下,確實有這種情況。當9i或10g的版本的Oracle資料庫連接11g的版本時,會自動將密碼轉化為大寫。

  四、解決辦法:

  (方法1、如果11g的資料庫使用者的密碼是小寫字母,將其改成大寫,然後再去用9i去串連,這個方法太過粗鄙影響也比較大不考慮使用。

  (方法2、將密碼用雙引號引起來。如 identified by "jxunicom_sale"

  採用方法2,我們將dblink 的建立語句稍微改寫即可,如下:

  create public database link DB_LSXY

  connect to lsxy  identified by "lsxy"

  using ‘(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.xxx.xxx.xxx)(PORT = 2261)))(CONNECT_DATA = (SERVICE_NAME = serName)))‘;

ora-01017 和oracle database link

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.