oracle 创建dblink语句

create public database link 名称
connect to 账号 identified by 密码
using '(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=10.77.137.40)(PORT=1521))
)
(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=orcl))
)'

例:
create public database link fwwz
connect to xyfw identified by xyfw
using '(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))
)
(CONNECT_DATA=(SERVER=DEDICATED)
(SERVICE_NAME=orcl))
)'

创建完成后 利用此sql : SELECT * FROM 表明@fwwz 查询出数据即为成功

你可能感兴趣的:(oracle 创建dblink语句)