This action might not be possible to undo. Are you sure you want to continue?
This OBE tutorial describes and shows you how to create an Oracle Data Integrator (ODI) interface that will import an XML file into a database table CLIENT. This process also involves adding an ODI constraint to the CLIENT model. Any records that do not pass the constraint will be loaded to the E_CLIENT table.
Time to Complete
Approximately 40 minutes
Oracle Data Integrator provides the ability to validate data during the load to the target using ODI constraints or database constraints. When this data is checked against a constraint using the Flow Control, any errors that are found are not loaded to the target but are loaded to an errors table that is created and managed by ODI. Each row of this table represents a record that did not pass a constraint, the row also has a message column that explains why the records were rejected. This table can be edited within ODI Designer or any other tool that can edit relational tables. However, this is not always a convenient way for the end user or business user edit the data. This example uses an ODI interface, alternatively you can build an ODI procedure that will load an XML file with a constraint.
Linda works as a database administrator for Global Enterprise. In Global Enterprise, Linda is responsible for performing database management and integration tasks on various resources within the organization. In particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects, Linda created the new Master repository and Work repository. Now Linda needs to create a project and an interface to export data from a source XML file, perform transformations, and load this data into RDMBS table using ODI constraints.
Software and Hardware Requirements
The following is a list of software requirements:
The system should include the following installed products: Oracle Database 11g Oracle Data Integrator 11gR1 If not done before, start the services and components for Oracle Database 11g
Before you start the tasks, make sure that your system environment meets the following requirements: 1 . Have installed Oracle Database 11g. If not done before, start the services and components for Oracle Database 11g 2 . Have installed Oracle Data Integrator 11gR1 3 . Before attempting this OBE, you should have successfully completed the following OBEs:
ODI11g: Creating and Connecting to ODI Master and Work Repositories.
ODI11g: Creating an ODI Project and Interface : Exporting a Flat File to a Flat File To access these OBEs, click HERE.
Creating a New Project with Oracle Data Integrator
To create a new project within Oracle Data Integrator, perform the following steps: 1. Start ODI Designer: Start > Programs > Oracle > Oracle Data Integrator > ODI Studio . Click Connect to Repository.
2. Select WORKREP1 from the Login Name drop-down list if not already selected. Enter SUPERVISOR in the User field and SUNOPSIS in the Password field. Click OK to login. In the Designer tab, click the Projects tab, click New Project icon , and then select New Project.
3. On the screen that appears, set the Name of the project to ODI_exp_XML-RT in the Name field. The Code field is
filled automatically. Click Save icon . The newly created ODI_exp_XML-RT project now appears in the Projects tree view. You have now successfully added a new ODI project.
4 . You export an XML file directly to a relational table target. The knowledge modules required for this are LKM File to SQL and IKM SQL Incremental Update. To import the KMs, expand the Project tab in the left panel, right-click the Knowledge Modules folder 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. 5 . 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 CKM SQL, IKM SQL Control Append, and LKM SQL to SQL. Click OK. Parameter Loading Integration Check Value LKM SQL to SQL IKM SQL Control Append CKM SQL
6. and view each imported KM in the tree view as shown below. Check. Expand the Loading (LKM). click Close. and Integration (IKM) folders. On Import Report window. .
click the Physical Architecture tab.1\Oracle_ODI_1\oracledi\demo\ To create new Data server and Physical schema for a new XML model.xml provided with this OBE. and extract it in your <ODI-HOME> directory. Download file DEMO. Right-click XML and select New Data Server. For example: C:\oracle\product\11. Click JDBC tab.Creating New Data Server and Physical Schema for the XML Source Model In this section you use the sample XML file GEO_DIM.zip from HERE. perform the following steps: 1 . select Technologies > XML. In Topology navigator. Name this data server XML File.1. . Click Topology tab.
click Test Connection. Enter the following JDBC URL. <ODI_HOME>/demo/xml/GEO_DIM.jdbc. select driver: com. To verify connection. Click Test and then click OK.driver.xml&re=GEOGRAPHY_DIM&ro=false&case_sens=true . In JDBC tab. click Save .xml.2 .sunopsis.SnpsXmlDriver.
Right-click XML File Data server. right-click XML and select New Logical Schema.3 . and select New Physical Schema. In Information window.Open Logical Architecture. Click Save and close the editing windows. select the your nely created physical schema in Global context as shown below. select GEO_D. . 4 . . For the Directory (Schema) and Directory (Work Schema) fields. Click Save . click OK. Enter the Logical Schema name: GEO_DIM. navigate to Technologies > XML.
create trigger.Creating RDBMS Schema/User for ODI Target Datastore You need RDBMS schema/users to host the ODI target datastore. To create the ODI target data server and physical schema. Note: If you completed the OBE " Creating an ODI Project and Interface: Exporting a Flat File to a RDBMS Table" earlier. perform the following steps: . After you created the new database target datastore. grant connect. Start SQL Developer. create view to ODI_STAGE. In this case. To create a new RDBMS schema for the ODI target datastore. you can skip this section. if you completed the OBE " Creating an ODI Project and Interface: Exporting RDBMS Table to a Flat File" earlier. resource. perform the following steps: 1 . you need to create a new ODI target data server and the Physical schema. You will create the new schema/user by executing the following SQL commands: create user ODI_STAGE identified by ODI_STAGE default tablespace users temporary tablespace temp. Creating a New ODI Target Dataserver and the Physical Schema Note: Skip this section. you should already have ODI_STAGE schema created.
Expand Technologies. right-click Oracle and select New Data Server. Parameter Value Name ODI_STAGE Instance/dblink (Data Server) ORCL User ODI_STAGE Password ODI_STAGE . Click the JDBC tab. In ODI.1. In the Data Server: New window. 2. Open ODI Topology Navigator and then select the Physical Architecture tab. enter the values provided in the table below.
This may cause problems with entering a valid URL string. Click for JDBC Url. Edit the Url to read: jdbc:oracle:thin:@localhost:1521:ORCL for Oracle Database. . Note: Do not copy and paste in the JDBC Url field.3. select jdbc:oracle:thin:@<host>:<port>:<sid>. Select Oracle JDBC Driver. Click OK. and then click OK. Click for JDBC Driver.
In the window that opens. Click Test Connection.4 . In the Information window. click OK. Click Test to verify successful connection. . Click OK. click Yes to save your data.
In Schema (Schema) and Schema (Work Schema) field enter your ODI_STAGE schema. Open Logical Architecture tab. . Right-click Oracle technology and then select New Logical Schema. 6 . Close ODI_STAGE. In the Information window. 7 . expand Technologies > Oracle. and then select New Physical Schema.ODI_STAGE physical schema window. Click Expand Oracle technology node.5 . Click Save button. right-click ODI_STAGE dataserver. click OK.
Click Save button and then close the tabs. In the Global context.8 . Name logical schema ODI_STAGE. connect this logical schema to ODI_STAGE physical schema as shown below. Creating a New ODI Source Model .
Select Reverse Engineer. Parameter Name Technology Logical Schema Value SRC_GEO_DIM_XML XML GEO_DIM 2. right-click the SCR_GEO_DIM_XML model. expand the model as shown below. To create a new ODI source model.Create a new ODI source XML model that will be used within your ODI Interface. enter the values provided in the following table. perform the following steps: 1 . . set the Context to Global . Click Models tab and select New Model. On the Reverse Engineer tab. To verify that the model is successfully reversed. In the Models tab. Open ODI Designer. Click Save button and then close the tab. 3 . On the screen that appears. Click the Reverse Engineer tab.
perform the following steps: 1 . On the screen that appears. Open ODI Designer. enter the values provided .Creating a New ODI Target Model Create a new ODI target model that will be used within your ODI Interface. To create a new ODI target model. Click Models tab and select New Model.
Parameter Name Technology Logical Schema Value RDBMS_TARGET Oracle ODI_STAGE 2 .in the following table. Click Save button and then close the tab. . Click the Reverse Engineer tab. set the Context to Global . On the Reverse Engineer tab.
click "+" to expand the RDBMS_TARGET and SRC_GEO_DIM_XML. UnderSRC_GEO_DIM_XML.3 . In the Models pane. right-click the CLIENT datastore and select Duplicate selection . Click Yes to confirm. .
it will create the physical table CLIENT. right-click the Copy of CLIENT data store within the RDBMS_Target and click Open. Change the name of the datastore to CLIENT and click Save button the tab. click No. Incase you get an Object Locking dialog box. Close Note: No physical table has been created on the RDBMS_TARGET. When the interface is run. .4 . . Next. Drag and drop the new duplicate Copy of CLIENT from the SRC_GEO_DIM_XML model to the RDBMS_TARGET model.
RightclickCITY_CLIENT CITY and click Delete. expand RDBMS_TARGET > CLIENT > Constraints > CITY Copy of CITY_CLIENT. Click Yes to confirm. In the Models tab. To set up the ODI constraint .Setting up ODI Constraint on CLIENT Datastore During the duplication of the CLIENT data store the constraint for the XML file was also copied. . You have to delete this constraint and set another constraint in CLIENT datastore. perform the following steps: 1 .
2 . Under RDBMS_TARGET > CLIENT > Constraints right-click and select New Condition. .
.age as numeric) >=21 Client must be at least 21 years old .3. In the New object window. provide the following values and then click Save Parameter Name Type Where Message Value Age_Constraint Oracle Data Integrator Condition cast(Client.
. click the Projects tab. In Optimization Context field.Creating a New ODI Interface to Perform XML File to RDBMS Table Transformation To create a new ODI Interface to perform XML file to RDBMS table transformation. In ODI Designer. select Global. Rightclick Interfaces and select New Interface. Expand your project ODI_exp_XML-RT. and then expand First Folder. pefrom the following steps: 1 .
Click Mapping tab. 3 . Set Optimization context to Global.2 . . When Designer asks “Do you want to perform an Automatic Mapping?” click Yes. On the screen that follows. Drag the CLIENT data store from the SRC_GEO_DIM_XML into the Source container and Drag the CLIENTdata store from the RDBMS_TARGET into the Target container. enter the interface name as INT-LOAD_TBL_CLIENT . Click the Models tab to drag the source and target to the diagram.
Scroll down to select the Key option. select CLIENT_ID column. Click the Flow tab. In the target datastore.4 . as shown below. .
Parameter Name Staging Area Different From Target In-Memory Engine Value INT_LOAD_TBL_CLIENT Select this option Sunopsis_Memory_Engine .5 . and make sure that the settings match those provided iin the table below. Click the flow tab. Click Definition tab again.
In the Target properties.6 . verify settings and save your interface . and then in LKM Selector. Click the Flow tab. click No. Option RECYCLE_ERRORS CREATE_TARG_TABLE Value true true . select: LKM SQL to SQL. select the following options. Note: Incase you get an Object Locking dialog box. In the Control tab. Click the Satging Area. Click the Target datastore . and then click Control tab.
On 8 . and the then click refresh button as shown below. . click Session List tab. Retain the defaults and click OK. select All Executions. . In Operator. . click Execute button the next screen. To test your interface.7. Open ODIOperator and verify that your interface was executed successfully. View execution results for interface ODI_exp_XML-RT. The following screen appears. click OK.
navigate to Administrator > Other Users > ODI_STAGE > Tables > E_CLIENT. and view error records populated in E_CLIENT error table. Double-click Step 16 and click the Execution tab.9 . Note: Optionally. . View the number of rows inserted into the error table E_CLIENT in ODI_STAGE schema. you can open SQL Developer.
and then select Data. Close Data Editor. right-click Target Datastore . Open the Interface tab. .10 . Close the tabs. View Data inserted in the target table.CLIENT. Select Mapping tab.
Summary In this tutorial. you have learned how to: Verify the Prerequisites Create a New Project with Oracle Data Integrator Create new Data server and Physical schema for a new XML model Create new RDBMS schema for the ODI target datastore Create ODI target data server and physical schema Create a new ODI XML source model Create a new ODI target model that will be used within ODI Interface Set up the ODI constraint on CLIENT target datastore Create a New Interface with Oracle Data Integrator for XML file to RDBMS table data transformation .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.