zoukankan      html  css  js  c++  java
  • oracle的db link

    cd $ORACLE_HOME/network/admin

    vi tnsnames.ora

    添加

    CCPBS_19 =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = 10.130.38.19)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = CCPBS)
        )
      )

    >create public database link ecbm_19 connect to ecbm_userName identified by ecbm_pwd using 'CCPBS_19';

    Database link created.

    createpublicdatabaselink link_name connectto user identifiedby password using 'SID';

    则创建了一个连接到10.130.38.19 ccpbs上以ecbm_userName 用户的连接

    查询数据时带上@ecbm_19 就ok了 如select * from emp@ecbm_19;

    删除 DROPPUBLICDATABASELINK ecbm_19;

     3、建立同义词,为了使有关分布式操作更透明,ORACLE数据库里有同义词的对象synonym 

      SQL>create synonym bjscottemp for emp@beijing;

      于是就可以用bjscottemp来替代带@符号的分布式链接操作emp@beijing

    create public synonym poh for po_headers_all@erp_danzheng_test;

    查看所有的数据库链接,进入系统管理员SQL>操作符下,运行命令:

    SQL>select owner,object_name from dba_objects where object_type='DATABASE LINK';

  • 相关阅读:
    ExtJS4.2学习(6)——基础知识之proxy篇
    undo损坏故障恢复(二)ORA-01092,ORA-00604,ORA-01110
    pat 1063. Set Similarity (25)
    汉语-汉字:彤
    地理-地名:九女集
    汉语-汉字:菅
    汉语-汉字:蒯
    汉语-汉字:旬
    汉语-汉字:弁
    汉语-汉字:尥
  • 原文地址:https://www.cnblogs.com/tippoint/p/3148651.html
Copyright © 2011-2022 走看看