Lets Get Started with creating an Interface in ODI (11g) for writing data to a flat file from a RDBMS table.
I will try to keep the post as short as possible assuming that you guys are already familiar with the terms used in ODI.
Here I will use the scott schema to demonstrate the process.
1. Login to your Work_Repository.
2. Navigate to the Topology section.
3. Select the technology as Oracle and create a Data Server.
4. Create a Physical schema for the server.
5. Create a logical schema for the server and map it with the Physical schema on the correct context.
6. Navigate to the Designer->Models->New Model->Select Technology (Oracle)->Corresponding Schema.
7. Reverse Engineer the Table. So for our example we reverse engineer Dept table.
8.Navigate again to the Topology and Create a Data server for File.
9. Enter Name->Navigate to JDBC: Give the following inputs:
JDBC Driver: com.sunopsis.jdbc.driver.file.FileDriver
JDBC Url: jdbc:snps:dbfile
10: Save the Changes and Click on the "Test Connection". A pop up message for successful connection will be displayed.
11. Under the Data Server-> Create new physical schema.
Directory: Enter the place where you want the file to be generate ex: C:\Extracts
Work Schema: C:\Extracts.
12. Make Sure the directory exist.
13. Save Changes.
14. Create Logical Schema and map it to the physical schema.
15. Navigate to the Designer->Create a Model for File.
New->Model:
Name: Flat_File_target
technology: File
Logical_schema: The above create schema
16. Right Click on the model->New Datastore.
17. Enter the following information
Name:Department
datastore type: table
resource name: Give a name of the file that you want to be created when the interface execution is finished.
18. Navigate to the Files tab:
File Format: Delimited
Heading(Number of lines): 1
Field separator: other and enter "," (This is going to generate a comma separated file)
19. Navigate to the columns tab.
20. Give the name of the columns, keep all the type as string , physical length and logical length you can manipulate according to the requirement.
21. Keep other column as blank as they are by default.
22. Save the changes, now the Model is ready.
23. Navigate to the Project section in the Designer->Interface->New Interface.
24. Give Name to the interface and Navigate to the mapping area.
25. Select Dept Data Store from the Scott Model and Drag it to the Source Area.
26. Select the model created for the file and drag it to the target area, perform mapping.
27. Navigate back to the overview area and now you will see that "Staging area different from Target" Check box is Enabled.
28. Select the check box and select the schema (Any RDBMS schema is fine, here we will select the scott schema which the source schema for this interface).
29.Navigate to the Flow area.
30. Select Target File area, the target properties will ask for the required IKM.
31. Import IKM SQL to file Append IKM and select it.
32. Depending on the requirement you can keep the generate header as "True" or "False".
33. Save the Changes and Execute the Interface.
34. Check the status of the interface in the Operator Window, if the interface is passed.
35. Navigate to C:\Extracts folder and check that the file is generated there.
I will try to keep the post as short as possible assuming that you guys are already familiar with the terms used in ODI.
Here I will use the scott schema to demonstrate the process.
1. Login to your Work_Repository.
2. Navigate to the Topology section.
3. Select the technology as Oracle and create a Data Server.
4. Create a Physical schema for the server.
5. Create a logical schema for the server and map it with the Physical schema on the correct context.
6. Navigate to the Designer->Models->New Model->Select Technology (Oracle)->Corresponding Schema.
7. Reverse Engineer the Table. So for our example we reverse engineer Dept table.
8.Navigate again to the Topology and Create a Data server for File.
9. Enter Name->Navigate to JDBC: Give the following inputs:
JDBC Driver: com.sunopsis.jdbc.driver.file.FileDriver
JDBC Url: jdbc:snps:dbfile
10: Save the Changes and Click on the "Test Connection". A pop up message for successful connection will be displayed.
11. Under the Data Server-> Create new physical schema.
Directory: Enter the place where you want the file to be generate ex: C:\Extracts
Work Schema: C:\Extracts.
12. Make Sure the directory exist.
13. Save Changes.
14. Create Logical Schema and map it to the physical schema.
15. Navigate to the Designer->Create a Model for File.
New->Model:
Name: Flat_File_target
technology: File
Logical_schema: The above create schema
16. Right Click on the model->New Datastore.
17. Enter the following information
Name:Department
datastore type: table
resource name: Give a name of the file that you want to be created when the interface execution is finished.
18. Navigate to the Files tab:
File Format: Delimited
Heading(Number of lines): 1
Field separator: other and enter "," (This is going to generate a comma separated file)
19. Navigate to the columns tab.
20. Give the name of the columns, keep all the type as string , physical length and logical length you can manipulate according to the requirement.
21. Keep other column as blank as they are by default.
22. Save the changes, now the Model is ready.
23. Navigate to the Project section in the Designer->Interface->New Interface.
24. Give Name to the interface and Navigate to the mapping area.
25. Select Dept Data Store from the Scott Model and Drag it to the Source Area.
26. Select the model created for the file and drag it to the target area, perform mapping.
27. Navigate back to the overview area and now you will see that "Staging area different from Target" Check box is Enabled.
28. Select the check box and select the schema (Any RDBMS schema is fine, here we will select the scott schema which the source schema for this interface).
29.Navigate to the Flow area.
30. Select Target File area, the target properties will ask for the required IKM.
31. Import IKM SQL to file Append IKM and select it.
32. Depending on the requirement you can keep the generate header as "True" or "False".
33. Save the Changes and Execute the Interface.
34. Check the status of the interface in the Operator Window, if the interface is passed.
35. Navigate to C:\Extracts folder and check that the file is generated there.
No comments:
Post a Comment