ORACLE下如何创建DBLink

--1. Create database link 
create database link CIMLINK
  connect to CCBCIM  identified by password
  using '(
           DESCRIPTION =
             (ADDRESS_LIST =
                (ADDRESS = (PROTOCOL = TCP)
                           ( HOST = 11.40.33.11)
                           (PORT = 1550)
                 )
              )

            (CONNECT_DATA =(SERVICE_NAME = CDBINST1) )
         )';

解释:CIMLINK  - DBlink的名字
      CCBCIM   - 要连接的数据库名字
      password - 要连接数据库的密码
      HOST     - 要连接数据库的物理IP

--2. Create the synonym
create or replace synonym PPMS_CIM_CLIENT_INFO
  for CCBCIM_CLIT_BASIC@ CIMLINK;

解释:PPMS_CIM_CLIENT_INFO - 同义词的名字,可以当正常表来用
      CCBCIM_CLIT_BASIC    - DBLink到实际库里的表名
      CIMLINK              -  DBLink的名字


     
     

你可能感兴趣的:(oracle)