Oracle 創建DBlink同步數據

--建立私有dblink
create database link loadstore
connect to xxxx_user identified by password_xxxx
using '(DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )';數據庫

xxxx_user  源數據庫用戶名ide

password_xxxx 源數據庫密碼
  --查看複製權限
  select * from v$option where PARAMETER='Advanced replication';
  --清空表
  truncate table xxxxx;
  --同步表數據
  insert into xxxxselect * from uatxdgl.xxxx@loadstore;同步

--刪除DBlinkio

drop database link loadstoretable

相關文章
相關標籤/搜索