代码改变世界

Oracle跨库访问数据表-DBLINK

2013-12-03 11:58  Yang-Onion  阅读(436)  评论(0编辑  收藏  举报

1:创建DBLINK(USING后面的连接字符串就是要访问的那个数据库的连接字符串)

CREATE DATABASE LINK linkName
CONNECT TO userName IDENTIFIED BY passwork
USING
'(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 19.22.40.7)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = DJPG)
    )
)';

2:访问表

SELECT * FROM FEESITEMS@linkName;

home page tracking
NutriSystem Diet