环境:
OS:Centos 6
DB:11.2.0.4
1.源库导出同步的表
获取当前系统时间
select sysdate from dual;
expdp goldengate/goldengate tables=hxl.tb_test dumpfile=tb_test.20211206_11g_%u.dmp FLASHBACK_TIME=\"to_timestamp\(\'2021-12-06 11:46:00\',\'yyyy-mm-dd hh24:mi:ss\'\)\" parallel=5 directory=data_pump_dir cluster=n reuse_dumpfiles=true version=11.2.0.4
2.将导出文件拷贝到目的库的data_pump_dir目录
scp tb_test.20211206_11g_01.dmp oracle@192.168.56.66:/home/oracle/dumpdir/
scp tb_test.20211206_11g_02.dmp oracle@192.168.56.66:/home/oracle/dumpdir/
3.导入
impdp goldengate/goldengate directory=data_pump_dir dumpfile=tb_test.20211206_11g_%u.dmp cluster=n tables=hxl.tb_test table_exists_action=replace
4.获取scn(源库查询)
SQL> select timestamp_to_scn(TO_TIMESTAMP('2021-12-06 11:46:00', 'YYYY-MM-DD HH24:MI:SS')) ts from dual;
TS
----------
1025403
5.启动复制进程
start repep aftercsn 1025403