For goldengate processes that only have dml synchronization, if the source end performs the ddl plus field operation, how to deal with the corresponding process
For goldengate processes that only have dml synchronization, if the source end performs the ddl plus field operation, how to deal with the corresponding process
-- Experiment: For goldengate processes that only have dml synchronization, if the source end performs the ddl plus field operation, how to deal with the corresponding process
-- Source orcl
-- First check the Process status, running status:
[Oracle @ localhost ogg] $./ggsci
GGSCI (localhost. localdomain) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
Extract running DPUMP1 00:00:00 00:00:08
Extract running EXT1 00:00:00 00:00:06
-- Stop the extraction process and transmission process:
GGSCI (localhost. localdomain) 2> stop *
Sending STOP request to EXTRACT DPUMP1...
Request processed.
Sending STOP request to EXTRACT EXT1...
Request processed.
GGSCI (localhost. localdomain) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
Extract stopped DPUMP1 00:00:00 00:00:11
Extract stopped EXT1 00:00:00 00:00:09
-- Target orcltest
-- Check that the replication process is running and stops the process:
GGSCI (localhost. localdomain) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
Replicat running REP1 00:00:00
GGSCI (localhost. localdomain) 9> stop *
Sending STOP request to REPLICAT REP1...
Request processed.
-- Source orcl
-- Add a field to the synchronized table
[Oracle @ localhost ogg] $ sqlplus/as sysdba
SQL> alter table ggs. test add new_col varchar2 (10 );
Table altered.
SQL> exit
-- Target orcltest
-- Add fields as well:
[Oracle @ localhost ogg] $ sqlplus/as sysdba
SQL> alter table ggs. test add new_col varchar2 (10 );
Table altered.
SQL> exit
-- Source orcl
-- Start extraction and transmission process
[Oracle @ localhost ogg] $./ggsci
GGSCI (localhost. localdomain) 2> start *
Sending START request to MANAGER...
EXTRACT DPUMP1 starting
Sending START request to MANAGER...
EXTRACT EXT1 starting
GGSCI (localhost. localdomain) 4> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
Extract running DPUMP1 00:40:12 00:00:04
Extract running EXT1 00:02:55 00:00:08
-- Target orcltest
-- Start the replication process
[Oracle @ localhost ogg] $./ggsci
GGSCI (localhost. localdomain) 2> start *
Sending START request to MANAGER...
REPLICAT REP1 starting
GGSCI (localhost. localdomain) 5> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
Replicat running REP1 00:00:00
-- Source orcl
-- Test data modification
[Oracle @ localhost ~] $ Sqlplus/as sysdba
SQL> select count (*) from ggs. test;
COUNT (*)
----------
33
SQL> delete from ggs. test where rownum <5;
4 rows deleted.
SQL> commit;
Commit complete.
SQL> insert into ggs. test (username, user_id, account_status, default_tablespace, temporary_tablespace, created, profile, new_col)
Values ('A', '7', 'open', 'one', 'temp ', sysdate, 'default', 'test'); 2
1 row created.
SQL> commit;
Commit complete.
SQL>
-- Target orcltest
-- Test Result: The result is correct, indicating that the synchronization process is normal.
SQL> select count (1) from ggs. test;
COUNT (1)
----------
29
SQL> select count (*) from ggs. test;
COUNT (*)
----------
30
SQL> exit
Experiment conclusion: For a normal dml replication process, if the target table needs to be added with a field, stop the process and perform ddl operations on the source end at the same time,
Then restart the process. The replication process is normal.
This article permanently updates the link address: