odi11g - day 3 - course 3

29
Oracle Data Integrator InfoStart 2015

Upload: chirita-alexandra

Post on 15-Jan-2016

19 views

Category:

Documents


1 download

DESCRIPTION

Invatat ODI

TRANSCRIPT

Page 1: ODI11g - Day 3 - Course 3

Oracle Data Integrator

InfoStart 2015

Page 2: ODI11g - Day 3 - Course 3

INTERFACESLoad TRG_CUSTOMER

Some data we need are located in two flat files

Page 3: ODI11g - Day 3 - Course 3

INTERFACESLoad TRG_CUSTOMER. Define the topology

Let's define the topology for the flat files.Under the File technology there's already a data server named FILE_GENERIC.

Let's create a new physical schema

Page 4: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define the topology

1 – directory path

2 – Save 3 – Save

Page 5: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define the topology

Create a new logical schema

Page 6: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define the topology

Connect logical schema with physical schema, give a name, then save.

Page 7: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define the topology

Create a new model for the file technology. Fill all fields under Definition tab.

Save.

Page 8: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define Models and Datastores

Let's create a datastore for SRC_SALES_PERSON.txt

The file is fixed format and has no header.

Page 9: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define Models and Datastores

Set the fields in the Definition tab as shown

Page 10: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define Models and Datastores

Set the fields in the Files tab as shown.

Save your work

Page 11: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define Models and Datastores

By clicking the Reverse Engineer button now, we get a popup window showing the file content.

Page 12: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define Models and Datastores

Click at the end of each field on the ruler to delimit the bounds.

Page 13: ODI11g - Day 3 - Course 3

Click on each column then set its name and datatype.ATTENTION: Click on the field name, not on the ruler.Give to all fields the String datatype, for simplicity.Click OK then Save your work.

INTERFACESINTERFACESLoad TRG_CUSTOMER. Define Models and Datastores

Page 14: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER

We're ready to design our interface now

Page 15: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER

Drag all needed datastores in the interface editor, click Yes to perform the automatic mapping on the columns having the same name.

Page 16: ODI11g - Day 3 - Course 3

To perform the join between SRC_CUSTOMER.SALES_PERS_ID and SRC_SALES_PERSON.SALES_PERS_ID simply drag one columnover the other one.

INTERFACESINTERFACESLoad TRG_CUSTOMER

Page 17: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER

Click on each target field and set the mapping as shown.To set a source column as mapping in the target, simply drag the source column into the target mapping

Page 18: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_CUSTOMER

Click on Flow tab.Click here.As we can see, a Loading phase is required to store the file in a temporary table.To perform a Loading phase, ODI needs a Loading Knowledge Module (LKM).Of course it must be imported into the project.

Page 19: ODI11g - Day 3 - Course 3

We use this LKM

INTERFACESINTERFACESLoad TRG_CUSTOMER

Page 20: ODI11g - Day 3 - Course 3

1 – Click here

2

INTERFACESINTERFACESLoad TRG_CUSTOMER

Page 21: ODI11g - Day 3 - Course 3

- Click here- Set the IKM- Save your work

INTERFACESINTERFACESLoad TRG_CUSTOMER

Page 22: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESUpdate Dear in TRG_CUSTOMER

Create a new interface.Use TRG_CUSTOMER as source and as target datastoreDon't perform any automatic mapping

Drag CUST_ID into the target. Notice that it will be the update key (WHERE condition in update statement), since it's already a primary key

Page 23: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESUpdate Dear in TRG_CUSTOMER

Click on DEAR column then use the editor to build the business rule

Page 24: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESUpdate Dear in TRG_CUSTOMER

To get the column name in the editor, double click here or drag the column into the right pane.

Click OK

Page 25: ODI11g - Day 3 - Course 3

You can check the sintactic correctness of the statement by clicking here

INTERFACESINTERFACESUpdate Dear in TRG_CUSTOMER

Page 26: ODI11g - Day 3 - Course 3

Flag only the Update check box for the column DEAR and UPD_DATE.

INTERFACESINTERFACESUpdate Dear in TRG_CUSTOMER

Page 27: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESUpdate Dear in TRG_CUSTOMER

Select the KMIKM Oracle Incleental Update we imported before and set the Flow Control to False.

Save your work.

Page 28: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_SALES

Finally we load the fact table

Page 29: ODI11g - Day 3 - Course 3

INTERFACESINTERFACESLoad TRG_SALES

Here's the interface.Notice that ODI automatically detects the GROUP BY clause, there's no need to specify it.