Professional Documents
Culture Documents
History:
Version Description Change Author Publish Date
0.1 0.1
25-March-2012 25-March-2012
Title
Introduction to XML Integration with ODI Creating an XML Data Server Organizing an XML Model
Create Target Table in RDBMS Oracle11g Setting up an ODI Project for Interface xml and RDBMS
1. 2. 3. 4. 5.
Page No. 3 6
11 13 15
1.Introduction to XML Integration with Oracle Data Integrator :Data integration software is designed to transfer data between many different sources, including databases and XML. It is used to perform ETL Operations. The XML stands for extensible Markup Language. XML is a meta-markup language developed to deal with a number of the shortcomings of HTML. As more functionality was added to HTML to account for the diverse needs of users of the Web. Although the original purpose of XML was as a way to mark up content, it became clear that XML also provided a way to describe structured data thus making it important as a data storage and interchange format. XML provides many advantages as a data format over others, including: 1. Built in support for internationalization due to the fact that it utilizes unicode. 2. Platform independence (for instance, no need to worry about neediness). 3. Human readable format makes it easier for developers to locate and fix errors than with previous data storage formats. 4. Extensibility in a manner that allows developers to add extra information to a format without breaking applications that where based on older versions of the format. 5. Large number of off-the-shelf tools for processing XML documents already exists.
1. XML :- The XML is a way to describe structured data there should be a means to specify the
structure of an XML document. Document Type Definitions (DTDs) and XML Schemas are different mechanisms that are used to specify valid elements that can occur in a document, the order in which they can occur and constrain certain aspects of these elements. An XML document that conforms to a DTD or schema is considered to be valid. Below is listing of the different means of constraining the contents of an XML document. 1. XML for sample :-
XML File
1). GEOGRAPHY_DIM.xml file is xml file which contain Data . 2). We can see its physical Location.
2. Document Type Definitions (DTD): DTDs were the original means of specifying the
structure of an XML document and a holdover from XML's roots as a subset of the Standardized and General Markup Language(SGML). DTDs have a different syntax from XML and are used to specify the order and occurence of elements in an XML document. Below is a DTD for the above XML fragment. DTD FOR SAMPLE XML FRAGMENT
1). GEOGRAPHY_DIM.dtd file is xml dtd file which contain Structure of Database. 2). We can see contents of file and physical Location
2.Creating an XML Data Server & Physical schema :The XML Data Server corresponds to a XML file that is accessible through network. XML files are accessed through the Oracle Data Integrator Driver for XML(which is selected by time of creating Data Server i.e JDBC Driver and JDBC URL). The JDBC driver loads the XML file hierarchical structure in a relational structure in a schema stored in memory to enable SQL queries through JDBC (Java Database Connectivity). This is also able to unload the relational structure back in the XML File. PRE-REQUISITES :JDBC Configuration XML files are accessed through the Oracle Data Integrator Driver for XML. The driver is installed with Oracle Data Integrator. Connection Information You must ask the system administrator for the following information: The location of the DTD file associated with your XML file The location of the XML file The name of the Root element of your XML file
2.1 Create Data Server for XML Technology :Creation of data server is first step of integration with ODI With any technology, so create data server for XML, follow steps Step (1) : Select Topology Navigator then select Physical Architecture panel and select technology as XML then right click and select create new data server
Create Data Server for XML 1). Topology Navigator -> 2) Physical Architecture 3)Then write click on xml and Click New Data Server
Step 2) server .
: After click on New data server editor window will open then enter : Name of data
Fig.5: Creating Data Server for XML Technology Step 3) : Select JDBC and select driver for xml then select JDBC URL and write correct path e.g <jdbc:snps:xml?f=d:/xml/GEOGRAPHY_DIM.xml&d=d:/xml/GEOGRAPHY_DIM.dtd&re= GEOGRAPHY_DIM&s=GEO&ro=false&case_sens=true> And save it.
Step 4) : Edit correct path with respect to location of file and file type i.e DTD and XML. <jdbc:snps:xml?f=d:/xml/GEOGRAPHY_DIM.xml&d=d:/xml/GEOGRAPHY_DIM.dtd&re= GEOGRAPHY_DIM&s=GEO&ro=false&case_sens=true> Then save it and test connection
Creating Physical Schema Create Data Server for XML 1). Topology Navigator -> Right click on newly created data server & select 2) Physical Architecture create new click on xml and 3)Then writephysical schema 2) Then editor will open Click New Data Server and wright the name of schema. 3)Save
Creating Logical Schema 1)Select Logical Architecture Panel in topology navigator then select technology as XML 2) Right click on xml technology and select new logical schema 3)Enter the name of schema and map with contexts. 4) Save.
3.2. Datastores under xml model :Datastores under xml model 1)Now we can view each datastores with respect to columns ,keys, constraints etc. 2) This is complete representation of source database in ODI.
10
Fig.12: XML Model xml GEO and Table CITY & contents of City(48 Rows)
11
4.
Create Table for Staging and Target :1) Create user schema 2) Then create table for staging and target with same number of columns and datatypes as desired . 3) This is empty table.
4.2)Create table in any RDBMS for staging and Target : Create Data server ,Physical schema ,Logical schema for ORACLEXML user of oracle. Then create model for user schema and get datastore in ODI.
Create Model for Oracle :1)Create Dataserver for Oracle and then physical schema 2) Then Create logical schema and mapped with contexts 3)Create model folder then model under designer navigator and apply reverser engineering and get datastores.
Fig.14: Model is creating for ORACLEXML schema
12
Datastore City for target & staging :1)We can see now its empty 2) We have to load Data from xml - Oracle
Fig.15: Target (Oracle Model Folder)-> Oracle XML Model-> Datastore CITY
13
5.
5.1 ) Setting up ODI Project and create interface for load data from xml to Oracle :
Setting up project and create interface :1)Connect to Designer Navigator then right click on project icon then create a new project 2) Then Import knowledge module :(i)LKM sql to Oracle (ii)IKM Oracle Incremental update
14
5.3) Take source and target in Interface and perform mapping 1:1
5.4) Watch the Interface flow and execute the interface and see the execution result.
15
5.5) Now data is transformed from xml table city to Oracle table city :
Fig.20 : Table City in oracle is loaded with data by xml city table
16
6.
6.1) Take a Oracle city table as a source and load it into any target among ODI supported DB
Here we are taking source as Oracle city and target Oracle city_population table
Perform join operation :1) Take source as Oracle city table 2)Target Oracle city_population table 3)Task : here we will apply join operation in column (city_name,population)-(city_population) in target table 4)As shown in diagram
Fig.21 : Source and Target table in oracle (where well perform join operation by ODI 6.2)Create Interface and drag & drop source and target in Interface respectively
Mapping Columns (S->T) :1) Now we have to map column (City_name & Population) with (city_population). 2)Code for join in target is (city.city_name||||city.population) Where city is name of table and city_name &population is column 3)Check the statements whether correct or not.
6.3) Watch Interface flow and execute the interface followed by simulate the interface :When we simulate the interface so we can see code and number of steps generated b y ODI which is using for transformation ,Simulation is very important because we can see all internal operation and codes like E$ table for errors,I$ table for loading etc.
6.4) Watch the Interface flow and execute the interface and see the execution result
Once read simulation carefully so we can aware that what code ODI is generated for transformation of interface , then execute and we can see number of steps and logs, time etc. Then see desired result in tables.
Interface Transformation - Split Operation :7.1) Now we have to perform split operation : Source table is <oracle> <city_population> and Target table is <oracle><city_split> where we have to split single column into two column.
7.
Fig.25 : Source and Target table in oracle where well perform Split operation by ODI 7.2) Create Interface and perform mapping between Source and Target : We have to split
column (city_population into city_name &population so on target side select column city_name &Population & right code respectively for split. City_Name<SUBSTR(CITY_POPULATION.CITY_POPULATION,1,INSTR(CITY_POPULATION.CITY_POPULATION,'-')-1)>
Population <SUBSTR(CITY_POPULATION.CITY_POPULATION,INSTR(CITY_POPULATION.CITY_POPULATION,'-')+1)>
Fig.26 : Source and Target table in oracle where well perform Split operation by ODI
http://learnodi.wordpress.com http://learnodi.blogspot.com http://hyperionguru.com 19
7.3) Watch Interface flow and execute the interface followed by simulate the interface: When we simulate the interface so we can see code and number of steps generated b y ODI which is using for transformation ,Simulation is very important because we can see all internal operation and codes like E$ table for errors,I$ table for loading etc.
7.4) Watch the Interface flow and execute the interface and see the execution result:
Once read simulation carefully so we can aware that what code ODI is generated for transformation of interface , then execute and we can see number of steps and logs, time etc. Then see desired result
in tables