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
-------------------------------------------------------------
-- 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;