设定tnsnames.ora
###orcl只是名字而已可以更改,tnsping orcl和 sqlplus sys/dab@orcl时候可以用
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.29)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl) #这个是对方的listen里面的 sid或者服务名
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
A服务器:create public database link A_TO_B(联结的名字) connect to tmp identified by tmp using 'TNSA_B'(tnsnames里面的名字);
#create public database link orcl.shanghai using 'shanghai';
select * from haha@A_TO_B(联结的名字);
阅读(1764) | 评论(0) | 转发(0) |