Home3

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Home2

Home

Saturday, October 31, 2020

Load data from Flat File to Oracle DB

Advantage:

Using this, we can load data from  flat file to Oracle easily,

To export Flat File to Oracle DB, we have to follow below steps.

Ø  For that, we have to Create project to create a interface

Ø  We have to   import knowledge modules

Ø  we need to define the 2 Data Servers, the 2 physical schemas and associate them with the relevant logical schemas in ODI Topology Navigator.  

Ø  Need to define 2 data models & create 2 data stores.



Create project to create interface:

Go to Designer Navigator. Select new project


Import Knowledge modules:

 For this interface, It has to import a flat file into the SQL staging area, and then export the file to a different flat file. The Knowledge Modules (KMs) that are required for this are LKM File to SQL and IKM SQL to SQL Control Append. 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




Note: In this example, the generic SQL KMs are used. However, specific KMs for the RDBMS technology can be used as well.

1.     On the screen that follows, in the File Name, navigate to xml reference directory as shown in the following screenshot. Click Open. The files to import should appear in the Import Knowledge Modules window. Press and hold the CTRL key to select IKM SQL to SQL Control Append and LKM File to SQL. Click OK.




 

On Import Report window, click Close. Expand the Loading (LKM) and Integration (IKM) folders, and view each imported KM in the tree view as shown below.





 

 

Create a Data Server for FILE DB in Topology Manager

Step: 1) Open up Topology Manager and go to Physical Architecture. Right click on the File technology and select New Data Server. In the Data Server window enter a name in the Name field.



Step: 2) Go to the JDBC tab. Select the com.sunopsis.jdbc.driver.file.FileDriver  in the JDBC Driver List and jdbc url for jdbc:snps:dbfile



 Step: 3) Click on Test and make sure you get a successful connection.



Create physical schema for file DB (technology):

 

Click Topology tab. In Topology navigator, click the Physical Architecture tab, select Technologies->> File. Right-click FILE_GENERIC, and then select New Physical Schema. Enter the path to the directory, where your input flat files are located (C:\Users\Administrator\Desktop).




 

Create logical schema for file DB (technology):

Click Topology tab. In Topology navigator, click the Logical Architecture tab, select Technologies->> File. Right-click and then select New Logical Schema. Specify the name and map it with Contexts.

 

 



 

Create a Data Server for Oracle DB in Topology Manager

Step: 1) Open up Topology Manager and go to Physical Architecture. Right click on the Oracle technology and select New Data Server. In the Data Server window enter a name in the Name field.



Step: 2) Go to the JDBC tab. Select the oracle.jdbc.OracleDriver in the JDBC Driver List and JDBC URL for jdbc:oracle:thin:@190.160.0.85:1521:SAPTRAINING



Step: 3) Click on Test and make sure you get a successful connection.



Create physical schema for Oracle DB (technology):

Click Topology tab. In Topology navigator, click the Physical Architecture tab, select Technologies->> Oracle. Right-click SAP_TRAINING, and then select New Physical Schema. Enter the schema details.



Create logical schema for Oracle DB (Technology):

Click Topology tab. In Topology navigator, click the Logical Architecture tab, select Technologies->> Oracle. Right-click and then select New Logical Schema. Specify the name and map it with Contexts.



Create Data model for source DB (FILE Technology):

 

Step: 1) Go to the Designer Navigator select model tab and create new model folder for Files ,  used for easily identification.



Step: 2) Create new model for Files, used for storing tables & data stores. Specify the Name, Technology and Logical schema while creating new model.



  Create data stores for source DB (FILE Technology)

   Source: Flat File

 

Step: 1) Expand the Flat Files folder. Select text file folder, right-click and then select New Datastore. On the screen that appears, set Name to source. Click the button http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_ff-to-ff/images/The_Button.gif next to the Resource Name field. Select the Source_File.txt file and click Open.




 



Step: 2) Click the Files tab. Set the File Format to Delimited & File Separate to comma(,) and then click the Columns tab.




Step: 3) Check the Columns in the data store. Clicks save.


 

Step: 4) Expand flat file folder>text file >source (Source_File.txt) >Columns   to view your source model. Verify that the columns were successfully created as shown in the screenshot.



 

 

Create Data model & Data store for Target(Oracle DB)

 

Target: Oracle DB

Step: 1) Go to the Designer Navigator select model tab and create new model folder for Oracle DB, used for easily identification.



 

Step: 2) Create new model for Files, used for storing tables & data stores. Specify the Name, Technology and Logical schema while creating new model.



 

Step: 3) Create data stores for target DB. Expand Oracle DB folder>SAP_TRAINING. Right click & select new data store   . Then enter the data store name & add the column specified data type. Click Save.



 



 

Step: 4) Check the columns in Data store. Expand Oracle DB folder>SAP_TRAININGColumns   to view your source model. Verify that the columns were successfully created as shown in the screenshot.



 



 

Create interface for loading data from source to target table:

Step: 1) Go to Designer, click the Projects tab. Expand your project SAMPLE _WORK_ON_INTERFCAES_VTH_DIFF DB, and then expand First Folder.  Right-click interfaces and selects new Interface.



 

Step: 2) Click the Models tab. Drag the source & target data store into interface mapping. When Designer asks "Do you want to perform an Automatic Mapping?" click Yes. The Diagram tab should look as follows. Click the Quick edit tab & set primary key.





 

Step: 3) Go to flow tab. Click the source table. This makes the properties for the source appear below. In the LKM Selector section, select LKM File to SQL from the LKM drop-down list if not already selected



Step: 4) Click the target table. This makes the properties for the target appear below. This makes the properties for the target appear below. For IKM, select IKM SQL to SQL Control Append from the IKM drop-down list if not already selected. Set the IKM options create target table to true & Flow control to false as shown below. Click Save icon to save your interface.



Step: 5) To test your interface click Execute iconhttp://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_11g/odi_project_ff-to-ff/images/Execute.gif. Then following screen appears.

          


 



Step: 3) To verify that your interface was executed successfully, you need to open ODI Operator Navigator. Click the ODI Operator tab. In ODI Operator, click Session List. Expand Sessions > FLAT TO Oracle, and view the execution results for each step. Double-click any step and click the Description and Execution tabs to see the execution results. Double-click step 7. View the number of rows that are inserted into the target flat file. Click OK. Close the tabs.

 



Step: 3) Go to Oracle DB model and select target data store(Flat to Oracle).  Next right click the target data store and select the view data for output.



Note: First Target table have empty records. After execute the interface target table have 14 records



 







 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Creation of Master and Work Repositories

 Master Repository Creation:

Creating the master repository creates an empty repository structure and seeds metadata (for example, technology definitions, or built-in security profiles) into this repository structure.

Step1: First you need to create schema for Master Repository

Open the sql developer

And create new schema with the name MasterRepo

Grant the required permissions



Step2: Start the ODI Studio



Step3: To create the master repository:

Open the New Gallery by choosing File > New.

In the New Gallery, in the Categories tree, select ODI.



step4: Select from the Items list the Master Repository Creation Wizard.

Click OK.

The Master Repository Creation wizard opens.



Step 5:

Specify the Database Connection parameters as follows:

Technology: From the list, select the technology that will host your master repository. Default is Oracle.

JDBC Driver: The driver used to access the technology, that will host the repository.

JDBC URL: The URL used to establish the JDBC connection to the database.

Note that the parameters JDBC Driver and URL are synchronized and the default values are technology dependant.

User: The user ID / login of the owner of the tables (for example, odim).

Password: This user's password.

DBA User: The database administrator's username

DBA Password: This user's password




Note: It is strongly recommended that this ID is unique and not used for any other master repository, as it affects imports and exports between repositories


Step6:
Specify the Repository Configuration parameters as follows:
ID: A specific ID for the new repository, rather than the default 0.
Click Test Connection to test the connection to your master repository.

The Information dialog opens and informs you whether the connection has been established. If the connection fails, fix the connection to your master repository before moving to next step.

Click Next.

Do one of the following:




Step 7:


Select Use ODI Authentication to manage users using ODI's internal security system and enter the following supervisor login information:
Properties Description
Supervisor User User name of the ODI supervisor.
Supervisor Password This user's password
Confirm Password This user's password

 

Step 8:

In the Master Repository Creation Wizard click Finish to validate your entries.


   Work Repository Creation:

 Several work repositories can be designated with several master repositories if necessary. However, a work repository can be linked with only one master repository for version management purposes.

To create a new work repository: First create the schema for work repository

I am using sql developer to create schemas


\

 

In the Topology Navigator, go to the Repositories panel.

Right-click the Work Repositories node and select New Work Repository.





The Create Work Repository Wizard opens.

Specify the Oracle Data Integrator work repository connection details as follows:

 

Technology: Choose the technology of the server to host your work repository. Default is Oracle.

JDBC Driver: The driver used to access the technology, that will host the repository.

JDBC URL: The complete path of the data server to host the work repository.

 

Note that the parameters JDBC Driver and URL are synchronized and the default values are technology dependent

 

User: User ID / login of the owner of the tables you are going to create and host of the work repository.

Password: This user's password. This password is requested for attaching this work repository to a different master.






Specify the Oracle Data Integrator work repository properties:

 

ID: A specific ID for the new repository, rather than the default 0.

 

Note: It is strongly recommended that this ID is unique and not used for any other work repository, as it affects imports and exports between repositories

 

Click Test Connection to verify that the connection is working.

 

Click Next.