Mapping and Data Filtering in Golden Gate
Replicat parameter file used the ASSUMETARGETDEFS(your source and target tables were identical)
We can also do manual mapping and data filtering during golden gate replication. It work like process of ETL. Like Extract data from the source as needed.
Mapping Columns with different name as below:
column name SALARY as in the source database table; the target database table has a column named WAGES.
You code the MAP parameter as shown in the following example:Mapping all the table to HR schema
Map HR.EMPLOYEES, Target HR.STAFF,
COLMAP (USEDEFAULTS,
WAGES = SALARY);Mapping for specific tables of HR Schema.
Table HR.*;
Map HR.*, Target HR.* ;
Table HR.EMPLOYEES;
Table HR.JOBS;
Map HR.EMPLOYEES, Target HR.EMPLOYEES ;
Map HR.JOBS, Target HR.JOBS ;
Mapping for only specified columns:except for a few columns
Table HR.EMPLOYEES
COLS (employee_Id, first_name, last_name);
Table HR.EMPLOYEES
COLSEXCEPT (email);
Filtering Rows
Table HR.EMPLOYEES,
WHERE (EMPLOYEE_ID < 100);
Add filter on Replicate process alsoExample: Add filter on replicate process
Map HR.EMPLOYEES, Target HR.EMPLOYEES,
WHERE (JOB_ID = "IT_PROG");
monthly salary is greater than 1000
Map HR.EMPLOYEES, Target HR.EMPLOYEES,
FILTER (SALARY / 12 > 1000);
Executes the filter for delete statements
Table HR.EMPLOYEES,
FILTER (ON DELETE, SALARY / 12 < 1000);
Note : Replicat parameter file used the ASSUMETARGETDEFS(your source and target tables were identical)