Dear Readers,
In the article, we will see HandleCollisions and NoHandleCollisions in Oracle GoldenGate 12c.
To install Oracle GoldenGate use below link
Installation of Oracle GoldenGate
Note :
HandleCollisions and NoHandleCollisions only valid for Replicat Process
We use handlecollisons in replicat process on the following situations
1.Duplicate data exists on Source table
2.No data found in target table to update or delete
3.If any errors in Configuration of Extract and Replicat process
You can use HANDLECOLLISIONS and NOHANDLECOLLISIONS in the following ways:
- You can enable HANDLECOLLISIONS and NOHANDLECOLLISIONS in a global manner by specifying them at the root level of the parameter file. One parameter remains enabled for all subsequent MAP statements in the parameter file, until the opposing parameter is encountered.
- You can enable HANDLECOLLISIONS or NOHANDLECOLLISIONS within a specific MAP parameter to enable or disable error handling only for that source-target mapping.
Case 1 :
If we have duplicates in Source table automatically the replicat process has been abended.
Then below errors will occur in Replicat Trail file
To avoid above error we can keep HANDLECOLLISIONS parameter in replicat file
Edit the replicat parameter file
1 2 3 4 5 6 7 8 9 10 11 12 13 |
GGSCI (gg2.orcl.com) 83> edit param repint REPLICAT REPINT SETENV(ORACLE_SID='ORCL') SETENV(ORACLE_HOME='/oraeng/app/oracle/product/12.1.0') useridalias ggadmin_trg DBOPTIONS INTEGRATEDPARAMS(parallelism 4) ASSUMETARGETDEFS HANDLECOLLISIONS MAP ajay.DEPT,target ajay.DEPT; NOHANDLECOLLISIONS MAP ajay.EMP,target ajay.EMP; MAP ajay.SALGRADE,target ajay.SALGRADE; |
In above replicat param file HANDLECOLLISIONS assigned to EMP table.
NOHANDLECOLLISIONS assigned globally to EMP and SALGRADE table.
Stop and start the replicat process
1 2 3 4 5 6 7 8 |
GGSCI (gg2.orcl.com) 84> stop repint REPLICAT REPINT is already stopped. GGSCI (gg2.orcl.com) 85> start repint Sending START request to MANAGER ... REPLICAT REPINT starting |
Check replicat process is running or not
1 2 3 4 5 6 |
GGSCI (gg2.orcl.com) 88> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING REPINT 00:00:00 00:00:01 |
Now replicat process is running fine
Check stats to know redirected records
we can see in above image that delete collisions have 1 records.
The duplicate record will be redirected from replicat process. and there will be no issue for replicat process.
Case 2 :
No data found in target table to update or delete.
we get below error Replicat trail file
To avoid the above error we HANDLECOLLISIONS parameter in REPLICAT trail file .
Edit the replicat parameter file
1 2 3 4 5 6 7 8 9 10 11 12 |
GGSCI (gg2.orcl.com) 83> edit param repint REPLICAT REPINT SETENV(ORACLE_SID='ORCL') SETENV(ORACLE_HOME='/oraeng/app/oracle/product/12.1.0') useridalias ggadmin_trg DBOPTIONS INTEGRATEDPARAMS(parallelism 4) ASSUMETARGETDEFS HANDLECOLLISIONS MAP ajay.DEPT,target ajay.DEPT; MAP ajay.EMP,target ajay.EMP; MAP ajay.SALGRADE,target ajay.SALGRADE,NOHANDLECOLLISIONS; |
In above we enable global HANDLECOLLISIONS but disable for specific tables
Stop and start the replicat process
1 2 3 4 5 6 7 8 |
GGSCI (gg2.orcl.com) 84> stop repint REPLICAT REPINT is already stopped. GGSCI (gg2.orcl.com) 85> start repint Sending START request to MANAGER ... REPLICAT REPINT starting |
Check replicat process is running or not
1 2 3 4 5 6 |
GGSCI (gg2.orcl.com) 88> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING REPINT 00:00:00 00:00:01 |
Now replicat process is running fine
Check stats to know redirected records
we can see in above image that delete collisions have 1 records.
The duplicate record will be redirected from replicat process. and there will be no issue for replicat process.
I hope above information was very helpful.
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts