oracle通过dblink跨库迁移数据

创建连接:

create database link PMSUATTMP
  connect to spmsadmin identified by "spmsadmin"
  using '(DESCRIPTION=
     (ADDRESS=(PROTOCOL=tcp)(HOST=10.63.29.36)(PORT=1531))
     (CONNECT_DATA=(SERVICE_NAME=pms))
  )';

复制数据:

 insert into sms_solution_lex_2020
    (id, loginname, article)
  select * from spmsadmin.sms_solution_lex_2020@PMSUATTMP;
    
    
  insert into sms_solution_tuofu_2020
    (id, projectnumber, create_by, projectname, representativeoffice, representativeofficetype, industry, solutiontype, product, sumtime, status)
  select * from spmsadmin.sms_solution_tuofu_2020@PMSUATTMP;
  
commit;

删除链接:

DROP DATABASE LINK PMSUATTMP;

 

上一篇:MySQL下的DBlink--FEDERATED引擎


下一篇:Oracle集群数据库管理-DBLINK分布式事务失败又遭遇RAC热点块争用