『ORACLE』 DBLINK(11g)
Posted 九號客栈
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了『ORACLE』 DBLINK(11g)相关的知识,希望对你有一定的参考价值。
使用tnsnames.ora
SQL> grant create database link to scott;
Grant succeeded.
SQL> conn scott/tiger
Connected.
SQL> create database link lk connect to hr identified by hr using ‘enmo1‘;
Database link created.
SQL> select * from [email protected];
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
COUNTRIES TABLE
DEPARTMENTS TABLE
EMPLOYEES TABLE
EMP_DETAILS_VIEW VIEW
EMP_SAL_CHANGE TABLE
JOBS TABLE
JOB_HISTORY TABLE
LOCATIONS TABLE
REGIONS TABLE
SP_LOGERR TABLE
10 rows selected.
SQL> conn hr/hr
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
COUNTRIES TABLE
DEPARTMENTS TABLE
EMPLOYEES TABLE
EMP_DETAILS_VIEW VIEW
EMP_SAL_CHANGE TABLE
JOBS TABLE
JOB_HISTORY TABLE
LOCATIONS TABLE
REGIONS TABLE
SP_LOGERR TABLE
10 rows selected.
使用easy connect
SQL> create database link d_1 connect to scott identified by tiger using‘192.0.2.5:1521/enmo1‘;
Database link created.
SQL> select * from [email protected]_1;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
SQL> conn scott/tiger
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
以上是关于『ORACLE』 DBLINK(11g)的主要内容,如果未能解决你的问题,请参考以下文章
如何通过 DBLINK 通过 DBLINK 调用 SELECT?