ikm oracle multi table insert ikm oracle multi table insert · open that ikm and delete the filter...

19
IKM Oracle Multi Table Insert 5-Sep-2012 Korada V Pavan Kumar IKM oracle Multi Table Insert Tool Version Used: Oracle Data Integrator 11.1.1.5. This is generally used to load data from one source table to multiple target tables. This KM can be used in many ways by using different filters, joiners, expressions etc. for generating different targets according to our requirement but here I have implemented this for generating different targets with different filters using this Knowledge Module in ODI. Now if you add filter to each interface it won’t work. The process will load correct data to 1st target table but not to the rest tables. Why is so???? Here we need to apply a small trick. So let’s start. Source table: EMP Target tables: EMP_TGT1 EMP_TGT2 EMP_TGT3 Knowledge Modules: LKM: if required select desired LKM IKM: IKM Oracle Multitable Insert IKM: IKM Oracle Multitable Insert For Filters (Customized KM for getting the required way of output) CKM: CKM oracle Interfaces Created: Parallel_Load_EMP_TGT1 Parallel_Load_EMP_TGT2 Parallel_Load_EMP_TGT3

Upload: vuongque

Post on 06-Jul-2019

228 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

IKM oracle Multi Table Insert

Tool Version Used: Oracle Data Integrator 11.1.1.5.

This is generally used to load data from one source table to multiple target

tables.

This KM can be used in many ways by using different filters, joiners, expressions etc. for generating different targets according to our requirement but here I have implemented this for generating different targets with different filters using this Knowledge Module in ODI.

Now if you add filter to each interface it won’t work. The process will load correct data to 1st target table but not to the rest tables. Why is so???? Here we need to apply a small trick. So let’s start.

Source table: EMP

Target tables: EMP_TGT1 EMP_TGT2 EMP_TGT3

Knowledge Modules: LKM: if required select desired LKM IKM: IKM Oracle Multitable Insert IKM: IKM Oracle Multitable Insert For Filters (Customized KM for getting

the required way of output) CKM: CKM oracle

Interfaces Created: Parallel_Load_EMP_TGT1 Parallel_Load_EMP_TGT2 Parallel_Load_EMP_TGT3

Page 2: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

Here is the step by step process along with the brief description.

1) Creating a data server for the schema named Scott

2) Creating the physical Schema for the above mentioned Data server

Page 3: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

3) Creating the Logical Schema for the above mentioned Data server.

4) Reverse Engineer for source EMP has been done as below

EMP

(Source Table)

Page 4: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

5) Reverse Engineer for Targets EMP_TGT1,EMP_TGT2,EMP_TGT3 has

been done successfully as below

EMP_TGT1

(Target Table 1)

EMP_TGT3

(Target Table 3)

EMP_TGT2

(Target Table 2)

Page 5: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

6) First Interface Parallel_Load_EMP_TGT1 has been done with the filter condition as below

Page 6: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

7) The options for Parallel_Load_EMP_TGT1 interface in the flow tab should be as follows.

Page 7: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

8) Second Interface Parallel_Load_EMP_TGT2 has been done with the filter condition as below

Page 8: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

9) The options for Parallel_Load_EMP_TGT2 interface in the flow tab should be as follows.

Page 9: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

10) Third Interface Parallel_Load_EMP_TGT3 has been done with the filter condition as below

Page 10: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

11) The options for Parallel_Load_EMP_TGT3 interface in the flow tab should be as follows

Page 11: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

12) Create a Package with three interfaces as below.

13) The Successful Execution of the above package is as below and you can view the code by opening the 7th step which was highlighted in the below.

Page 12: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

14) The code is as below.

This filter is the cause for getting the two target tables (EMP_TGT2, EMP_TGT3) populating with Zero records

(see below points for clear idea)

Page 13: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

15) If you execute in the above manner then the screenshots of the data in 3 target tables will be as below Data in the Target EMP_TGT1

Data in the Target EMP_TGT2

Page 14: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

Data in the Target EMP_TGT3

NOTE: The two target tables (EMP_TGT2, EMP_TGT3) populated with Zero records due to the filter condition which you can easily see in the screenshot mentioned in point no. 14

16) Now to get out of this issue we need to a slight customization for our

IKM

Make a Duplicate of the IKM and name it as IKM Oracle Multitable

Insert for Filters

Open that IKM and delete the filter condition from define Query option

as mentioned in the below screen shot so that the effective filter can

be avoided.

Page 15: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

Delete the Highlighted

single line

Page 16: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

17) Change the IKM with the newly customized IKM in the three

interfaces

Page 17: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

18) Now you can see that the filter condition is not existing

No Filter is executed

Page 18: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

19) Now you can observe the data in the target tables according to the

filters using This IKM

Data in the Target EMP_TGT1

Data in the Target EMP_TGT2

Page 19: IKM Oracle Multi Table Insert IKM oracle Multi Table Insert · Open that IKM and delete the filter condition from define Query option as mentioned in the below screen shot so that

IKM Oracle Multi Table Insert

5-Sep-2012 Korada V Pavan Kumar

Data in the Target EMP_TGT3

In this way we can use this IKM Oracle Multitable Insert for using the customized filters, joiners, expressions etc. and generating different target tables as per the requirement.

The Purpose of this document is to understand the usage of a Knowledge Module named IKM oracle

Multi Table Insert and the process of using it accordingly.