Create straight replication script - connect_cdc_sqdata - Latest

Connect CDC (SQData) Change Data Capture

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) Change Data Capture
Copyright
2024
First publish date
2000
ft:lastEdition
2024-09-05
ft:lastPublication
2024-09-05T15:00:09.754973

A Simple Replication script requires DESCRIPTIONS for each Source and Target table as well as a either straight mapping procedure for each table or use of the REPLICATE Command as shown in the sample script below. In the example DDL is provided through external files for each table referenced as a GROUP. In the sample script, a CDCSTORE type capture uses TCP/IP to transport data to the target Apply Engine. The Main Select section contains only references to the Source and Target Datastore aliases and the REPLICATE Command. Individual mapping procedures are not required in this case. See the Engine Reference for more details regarding the use of the REPLICATE Command.

The sample script, ORATOORA, is listed below. Note how the same table descriptions are used for both Source and Target environments, how the Schema, which may have been present in the descriptions is overridden and how a single function, REPLICATE performs all the work. See the Engine Reference for more details regarding the use of the REPLICATE Command

If you choose to exercise this script, which is based on two simple Oracle tables, it will be necessary to create two copies of the DEPT and EMP tables as referenced in the script on the target system. Once that is complete, the script can be parsed and exercised.
-------------------------------------------------------------
--   Oracle REPLICATION SCRIPT FOR ENGINE: ORATOORA
-------------------------------------------------------------
--  SUBSTITUTION VARS USED IN THIS SCRIPT:                  
--   %(ENGINE) - ENGINE Name                                
--   %(HOST) - HOST OF Capture                              
--   %(PORT) - TCP/IP PORT of SQDAEMON                      
--   %(PUBN) - Capture / Publisher alias in sqdagents.cfg  
--   %(SSID) - Oracle Subsystem ID                          
-------------------------------------------------------------
-- CHANGE LOG:                                              
-- 2018/01/01: INITIAL RELEASE                              
-------------------------------------------------------------
JOBNAME %(ENGINE);                                          
RDBMS NATIVEORA %(SSID);                                    
OPTIONS CDCOP('I','U','D');                                  
-------------------------------------------------------------
--         DATA DEFINITION SECTION
-------------------------------------------------------------
---------------------------                                  
-- Source Data Descriptions                                  
---------------------------                                  
BEGIN GROUP SOURCE_DDL;                                      
DESCRIPTION ORASQL ./ORADDL/EMP   AS S_EMP;                
DESCRIPTION ORASQL ./ORADDL/DEPT   AS S_DEPT;                
END GROUP;                                                  
---------------------------                                  
-- Target Data Descriptions                                  
---------------------------                                  
--  None required for Straight Replication      
---------------------------                      
-- Source Datastore(s)                          
---------------------------                      
DATASTORE cdc://%(HOST):%(PORT)/%(PUBN)/%(ENGINE)
        OF UTSCDC                              
        AS CDCIN                              
         RECONNECT                              
        DESCRIBED BY GROUP SOURCE_DDL          
;                                                
---------------------------                      
-- Target Datastore(s)                          
---------------------------                      
DATASTORE RDBMS                                  
        OF RELATIONAL                          
        AS TARGET                              
        FORCE QUALIFIER TGT                    
        DESCRIBED BY GROUP SOURCE_DDL          
        FOR CHANGE                            
;                                                
---------------------------                      
-- Variables                                    
---------------------------                      
--  None required for Straight Replication      
---------------------------                      
-- Procedure Section                            
---------------------------                      
--  None required for Straight Replication      
-------------------------------------------------
--  Main Section - Script Execution Entry Point  
-------------------------------------------------
PROCESS INTO TARGET                              
SELECT                                          
{                                              
-- OUTMSG(0,STRING(' TABLE=',CDC_TBNAME(CDCIN)  
--               ,' CHGOP=',CDCOP(CDCIN)        
--               ,' TIME=' ,CDCTSTMP(CDCIN)))  
--  Source and Target Datastores must have the same table names
  REPLICATE(TARGET)                            
}                                              
FROM CDCIN;