You are on page 1of 19

3) Building the Physical Layer of a Repository

In this topic you use the Oracle BI Administration Tool to build the Physical layer of a
repository.
The Physical layer defines the data sources to which Oracle BI Server submits queries and the
relationships between physical databases and other data sources that are used to process multiple
data source queries. The recommended way to populate the Physical layer is by importing
metadata from databases and other data sources. The data sources can be of the same or different
varieties. You can import schemas or portions of schemas from existing data sources.
Additionally, you can create objects in the Physical layer manually.
When you import metadata, many of the properties of the data sources are configured
automatically based on the information gathered during the import process. After import, you
can also define other attributes of the physical data sources, such as join relationships, that might
not exist in the data source metadata. There can be one or more data sources in the Physical
layer, including databases, spreadsheets, and XML documents. In this example, you import and
configure tables from the sample SH schema included with the Oracle 10g database.
To build the Physical layer, you perform the following steps:

3a Create a New Repository


3b Create an ODBC Data
Source
3c Import SH Schema
3d Create Physical Joins
3a) Create a New Repository

To create a new repository, perform the following steps:


1. Click Start > Programs > Administrative Tools > Services.

 
2. In the Services dialog box, stop the Oracle BI Server service.

 
3. Click Start > Programs > Oracle Business Intelligence > Administration to open the Oracle
BI Administration Tool.

 
4. Click File > New to open the New Repository dialog box.

 
5. In the New Repository dialog box, the Repository folder is selected by default. Name the file
SH.rpd.
 
6. Click Save. The new repository opens in the Administration Tool and displays three empty
layers: Presentation, Business Model and Mapping, and Physical. If necessary, select Tools >
Options > Show toolbar to display the toolbar.
The Physical layer is where information on physical data sources is stored. The Business Model
and Mapping layer is where measurements and terms used in business are mapped to the
physical data sources. The Presentation layer is where the business model is customized for
presentation to the user. You can work on each layer at any stage in creating a repository, but the
typical order is to create the Physical layer first, then the Business Model and Mapping layer,
and then the Presentation layer.

Leave the Administration Tool open.

3b) Create an ODBC Data Source

An ODBC data source is needed to import schema information about a data source into an
Oracle BI Server repository. To create an ODBC data source for importing the SH schema
information, perform the following steps:
1. Click Start > Programs > Administrative Tools > Data Sources (ODBC) to open the ODBC
Data Source Administrator.
 
2. Click the System DSN tab and click Add.
The Create New Data Source dialog box opens.

 
3. In the Create New Data Source dialog box, select the Oracle driver.
 
4. Click Finish to open the Oracle ODBC Driver Configuration dialog box.

5. In the Oracle ODBC Driver Configuration dialog box, enter a Data Source Name (this can be
any name), select the appropriate TNS Service Name from the drop down list (ORCL in this
example), and enter SH as the User ID for the SH schema.
 
6. Click Test Connection to open the Oracle ODBC Driver Connect dialog box.

7. In the Oracle ODBC Driver Connect dialog box, enter the password SH for the SH schema and
click OK.

 
8. You should see a "Testing Connection" message indicating the connection is successful.
 
9. Click OK to close the Testing Connection message.

10. Click OK to close the Oracle ODBC Driver Configuration dialog box.

11. Verify that the SH system data source is added in the ODBC Data Source Administrator and
click OK to close the ODBC Data Source Administrator.

3c) Import SH Schema


To import the SH schema information into the repository, perform the following steps:
1. In the Oracle BI Administration Tool, click File > Import > from Database . . .
 
2. In the Select Data Source dialog box, select the SH ODBC DSN you created in a previous step,
enter SH as the user name and password, and click OK to open the Import dialog box.

3. In the Import dialog box, locate the SH schema folder.


 
4. Expand the SH schema folder and use Ctrl + Click to select the following tables:

CHANNELS, COSTS, COUNTRIES, CUSTOMERS, PRODUCTS, PROMOTIONS,


SALES, TIMES
 
5. Verify that only the Tables and Keys checkboxes are selected, which is the default, and click the
Import button. The Connection Pool dialog box opens.

It is best practice to only import objects needed to support your business model. However, don’t
worry if you import extra objects at this point. You can always delete objects later if they do not
support your business model.

 
6. In the Connection Pool dialog box, on the General tab, verify that the call interface is set to
Default (OCI 10g) and change the data source name to the appropriate tnsnames.ora entry (
ORCL in this example). Please note that this is the TNS service name, not the ODBC DSN.
 
7. Leave the rest of the settings as they are and click OK to close the Connection Pool dialog box.
The import process starts.
8. When the Import process completes, click Close to close the Import dialog box.

9. In the Physical layer of the repository, expand the SH schema folder and verify that the correct
tables are imported.
 
10. To verify connectivity, click Tools > Update All Row Counts.

11. When update all row counts completes, verify that the row counts are displayed in the Physical
layer of the Administration Tool:

 
3d) Create Physical Joins
To create physical joins in the Physical layer of the repository, perform the following steps:
1. In the Physical layer, right-click the SH schema folder and select Physical Diagram > Object
(s) and All Joins. Alternatively, you can select the SH database object and then click the
Physical Diagram button on the toolbar.

 
2. In the Physical Diagram, if the tables are too big, right-click in the white space, select Zoom,
and adjust the size.
 
3. Rearrange the tables so they are all visible in the Physical Diagram.

 
4. Click the New Foreign Key button on the toolbar.
 
5. Click the Channels table and then the Sales table. The Physical Foreign Key dialog box opens.

It matters which table you click first. The join is creating a one-to-many (1:N) relationship that
joins the key column in the first table to a foreign key column in the second table. The
Administration Tool makes a best "guess" and automatically determines which columns should
be included in the join.

Make sure the join expression is:

CHANNELS.CHANNEL_ID = SALES.CHANNEL_ID
 
6. Click OK to close the Physical Foreign Key dialog box. The join between Channels and Sales is
displayed in the Physical Diagram.

 
7. Continue to create the following joins:

PROMOTIONS.PROMO_ID = SALES.PROMO_ID

TIMES.TIME_ID = SALES.TIME_ID

PRODUCTS.PROD_ID = SALES.PROD_ID

CUSTOMERS.CUST_ID = SALES.CUST_ID

COUNTRIES.COUNTRY_ID = CUSTOMERS.COUNTRY_ID

Note that Countries joins to Customers and Costs in not joined for now. All other tables join
directly to Sales.
When you are finished, click the X in the upper right corner to close the Physical Diagram.

 
8. Select File > Save or click the Save button on the toolbar to save the repository.

 
9. Click No when prompted to check global consistency. Checking Global Consistency checks for
errors in the entire repository. Some of the more common checks are done in the Business Model
and Mapping layer and Presentation layer. Since these layers are not defined yet, bypass this
check until the other layers in the repository are built. You learn more about consistency check
later in this tutorial.

 
10. Leave the Administration Tool and the SH repository open for the next topic.

Congratulations! You have successfully created a new repository, set up an ODBC data source,
imported a table schema from an external data source into the Physical layer, and defined keys
and joins.

In the next topic you learn how to build the Business Model and Mapping layer of a repository.

You might also like