目标端创建dblink
sql
create database link test
connect to test identified by "test"
using
'(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.5.111)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = newpaydb)
)
)';
select sysdate from dual@test;
目标端创建导入脚本
这种方式即使源端是DG库,也可以使用数据泵
shell
vim impdp_test.sh
impdp \' / as sysdba\' tables=test.tb1,test.tb2 directory=test network_link=test parallel=4 parfile=tbname.par logfile=test.log
目标端执行数据导入脚本
powershell
nohup ./impdp_test.sh &