Splitting and merging of Goldengate
Category: ORACLE GoldenGate 2013-10-10 15:22 721 people read reviews (0) Favorite reports
When using Goldengate as a replication solution, the Replicat component is often the first performance bottleneck as the load increases. In order to adapt to the increasing load, it is necessary to split the replicat to realize parallel replication, this paper introduces the concrete implementation steps of Goldengate. At the same time, as a split reverse operation, describes how to merge multiple replicat that are split back into a single replicat.
Splitting is generally divided into two ways:
One is to use the @range function provided by Goldengate as a split in the table, by the table on the primary key column hash algorithm to divide the changes that occur on the table to multiple replicat to reduce the load of a single replicat component;
The other is to divide the replicated tables into groups, using multiple REPLICAT components to replicate one set of tables separately.
The previous steps for splitting and merging refer to the Metalink documentation: 1320133.1 and 1512633.1.
This article describes the implementation steps for the latter method of splitting.
In order to split the table groupings, first consider how to group, usually we can be divided by the load of the table.
Generate a statistical report that has been replicated for some time by using the following command
Ggsci>send Rep01,report
In the report file, you can see how many changes have occurred on each table over time, and thus distribute the table to multiple REPLICAT components by load.
The next step is to introduce the specific implementation steps in the case of splitting the replicat into two ways:
Splitting and merging of replicat processes
Split:
1. Stop the REPLICAT process
CD $GG _home
Ggsci
Ggsci>stop REP01
2. Copy the two new replicat parameter files to the $GG_HOME/DIRPRM directory.
The main difference between the two new parameter file and the original parameter file is that the copy table is divided into two parts by load, and placed in a separate parameter file.
3. Create a new Replicat component
ggsci> ADD Replicat REP01A,EXTTRAIL/ORACLE/GOLDENGATE/GGS/DIRDAT/R1
ggsci> ADD Replicat REP02A,EXTTRAIL/ORACLE/GOLDENGATE/GGS/DIRDAT/R1
4. Check the checkpoint information for the REPLICAT process
Ggsci>info Rep01,showch
Records the sequence and RBA values in their current checkpoint information.
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2157
rba:2856752
timestamp:2013-09-03 08:13:58.035316
Extract Trail:/ORACLE/GOLDENGATE/GGS/DIRDAT/R1
5. Modify the Read checkpoint information for the new REPLICAT process
Modify the checkpoint information of the new Replicat process based on the current checkpoint information obtained in step 4, and the newly created REPLICAT process starts crawling new information from where the old Replicat process stopped.
Ggsci> alter REP01A, Extseqno <sequence>, Extrba <RBA>
Ggsci> alter REP02A, Extseqno <sequence;, Extrba <RBA>
6. Start the new Replicat process
Ggsci>start rep01a
Ggsci>start rep02a
7. Delete the old Replicat process
Ggsci>dblogin userid <GG User>,password * * *
Ggsci>delete REP01
Merge:
1. Stop the Extract process
CD $GG _home
Ggsci
Ggsci>stop ext01
2. Check the checkpoint information for the extract process
Ggsci>info Ext01,showch
Record the sequence and RBA values in their write checkpoint information, such as:
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 2157
rba:36277005
3. Check the checkpoint information for the pump process
Ggsci>info Pump01,showch
If the sequence and RBA values in the current checkpoint information for the pump process are equal to those obtained from step 2, then the Goldengate crawl information has been transferred to the target server and the next step can be continued. Otherwise, wait and run the command repeatedly.
Like what:
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2157
rba:36277005
At the same time, the sequence and RBA values in their write checkpoint information are recorded.
Like what:
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 2160
rba:41659507
4. Check the checkpoint information for the REPLICAT process
Ggsci>info Rep01a,showch
Ggsci>info Rep02a,showch
If the sequence and RBA values in the current checkpoint information for the REPLICAT process are equal to the write checkpoint information obtained in step 3, the Goldengate crawl information has been apply to target DB, you can proceed to the next step. Otherwise, wait and run the command repeatedly.
Like what:
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2160
rba:41659507
5. Stop the old Replicat process
Ggsci>stop rep01a
Ggsci>stop rep02a
6. Copy the merged new Replicat parameter file to the $GG_HOME/DIRPRM directory.
After merging, the new parameter file merges the tables from the original two parameter files into a single file.
7. Create a new Replicat process
ggsci> ADD Replicat REP01,EXTTRAIL/ORACLE/GOLDENGATE/GGS/DIRDAT/R1
8. Modify the Read checkpoint information for the new REPLICAT process
Modify the checkpoint information of the new Replicat process based on the current checkpoint information obtained in step 4, and the newly created REPLICAT process starts crawling new information from where the old Replicat process stopped.
Ggsci> alter REP01, Extseqno <sequence>, Extrba <RBA>
9. Start the new Replicat process
Ggsci>start REP01
10. Start the Extract process
Ggsci>start ext01
11. Delete the old Replicat process
Ggsci>dblogin userid <GG User>,password * * *
Ggsci>delete rep01a
Ggsci>delete rep02a
Find out more about Goldengate, as one of the recommendations for implementing goldengate best Practice, Oracle recommends: "To avoid contention, Oracle recommends this when Reading trail files, you-pair each replicat with its own trail file ". That is, when considering splitting replicat for parallel replication, Oracle recommends that you start splitting from the pump component, the following steps For the previous case, it further explains how to split the goldengate from the pump component. Then it describes how to reverse merge this split.
Splitting and merging of pump and replicat processes
Split:
1. Stop the Extract process
CD $GG _home
Ggsci
Ggsci>stop ext01
2. Check the checkpoint information for the extract process
Ggsci>info Ext01,showch
Record the sequence and RBA values in their write checkpoint information, such as:
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 2153
rba:91925643
3. Check the checkpoint information for the pump process
Ggsci>info Pump01,showch
If the sequence and RBA values in the current checkpoint information for the pump process are equal to those obtained from step 2, then the Goldengate crawl information has been transferred to the target server and the next step can be continued. Otherwise, wait and run the command repeatedly.
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2153
rba:91925643
Record the sequence and RBA values in their write checkpoint information, such as:
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 2157
rba:2332672
4. Stop the old pump process
Ggsci>stop PUMP01
5. Check the checkpoint information for the REPLICAT process
Ggsci>info Rep01,showch
If the sequence and RBA values in the current checkpoint information for the REPLICAT process are equal to the write checkpoint information obtained in step 3, the Goldengate crawl information has been apply to target DB, you can proceed to the next step. Otherwise, wait and run the command repeatedly.
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2157
rba:2856752
6. Stop the old Replicat process
Ggsci>stop REP01
7. Copy the two new pump parameter files to the $GG_HOME/DIRPRM directory.
The main difference between these two new parameter files and the original parameter file is that the copied tables are divided into two parts by load, respectively, in a separate parameter file.
8. Create two new pump processes
Ggsci>add EXTRACT pump01a, exttrailsource/oracle/goldengate/ggs/dirdat/e1
Ggsci >add rmttrail/oracle/goldengate/ggs/dirdat/r1, EXTRACT pump01a,megabytes
Ggsci>add EXTRACT pump02a, Exttrailsource/oracle/goldengate/ggs/dirdat/e1
Ggsci>add rmttrail/oracle/goldengate/ggs/dirdat/r2, EXTRACT Pump02a,megabytes
9. Modify the Read checkpoint information for the new pump process
Modify the checkpoint information for the new pump process based on the read checkpoint information obtained in step 3 to start crawling new information from where the old pump process stopped
Ggsci> ALTER EXTRACT pump01a, extseqno <sequence>, Extrba <RBA>
Ggsci> ALTER EXTRACT pump02a, extseqno <sequence>, Extrba <RBA>
10. Copy the two new replicat parameter files to the $GG_HOME/DIRPRM directory.
Similar to the pump parameter file, the main difference between these two new parameter files and the original parameter file is the split of the table.
11. Create two new replicat processes
Ggsci>add Replicat REP01A,EXTTRAIL/ORACLE/GOLDENGATE/GGS/DIRDAT/R1
Ggsci>add Replicat REP02A,EXTTRAIL/ORACLE/GOLDENGATE/GGS/DIRDAT/R2
12. Delete the existing trail file with R1 starting with the/oracle/goldengate/ggs/dirdat/directory on the traget server
13. Start the new pump process
Ggsci>start pump01a
Ggsci>start pump02a
14. Start the new Replicat process
Ggsci>start rep01a
Ggsci>start rep02a
13. Delete the old pump process
Ggsci>delete PUMP01
14. Delete the old Replicat process
Ggsci>dblogin userid <GG User>,password * * *
Ggsci>delete REP01
Merge:
1. Stop the Extract process
CD $GG _home
Ggsci
Ggsci>stop ext01
2. Check the checkpoint information for the extract process
Ggsci>info Ext01,showch
Record the sequence and RBA values in their write checkpoint information, such as:
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 2153
rba:91925643
3. Check the checkpoint information for the pump process
Ggsci>info Pump01a,showch
Ggsci>info Pump02a,showch
If the sequence and RBA values in the current checkpoint information for the pump process are equal to those obtained from step 2, then the Goldengate crawl information has been transferred to the target server and the next step can be continued. Otherwise, wait and run the command repeatedly.
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2153
rba:91925643
Record the sequence and RBA values in their write checkpoint information, such as:
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 2157
rba:2332672
4. Stop the old pump process
Ggsci>stop pump01a
Ggsci>stop pump02a
5. Check the checkpoint information for the REPLICAT process
Ggsci>info Rep01a,showch
Ggsci>info Rep01a,showch
If the sequence and RBA values in the current checkpoint information for the REPLICAT process are equal to the write checkpoint information obtained in step 3, the Goldengate crawl information has been apply to target DB, you can proceed to the next step. Otherwise, wait and run the command repeatedly.
Current Checkpoint (position of last record, read in the data source):
Sequence #: 2157
rba:2856752
6. Stop the old Replicat process
Ggsci>stop rep01a
Ggsci>stop rep02a
7. Copy the merged new pump parameter file to the $GG_HOME/DIRPRM directory.
After merging, the new parameter file merges the tables from the original two parameter files into a single file.
8. Create a new pump process
Ggsci>add EXTRACT Pump01, exttrailsource/oracle/goldengate/ggs/dirdat/e1
Ggsci>add rmttrail/oracle/goldengate/ggs/dirdat/r1, EXTRACT pump01,megabytes 100
9. Modify the Read checkpoint information for the new pump process
Modify the checkpoint information for the new pump process based on the read checkpoint information obtained in step 3 to start crawling new information from where the old pump process stopped
Ggsci> ALTER EXTRACT pump01, extseqno <sequence>, Extrba <RBA>
10. Copy the merged new Replicat parameter file to the $GG_HOME/DIRPRM directory.
After merging, the new parameter file merges the tables from the original two parameter files into a single file.
11. Create a new Replicat process
Ggsci>add Replicat REP01,EXTTRAIL/ORACLE/GOLDENGATE/GGS/DIRDAT/R1
12. Delete the existing trail file with R1 starting with the/oracle/goldengate/ggs/dirdat/directory on the traget server
13. Start the new pump process
Ggsci>start PUMP01
14. Start the new Replicat process
Ggsci>start REP01
13. Delete the old pump process
Ggsci>delete pump01a
Ggsci>delete pump02a
14. Delete the old Replicat process
Ggsci>dblogin userid <GG User>,password * * *
Ggsci>delete rep01a
Ggsci>delete rep02a
Splitting and merging of goldengate processes