oracle 创建dblink后无法使用
创建语句:
create database link mcc59_to_167 connect to "LINGTU" identified by "lingtu" using 'lingtu';
tnsnames.ora文件配置如下:
167 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.12.167)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = lingtu)
)
)
172.17.12.59 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.12.59)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
创建dblink提示创建成功,但是 查询时提示
SQL> select count(*) from mcc_track@mcc59_to_167;
select count(*) from mcc_track@mcc59_to_167
*
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
global_names设置为false了已经
alter system set global_names=false;
高手们帮忙看下什么问题啊?谢谢
------解决方案--------------------create database link mcc59_to_167 connect to "LINGTU" identified by "lingtu" using '<这里是你要连接的网络服务名,不是别的>';
------解决方案--------------------
应该是这样吧:
create database link mcc59_to_167 connect to "LINGTU" identified by "lingtu" using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.12.167)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = lingtu)
)
)
';
------解决方案--------------------晕。using 后面的配置项,在tnsnames.ora中需要有