Working with Logical Tables, Joins, and Columns 8-5
Each logical table has one or more logical columns and one or more logical table sources associated with it. You can change the logical table name, reorder the logical
table sources, and configure the logical keys, both primary and foreign.
This section contains the following topics:
■
Creating Logical Tables
■
Specifying a Primary Key in a Logical Table
■
Reviewing Foreign Keys for a Logical Table
Creating Logical Tables
Typically, you create logical tables by dragging and dropping a physical table from the Physical layer to a business model in the Business Model and Mapping layer. If a table
does not exist in your physical schema, you need to create the logical table manually.
Drag and drop operations are usually the fastest method for creating objects in the Business Model and Mapping layer. If you drag and drop physical tables from the
Physical layer to the Business Model and Mapping layer, the columns belonging to the table are also copied. After you drag and drop objects into the Business Model and
Mapping layer, you can modify them in any way necessary without affecting the objects in the Physical layer.
When you drag physical tables with key and foreign key relationships defined to a business model, logical keys and joins are created that mirror the keys and joins in the
Physical layer. This occurs only if the tables that you drag include the table with the foreign keys. Additionally, if you create new tables or subsequently drag additional
tables from the Physical layer to the Business Model and Mapping layer, the logical mappings between the new or newly dragged tables and the previously dragged
tables must be created manually.
See Defining Logical Joins with the Joins Manager
and Defining Logical Joins with
the Business Model Diagram for more information about joins.
To create a logical table by dragging and dropping: 1.
In the Administration Tool, select one or more table objects in the Physical layer. You must include the table with the foreign keys if you want to preserve the keys
and joins from the Physical layer.
2.
Drag and drop the table objects to a business model in the Business Model and Mapping layer.
When you drop them, the table objects, including the physical source mappings, are created automatically in the Business Model and Mapping layer.
To create a logical table manually: 1.
In the Business Model and Mapping layer of the Administration Tool, right-click the business model in which you want to create the table and select New Object
Logical Table .
The Logical Table dialog appears.
2.
In the General tab, type a name for the logical table.
3. If this is a lookup table, select the option Lookup table. A lookup table stores
multilingual data corresponding to rows in the base tables. See Localizing Oracle Business Intelligence in Oracle Fusion Middleware System Administrators Guide for
Oracle Business Intelligence Enterprise Edition for more information about localization and lookup tables.
8-6 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition
4.
Optionally, type a description of the table.
5. Click OK.
After creating a logical table manually, you must create all keys and joins manually.
Creating and Managing Logical Table Sources
You can add a new logical table source, edit or delete an existing table source, create or change mappings to the table source, and define when to use logical tables sources
and how content is aggregated. See Chapter 10, Managing Logical Table Sources
Mappings for instructions about how to perform these tasks.
Specifying a Primary Key in a Logical Table
After creating tables in the Business Model and Mapping layer, you specify a primary key for each dimension table. Logical dimension tables must have a logical primary
key. Logical keys can be composed of one or more logical columns.
To specify a primary key in a logical table: 1.
In the Business Model and Mapping layer of the Administration Tool, double-click a table.
2. In the Logical Table dialog, select the Keys tab and then click New.
3.
In the Logical Key dialog, type a name for the key and select the column that defines the key of the logical table.
4. Click OK.
Reviewing Foreign Keys for a Logical Table
It is recommended that you do not use foreign key joins in logical tables. If you must create these joins, you must first enable the option Allow logical foreign key join
creation in the Options dialog. See
Creating Logical Foreign Key Joins with the Joins Manager
for more information. The Foreign Keys tab of the Logical Table dialog exists so that you can view logical
foreign keys you might have had in a previous release of Oracle Business Intelligence.
Defining Logical Joins
Relationships between logical tables are expressed by logical joins. Logical joins are conceptual, rather than physical, joins. In other words, they do not join to particular
keys or columns. A single logical join can correspond to many possible physical joins.
A key property of a logical join is cardinality. Cardinality expresses how rows in one table are related to rows in the table to which it is joined. A one-to-many cardinality
means that for every row in the first logical dimension table, there are 0, 1, or many rows in the second logical table. The Administration Tool considers a table to be a
logical fact table if it is at the Many end of all logical joins that connect it to other logical tables.
Specifying the logical table joins is required so that the Oracle BI Server can have the necessary metadata to translate a logical request against the business model to SQL
Note: It is recommended that you do not specify logical keys for
logical fact tables.
Working with Logical Tables, Joins, and Columns 8-7
queries against the physical data sources. The logical join information provides the Oracle BI Server with the many-to-one relationships between the logical tables. This
logical join information is used when the Oracle BI Server generates queries against the underlying databases.
You do not need to create logical joins in the Business Model and Mapping layer if both of the following statements are true:
■
You create the logical tables by simultaneously dragging and dropping all required physical tables to the Business Model and Mapping layer.
■
The logical joins are the same as the joins in the Physical layer. However, you will probably have to create some logical joins in the Business Model
and Mapping layer, because you will rarely drag and drop all physical tables simultaneously except in very simple models.
You can create logical joins using either the Joins Manager or the Business Model Diagram. When you create a complex join in the Physical layer, you can specify
expressions and the specific columns on which to create the join. When you create a logical join in the Business Model and Mapping layer, you cannot specify expressions
or columns on which to create the join. The existence of a join in the Physical layer does not require a matching join in the Business Model and Mapping layer.
This section contains the following topics:
■
Defining Logical Joins with the Business Model Diagram
■
Defining Logical Joins with the Joins Manager
■
Specifying a Driving Table
■
Identifying Physical Tables That Map to Logical Objects
Defining Logical Joins with the Business Model Diagram
The Business Model Diagram shows logical tables and any defined joins between them. You can use the Business Model Diagram to define logical joins between tables.
To define a logical join with the Business Model Diagram: 1.
In the Administration Tool, right-click a business model and select Business Model Diagram
, then select Whole Diagram. 2.
Click the New Join button on the Administration Tool toolbar:
3.
In the Business Model Diagram, left-click the first table in the join the table representing many in the one-to-many join to select it.
Note: It is recommended that you do not have foreign keys for
logical tables. However, for backward compatibility, you can create logical foreign key joins using the Joins Manager if you select Allow
logical foreign key join creation in the Options dialog.
A logical key for a fact table must be made up of the key columns that join to the attribute tables. Logical foreign key joins may be needed if
the Oracle BI Server is to be used as an ODBC data source for certain third-party query and reporting tools.
8-8 Metadata Repository Builders Guide for Oracle Business Intelligence Enterprise Edition
4.
Move the cursor to the table to which you want to join the table representing one in the one-to-many join, and then left-click the second table to select it.
The Logical Join dialog appears.
5. Optional To specify a driving table for the key, select a table from the Driving