--创建数据库链接
CREATEPUBLIC DATABASE LINKDBLINK_112
CONNECTTO BJSLG
IDENTIFIEDBY BJSLG
USING'(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST= 130.10.7.112)(PORT= 1521))
)
(CONNECT_DATA =
(SERVICE_NAME= ORCL)
)
)';
--使用dblink
SELECT *
FROM SJCJ_RYDJBXX@DBLINK_112
WHERE ROWNUM=1;