1.tnsnames.ora文件内容
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
2.相同版本的数据库直接的DBLINK
create database link TestDblink
connect to dbName identified by dbPassword
using 'ORCL';
3.不相同版本的数据库直接的DBLINK
create database link TestDblink
connect to dbName identified by dbPassword
using '(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))';
4.验证DBLINK
select * from dual@TestDblink
5.使用DBLINK
select * from table@TestDblink
如果觉得《Oracle 创建 DBLink 的方法 (Oracle12可以调用Oracle11的表)》对你有帮助,请点赞、收藏,并留下你的观点哦!