07 - Managing Logical Table Sources

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Adding Multiple Sources to LT

Scenario:
There are product tables that store detailed information about ABC’s products. You want to add
these tables to the Product dimension in the Business Model and Mapping layer. You import
these tables into the repository and create keys and foreign key joins for the tables.

Outcome:
D1_PRICELIST, D1_PROD_DIET_TYPES, D1_PRODUCT_SUBTYPE, D1_PRODUCT_TYPE,
and D1_SUPPLIERS tables imported into the Physical layer with associated keys and joins

Description:

1. Add physical tables to an LTS or LT.


2. If data is not duplicated then that physical table can add to LTS or LT (As a best
practice add to LTS).
3. If data is duplicated then we need to add physical table to LT. In this case we
need to define content logical level. (It is used in aggregate tables and partition
tables chapters )
Note: To add Physical table to LTS, the adding physical table and existing physical
table of LTS must have direct join.

Process:

Step 1: Import below tables into physical layer.


1. D1_PRICELIST.
2. D1_PROD_DIET_TYPES.
3. D1_PROD_SUBTYPE.
4. D1_PRODUCT_TYPE.
5. D1_SUPPLIERS.

Step 2: Create joins as per below.

1. D1_products.suppliercode = D1_suppliers.suppliercode.
2. 2. D1_products.productkey = D1_pricelist.productkey.
3. D1_products.dietcode = D1_productype.dietcode.
4. D1_products.subtypecode = D1_productsubtype.subtypecode.
5. D1_product_subtype.typecode = D1_productype.typecode.

Step 3 : Mapping multiple sources to an LTS.

1. Drag and drop D1_PROD_SUBTYPE physical table onto D1_Product LTS.


2. Similarly drag and drop
D1_PRICELIST,D1_PROD_DIET_TYPES,D1_PROD_SUBTYPE,D1_PRODUCT
_TYPE,D1_SUPPLIERS.
Step 4:
Drag and drop newly added 5 columns onto products presentation table.

Adding a New Logical Table Source

Scenario
You examine the physical sources for the Dim-Product logical table and discover that the Type
Code and Type columns are mapped to different physical tables. You also discover that the
information for both columns is stored in a common physical table, Dim_PRODUCT_TYPE.
In order to model the most economical method for Oracle BI Server to generate queries against
these two columns, you add a second logical table source to the Dim-Product logical table so
that Oracle BI Server queries only one table for the Type Code and Type columns.

In the Business Model and Mapping layer, Type is added as second logical table source for the
Dim-Product logical table.

Tasks
1. Return to the Administration Tool, which should still be open, and open the ABC repository
file in offline mode with the repository password Oracle123.
2. Examine the existing column mappings for the Type and Type Code columns.
a. In the Business Model and Mapping layer, expand the Sources folder of the Dim-
Product logical table
b. Double-click the Dim_PRODUCTS logical table source to open the Logical Table
Source dialog box.
c. Click the Column Mapping tab.
d. Notice that the Type Code logical column is mapped to the TYPECODE physical
column in Dim_PRODUCTS.
e. Notice that the Type logical column is mapped to the ITEMTYPE physical column in
Dim_PRODUCT_TYPE.
f. Click Cancel to close the Logical Table Source dialog box.
3. Determine which physical table stores information for both Type Code and Type.
a. In the Physical layer, expand the Dim_PRODUCT_TYPE physical table.
b. Verify that this table stores information for both ITEMTYPE and TYPECODE.
4. Model a new mapping for the Type Code logical column by creating a second logical table
Source for the Dim-Product logical table.
a. In the Business Model and Mapping layer, right-click the Dim-Product logical table
and select New Object > Logical Table Source.
b. On the General tab, enter Type in the Name field.
c. Click the Add button (green plus sign).
d. In the Browse dialog box, double-click the Dim_PRODUCT_TYPE physical table to
select it. The Type logical table source is now mapped to the
Dim_PRODUCT_TYPE table.

e. Click OK to close the Logical Table Source properties dialog box. Notice that the new
logical table source, Type, is added to the Sources folder.

f. Double-click the Type logical table source to view its properties.


g. Click the Column Mapping tab. Make sure that Show unmapped columns is
Selected.
h. Use the Expression field to map the Type Code logical column to the
Dim_PRODUCT_TYPE.TYPECODE physical column.
i. Repeat to map the Type logical column to the Dim_PRODUCT_TYPE.ITEMTYPE
Physical column.
j. Check your work:
k. Click OK to close the Logical Table Source dialog box. There are now two logical
table sources for the Dim-Product logical table and the Type Code logical column maps
to physical columns in both the Dim_PRODUCT_TYPE and Dim_PRODUCTS
tables.
5. Specify the aggregation content for the logical table sources. To use a source correctly,
Oracle BI Server has to know what each source contains in terms of the business model.
Therefore, you must define aggregation content for each logical table source.
a. Double-click the Dim_PRODUCTS logical table source.
b. Click the Content tab.
c. Notice that for “Aggregation content, group by” column is selected and grayed out.
Although you have the option to specify aggregation content by column or logical
level, it is recommended that you use logical levels exclusively. However, for the
purpose of demonstrating results in this practice, you define the content by
columns. Later, in the “Using Aggregates” lesson, you learn how to define
content using logical levels.
d. In the Table field, select Dim-Product.
e. In the Column field, select Product Key. When multiple logical columns could be
used, select the logical column that maps to the key of the source physical table.

f. Click OK to close the Logical Table Source dialog box.


g. Double-click the Type logical table source.
h. On the Content tab, set table to Dim-Product and column to Type Code.
i. Click OK to close the Logical Table Source dialog box.
j. Save the repository.
k. Click Yes to check consistency. If you receive any error or warning messages, fix
them before proceeding.
l. If the repository is consistent, close the repository.
m. Leave the Administration Tool open.

Create the same request as in the previous practice to check your work.
a. Create the following request:

b. Click the Results tab to view the results.

c. Examine the query log. Verify that only one table, Dim_PRODUCT_TYPE, is
accessed by the query. Because you defined the aggregation content in the logical
table sources for the Dim-Product logical table, Oracle BI Server executes its query
against the most “economical” source, which in this example is the
Dim_PRODUCT_TYPE table. To provide the best performance, BI Server
bypasses the physical joins and accesses the table directly rather through multiple
tables as in the previous example. The log should look similar to the following

You might also like