zoukankan      html  css  js  c++  java
  • 『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 tab@lk;

    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 tab@d_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

  • 相关阅读:
    SVN服务的配置与管理
    SVN配置多仓库与权限控制
    SVN使用详解
    这个问题他又来了,如何学编程!
    乘风破浪的程序员们
    Java 学习路线(史上最全 2020 版 ~ 持续更新中)
    P4782 【模板】2-SAT 问题
    HDU
    2020.8.3
    Interesting Computer Game
  • 原文地址:https://www.cnblogs.com/KT-melvin/p/6900799.html
Copyright © 2011-2022 走看看