1. 程式人生 > 其它 >使用expdp和impdp進行goldengate初始化

使用expdp和impdp進行goldengate初始化

環境:

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 [email protected]:/home/oracle/dumpdir/
scp tb_test.20211206_11g_02.dmp [email protected]:/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