In general, any replication tool replicates data in similar objects. We need an identical copy of the source and target if we want to do replication.

Column Mapping 

Oracle Golden Gate is a strong tool which provides the capability to map columns between two dissimilarly structured database table. This feature can be implemented in Golden Gate with ColMap clause in Table and Map parameter.

Column Mapping Example :

Map hr.accounts , Target hr.details_account ,
ColMap(USEDEFAULTS , account_code=@StrCat(company_code,account_code);

In the above example, we can see that I have used two arguments in ColMap clause.

1. USEDEFAULTS: Any columns in accounts and details_account table which have the same name will be replicated as it is.

2. StrCat: I have concatenated two columns using strcat. It will concatenate the company code and account code and put them in one column account code.

We can use ColMap this way.

Data Transformation :

Oracle Golden Gate provides the capability of transforming data by using a set of built-in functions. Transformation function can be applied for either extract or replicat. Additional functions can be used by using your own logic through user exits.

We can use the following column conversations :

  1. Perform string and number conversation.
  2. Extract portions of strings or concatenate columns
  3. Compare strings or numbers
  4. We can use single or nested IF to evaluate string, number or other values to find appropriate value and format for target columns etc

Let us see some built-in ‘@’ functions :

@IF Function: This function can be used with Oracle golden gate other functions to check conditional argument.

Syntax :

variable = @if(condition ,if_true_val,if_false_val)

Example :

Age = @if (age < 16 , 'M','J')

@Date Functions: There are several  date functions available with Golden Gate: Date, Datadiff, Datenow

If you want to be updated with all our articles send us an Invitation or Follow us:

Telegram Channel:

Skant Gupta’s LinkedIn:

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp


About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.