ODI 12c - Mapping - Table To Flat File
ODI 12c - Mapping - Table To Flat File
ODI 12c - Mapping - Table To Flat File
To create a new project within Oracle Data Integrator, perform the following steps:
1.Start ODI Designer: Start > All programs > Oracle > Oracle Data Integrator > Designer.
Select WORKREP from the Login Name drop-down menu, if not already selected.
Click OK to login.
2. In the window that opens, click Projects tab, and then click the Insert Project button to add a new
project.
3.In the screen that opens, set the Name of the project to ODIexp_RT_FF in the name field. The code
field will be filled automatically. Click OK. The newly create project ODIexp_RT_FF now appears in
the Project tree view. You have now successfully added a new ODI project.
Creating a New RDBMS Schema for ODI Source Datastore You must create a schema (ODI_STAGE1)
to host the ODI source datastore.
To create a new RDBMS Schema for ODI datastore, perform the following steps:
1.Start the Oracle XE database Home Page: Start > All Programs > Oracle database 10g Express
Edition > Go to Database Home page.
The Login screen appears. Login into Oracle XE database as System. The default password is oracle1.
Click Login.
2.In Oracle Database Express Edition Home screen open the SQL drop-down menu and select SQL
Commands > Enter Command.
3.You create the schemas by executing the following SQL commands:
Creating a New ODI Source Datastore for Use With ODI Interface
In the next steps you will create a new ODI datastore for the source model. This datastore which will
be used within ODI interface.
1. If not started, start the Oracle XE database Home Page: Start > All Programs > Oracle database
10g Express Edition > Go to Database Home page.
Click Login.
2. In Oracle Database Express Edition Home screen open the SQL drop-down menu and select SQL
Commands > Enter Command.
You create the table by executing the following SQL commands:
3. To populate the SRC_SALES_PERSON table, go to SQL Commands window, enter the commands
from the table below. Click RUN and then, verify that statements processed successfully.
4. Verify that table SRC_SALES_PERSON populated with data successfully by executing the
statement provided below.
Creating a New ODI Source Data Server and Physical Schema
In the next steps you will create a new ODI source data server and the physical schema.
To create the ODI source data server and the physical schema, perform the following steps.
1. Start ODI Topology Manager: Start > All programs > Oracle > Oracle Data Integrator > Topology
Manager.
The default User Name and Password is preset as SUPERVISOR and SUNOPSIS.
Click OK to login.
2. Click the Physical Architecture tab of Topology Manager. Expand Technologies, right-click Oracle,
and select Insert Data Server.
3. In Data Server: New window enter the values provided in the table below. Click JDBC tab.
4. Click … for JDBC driver. Select Oracle JDBC Driver. Click OK. Click for URL, and then enter
jdbc:oracle:thin:@localhost:1521:XE for Oracle XE database. Click Test. Click Test again.
Notes: Don't copy and paste in to the JDBC Url field! That may cause problems with entering valid url
string. You may need to enter appropriate driver and URL for your RDBMS
5. Verify successful connection and click OK. Click OK again. The Physical Schema screen appears.
6. On the Physical Schema screen, select ODI_STAGE1 for Schema (Schema) and Schema (Work
Schema) fields. Click Context tab. Click Add new context button. Set logical schema to
ODI_STAGE1. Click OK.
Creating a New ODI Source Model
In this section you create a new ODI source model that will be used within ODI interface.
1. Start ODI Designer: click Start > All Programs > Oracle > Oracle Data Integrator > Designer. In
Oracle Data Integrator Login screen, for Login Name select work repository WORKREP. Click OK
2. Click the Models tab within the left panel of ODI Designer, and then click Insert Model Folder
icon. In the screen that follows, enter the folder name: Oracle RDBMS1.
3. Right-click Oracle RDBMS1 model folder and select Insert model. In the screen that follows,
enter the values provided in the table below. Click Reverse tab ( don't click Reverse button!).
4. In the Reverse tab, set Context to Global. Click Reverse. The following screen will appear. Click
Yes, and then click OK.
5. Expand new Oracle RDBMS1 model folder, expand Oracle ODI_Stage1 model. Verify that the
datastore SRC_SALES_PERSON have been successfully reversed.
To create the new model for the flat file target datastore, perform the following steps:
1. Click the Models tab within the left panel of ODI Designer. Click the Insert Model Folder icon. In
the screen that appears, set the Name to Flat Files. Click OK.
Creating a New ODI target Datastore for Use With ODI Interface
1. Expand Flat Files folder, right-click the newly created Flat Files model, and then select Insert
Datastore. In the screen that appears, set Name to TRG_SALES_PERSON. Click the button next to
Resource Name field. Select file TRG_SALES_PERSON.txt and click Open.
2. Click the Files tab. Set the File Format to Fixed, and then click the Columns tab.
3. In the Columns tab click Reverse button. The following screen will appear. Click Yes. The Column
Setup Wizard will appear.
4. Drag the mouse, click at the beginning of each column and the wizard will mark each column.
5. Once the columns are marked, click on each column data and set the Name and Data Type for
each column as shown on the screenshots. For names and datatypes of each column refer to the
table below. Click OK when done.
6. The columns should look as follows. Click OK to save the model. Expand Flat Files > Flat Files >
TRG_SALES_PERSON > Columns and view the columns. Expand Oracle RDBMS1 >Oracle
ODI_STAGE1 > SRC_SALES_PERSON > Columns folder. View your source and target models.
Creating a New Interface With Oracle Data Integrator
1. In ODI Designer, click Projects tab. Expand your project ODIexp_RT_FF, and then expand First
folder. Right-click Interfaces and click Insert Interface.
2. In the screen that follows, enter interface name INTexp_RT_FF. Select the "Staging Area
Different From Target" check box and select ODI_STAGE1 from drop-down menu. Click Diagram
tab. If Help screen appears, click OK.
3. Click the Models tab to drag and drop the source and target to the designer. Drag the
SRC_SALES_PERSON datastore from the Oracle RDBMS1 into the Sources container. Drag
theTRG_SALES_PERSON.txt datastore from the Flat Files model into the Target Datastore
container. When Designer asks "Do you want to perform and Automatic Mapping?", click Yes.
The Diagram tab should look as follows. Click the Flow tab.
4. For this interface, you export a relational table into a flat file target. The KM needed for this is
the IKM SQL to File Append. To import the KM, click the Project tab in the left panel and expand
Knowledge Modules folder. Right-click Loading (LKM) and select Import Knowledge Modules.
Note: In this example, the generic SQL KM is used. However, the specific KM for the RBMS
technology could be used as well.
5. In the screen that follows, enter ..\impexp in the File import directory field as shown on the
screen below. The files to import should appear in the Select the file(s) to import window. Select
IKM SQL to File Append. Click OK.
6. Expand the Integration folder and view each imported KM in the tree view as shown below. Click
the Flow tab.
7. Click the Target (FI LE_GENERIC). This will make the properties for the target appear below. For
the IKM, click the IKM drop-down menu and select the IKM SQL to File Append. Set the IKM
option TRUNCATE to Yes, as shown below. Click Apply.
8. To test your interface click Execute. The following screen will appear. Leave the defaults and
click OK. On the next screen click OK.
9. To verify that your interface was executed successfully, you need to open the ODI Operator.
Click the ODI Operator icon on the menu to start the ODI Operator.
In ODI Operator expand: Date > Today > INTexp_RT_FF > Steps > INTexp_RT_FF, and view the
execution results for each step. Double-click the Step 3, click the Execution tab. View the number of
rows inserted in to the target file. Click OK.
10. Click the icon to return to ODI Designer. Click OK to save your newly created interface. The
Interface now shown in the Projects tree structure.
Note: If Unlocking Object Window appeared, click Yes to automatically unlock object.
You have now successfully created an ODI project and an ODI interface. You have also successfully
executed INT_RT_FF ODI interface to export a relational table to a flat file target.