10g创建dblink代码
-- Create database link
create database link jxkp
connect to jxkp identified by jxkp
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.155)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = fxgl)
)
)';
一直报错
ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from
一开始以为是用户名密码区分大小写
但后来发现用户名密码是对的
最终发现原因:
因为11g建dblink时用户的密码必需加上双引号""
正确的写法是
-- Create database link
create database link jxkp
connect to jxkp identified by "jxkp"
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.40.155)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = fxgl)
)
)';
成功了