小记:
首先建立数据库连接:
-- Drop existing database link
drop public database link DB4960;
-- Create database link
create public database link DB4960
connect to ctile identified by ctile
using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.11.41.60)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)';
然后需要建立同义词:
create public synonym mistel.table for
mistel.table@DB4960;
然后就可以在本地使用select * from mistel.table 查询DB4960上的数据库表。