Creating ODI Interface: Exporting a Flat File to a Relational Table 3

8. Create a new ODI target model that will be used within your ODI Interface. To create a new ODI target model, perform the following steps:
a. Open ODI Designer. Click the Models tab and select New Model. On the screen that appears, enter the values provided in the following table. Click the Reverse Engineer tab.





Parameter                                  Value
Name                                      Oracle_RDBMS1

Technology                                  Oracle
Logical Schema                       ODI_STAGE


b. On the Reverse Engineer tab, set the Context to Development. Click the Save button and then close the Oracle_RDBMS1 tab.




c. In the Models tab, right-click the Oracle_RDBMS1 model. Select Reverse Engineer. To verify that the TRG_SALES_PERSON datastore is successfully reversed, expand the model as shown here.






9. Create a new ODI Interface to perform a flat-file-to-RDBMS-table transformation.
a. In ODI Designer, click the Projects tab. Expand your project, Export-FF-RT, and then expand First Folder. Right-click Interfaces and select New Interface. In the Optimization Context field, select Development.


b. On the screen that follows, enter the interface name as INT-Exp-FF-RT. If selected,deselect the Staging Area Different From Target check box. Click the Mapping tab.


c. Click the Models tab to drag the source and target to the diagram. Drag the SRC_SALES_PERSON.txt datastore from the Flat_File1 model into the Sources container. Drag the TRG_SALES_PERSON datastore from the Oracle_RDBMS1
model into the Target Datastore container. When Designer asks “Do you want to perform an Automatic Mapping?” click Yes.







d. Set the value for the DATE_UPDATED column in Target Datastore to System date. In  Target Datastore, select DATE_UPDATED. In the Implementation tab, enter SYSDATE.
Select Staging Area in the Execute on section. Ensure that the Active Mapping check box is selected.



e. Select the FIRST NAME column in Target Datastore and edit the mapping to read:ltrim(SRC.FIRST_NAME). This function removes left spaces in the FIRST_NAME column. In the Execute on section, select Staging Area. Click OK. Repeat this step for columns LAST NAME and DATE HIRED. Refer to the mapping implementation provided in the following table.

Column                             Mapping implementation
FIRST NAME                Ltrim(SRC.FIRST_NAME)
LAST NAME                Ltrim(SRC.LAST_NAME)
DATE HIRED               Ltrim(SRC.DATE_HIRED)








f. For this interface, you export a flat file directly to a relational table target. The knowledge modules required for this interface are LKM File to SQL and IKM SQL Incremental Update. To import the KMs, click the Project tab in the left panel and expand the Knowledge Modules folder. Right-click Loading (LKM) and select Import Knowledge Modules.



g. In the File import directory field, you should have entered
C:\Oracle\Middleware\Oracle_ODI1\oracledi\xml-reference. Press and hold the Ctrl key, and then select IKM SQL Incremental Update and LKM File to SQL.
Click OK. Close the Import Report window. View the imported KMs in the Projects tree view.







h. Click the Flow tab. Click the SrcSet_0 (FILE GENERIC) datastore. The properties for the source appear in the following screen. For LKM, select LKM File to SQL from the LKM drop-down list if not selected. Now you need to ensure that the temporary objects created during the transformation are deleted. Set the LKM option DELETE_TEMPORARY_OBJECTS to <Default>:true as shown here.

i. Click the Target datastore. Select IKM SQL Incremental Update. Set the IKM option Flow_Control to False. Set the IKM option DELETE_ALL to True. Click Save.

No comments:

Post a Comment