Oracle创建dblink报错:ORA-01017、ORA-02063解决
Oracle环境:oracle 10.2.0.1 创建的 public dblink 连接oracle 11.2.0.3ORA-01017: invalid username/password; logon denied ORA-02063: preceding line from
一.创建dblink
create public database link dmz63
connect to xyy identified by xyy
using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = 10.0.0.1)(HOST = 192.xxx.xxx.xxx)(PORT = 2261)))(CONNECT_DATA = (SERVICE_NAME = xyy)))';
二.创建dblink 后使用时提示如下错误:
select * from dual@dmz63
报错如下:
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from
三、问题分析:
根据ORA-01017的提示是连接到另一方的用户密码错误,于是直接使用配置的用户密码(lsxy/lsxy)登录数据库发现正常登录,进一步的查看建立好后的dblink 语句,其中用户名都转化为了大写,由此猜测密码是否也被转化为了大写从而导致密码错误。
根据猜测百度了下,确实有这种情况。当9i或10g的版本的Oracle数据库连接11g的版本时,会自动将密码转化为大写。
四、解决办法:
我们将dblink 的创建语句稍微改写即可,如下:
将密码用双引号引起来
create public database link dmz63
connect to xyy identified by "xyy"
using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.1)(PORT = 2261)))(CONNECT_DATA = (SERVICE_NAME = xyy))';
分享到: