Creating a Model


In the previous practice, you configured the schemas containing the application datastored in the Oracle database. You now create the Oracle Sales Application model corresponding to this data and reverse-engineer the schemas’ data structures. You also reverse-engineer the structure of an XML file to a Geographic Information model that you define.


Your Tasks:
1. Start the ODI Demo source environment: Select: Start > Programs > Oracle ODI 11g-Home> Oracle Data Integrator > Shortcut to startdemo. If the Open File – Security Warning window appears, click Run. The “Oracle DI Demo – Source” command shell window opens.




Note: You should have this command shell window running during all the labs.


2. Create a model for the Oracle schema.
a. In Designer, select the Models tab.
b. Click the New Model icon and then select New Model.

c.Specify (enter or select) the following parameters on the Definition tab:
  •  Name: Oracle Sales Application
  •  Code: ORACLE_SALES_APPLICATION
  •  Technology: Oracle
  • Logical Schema: ORACLE_ORCL_LOCAL_SALES
The Definition tab should appear as shown:

d. Click the Reverse Engineer tab, and then select Development from the Context dropdown list. Click the Save button.


3. Reverse-engineer all the tables in this model.
      a. Right-click Oracle Sales Application model and select the Reverse Engineer option. If  the Confirmation window appears, click Yes.
  Note: The progress of the reverse engineering process is shown on the status bar.

b. Verify the model reverse-engineered successfully. In the tree view, expand the Oracle Sales Application model. The datastores of the model appear.


Expand the TRG_CUSTOMER datastore, and then expand the Columns and Constraints nodes. The list of columns and constraints that were reverse engineered for this table appear in the tree view. Check that the columns and constraints that were reverse engineered for the TRG_CUSTOMER table correspond to its data definition language (DDL) given below. Close the tabs.


create table TRG_CUSTOMER (
CUST_ID                  NUMERIC(10) not null,
DEAR                        VARCHAR(4),
CUST_NAME           VARCHAR(50),
ADDRESS                VARCHAR(100),
CITY_ID                    NUMERIC(10) not null,
PHONE                    VARCHAR(50),
AGE                       NUMERIC(3),
AGE_RANGE        VARCHAR(50),
SALES_PERS       VARCHAR(50),
CRE_DATE          DATE,
UPD_DATE       DATE,
constraint PK_TRG_CUSTOMER primary key (CUST_ID),
constraint FK_CUST_CITY foreign key (CITY_ID)
references TRG_CITY (CITY_ID));
Note: The constraint called FK_SALES_CUST TRG_SALES is defined on another table.
As it references TRG_CUSTOMER, it also appears here.
4. Create a model for an XML file.
a. Click the New Model icon and then select New Model.

b. Specify (enter or select) the following parameters on the Definition tab:
  •  Name: Geographic Information
  •  Code: GEOGRAPHIC_INFORMATION
  •  Technology: XML
  •  Logical Schema: XML_DIM_GEO
c. The Definition tab should appear as below. Click the Reverse Engineer tab.


d. Select Development from the Context drop-down list. Click the Save button.


5. Reverse-engineer all the tables in this model.
a. In the Models tree view, right-click Geographic Information model and select the Reverse Engineer option.
Note: The progress of the reverse engineering process is shown on the status bar.


b. Verify that the model reverse-engineered successfully. In the tree view, expand the Geographic Information model. The datastores of the model appear.

6. Open the XML file GEO_DIM.xml corresponding to the XML model that you have reverseengineered. The file is at the following location:
C:\Oracle\Middleware\Oracle_ODI1\oracledi\demo\xml
a. Open Windows Explorer, and go to the
C:\Oracle\Middleware\Oracle_ODI1\oracledi\demo\xml directory.
b. Right-click the GEO_DIM.xml file and select Open.
c. The XML file opens in Internet Explorer. The file structure appears as shown here:

The file hierarchy is GEOGRAPHY_DIM > country > region > city > and so on..
7. Compare the XML file content with the reverse-engineered structure in the Hierarchical
view. In Designer’s tree view, expand the Geographic Information node, and then the Hierarchy node. Expand the datastores under this node.

The hierarchy of the XML file is reproduced here. The XML file has been mapped to a relational structure, with foreign keys to map the links between the different levels of hierarchy. Close the Geographic Information model tab



No comments:

Post a Comment