Posted on 2011-03-07 18:09
疯狂 阅读(1707)
评论(0) 编辑 收藏 所属分类:
database
小记:
首先建立数据库连接:
-- 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 = ip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)';
然后需要建立同义词:
create public synonym sc.table for
sc.table@DB4960;
然后就可以在本地使用select * from mistel.table 查询DB4960上的数据库表。