build repositories ag

360
Oracle BI Suite EE 10g R3: Build Repositories Activity Guide D53149GC11 Edition 1.1 March 2008 D54270 ®

Upload: ashok-thiyagarajan

Post on 08-Nov-2014

53 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Build Repositories Ag

Oracle BI Suite EE 10g R3: Build Repositories

Activity Guide

D53149GC11

Edition 1.1

March 2008

D54270

®

Page 2: Build Repositories Ag

AuthorJim Sarokin

Technical Contributors and Reviewers

Matt Bedin

Dan Hilldale

Gerry Langton

Sharonda Pettiett

Phillip Scott

Kasturi Shekhar

Krishnan Viswanathan

Kurt Wolff

EditorsAmitha NarayanRichard WallisRaj Kumar

Graphic DesignerSamir Mozumdar

PublishersMichael Sebastian AlmeidaVeena Narasimhan

Copyright © 2008, Oracle. All rights reserved.

Disclaimer

This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way. Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display, perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization of Oracle.

The information contained in this document is subject to change without notice. If you find any problems in the document, please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not warranted to be error-free.

Restricted Rights Notice

If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTSThe U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.

Trademark Notice

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Page 3: Build Repositories Ag

iii

Contents

Practice 1-1: Exploring an Oracle BI Repository..........................................................1 Solutions 1-1: Exploring an Oracle BI Repository......................................................12 Practice 2-1: ABC Business Scenario........................................................................15 Practice 2-2: Gathering Information to Build an Initial Business Model .....................23 Solutions 2-2: Gathering Information to Build an Initial Business Model ...................26 Practice 2-3: Creating a Repository and Importing a Data Source ............................29 Solutions 2-3: Creating a Repository and Importing a Data Source ..........................39 Practice 2-4: Defining Keys and Joins .......................................................................41 Solutions 2-4: Defining Keys and Joins .....................................................................45 Practice 2-5: Creating Alias and Select Tables..........................................................47 Practice 3-1: Creating the Business Model................................................................53 Solutions 3-1: Creating the Business Model ..............................................................60 Practice 3-2: Creating Simple Measures ...................................................................61 Solutions 3-2: Creating Simple Measures..................................................................64 Practice 4-1: Creating the Presentation Layer ...........................................................65 Solutions 4-1: Creating the Presentation Layer .........................................................72 Practice 5-1: Testing the Repository..........................................................................73 Solutions 5-1: Testing the Repository ........................................................................83 Practice 5-2: Checking Consistency ..........................................................................85 Solutions 5-2: Checking Consistency ........................................................................89 Practice 6-1: Enhancing the Product Dimension .......................................................91 Practice 6-2: Creating Multiple Sources for a Logical Table Source (Manual) ..........94 Solutions 6-2: Creating Multiple Sources for a Logical Table Source (Manual).........97 Practice 6-3: Creating Multiple Sources for a Logical Table Source (Automated).....98 Solutions 6-3: Creating Multiple Sources for a Logical Table Source (Automated) .102 Practice 6-4: Adding a New Logical Table Source...................................................103 Solutions 6-4: Adding a New Logical Table Source.................................................106 Practice 7-1: Creating Calculation Measures by Using Logical Columns ................107 Solutions 7-1: Creating Calculation Measures by Using Logical Columns ..............113 Practice 7-2: Creating Calculation Measures by Using Physical Columns ..............114 Solutions 7-2: Creating Calculation Measures by Using Physical Columns ............118 Practice 7-3: Creating Calculation Measures by Using the Calculation Wizard.......119

Page 4: Build Repositories Ag

iv

Solutions 7-3: Creating Calculation Measures by Using the Calculation Wizard.....125 Practice 8-1: Creating Dimension Hierarchies .........................................................127 Practice 8-2: Creating Level-Based Measures ........................................................137 Practice 8-3: Creating Share and Rank Measures ..................................................142 Practice 8-4: Creating Dimension-Specific Aggregation Rules................................147 Practice 9-1: Using Aggregate Tables .....................................................................149 Solutions 9-1: Using Aggregate Tables ...................................................................159 Practice 9-2: Using the Aggregate Persistence Wizard ...........................................160 Practice 10-1: Modeling a Value-Based Partition ....................................................169 Solutions 10-1: Modeling a Value-Based Partition...................................................177 Practice 10-2: Modeling a Fact-Based Partition.......................................................179 Practice 10-3: Using the Calculation Wizard to Create Derived Measures..............185 Practice 10-4: Modeling Fragmented Inventory Data ..............................................189 Practice 11-1: Creating Dynamic Repository Variables ...........................................199 Practice 11-2: Using Dynamic Repository Variables as Filters................................206 Practice 12-1: Creating Time Series Comparison Measures...................................211 Practice 13-1: Modeling a Bridge Table...................................................................217 Practice 13-2: Modeling a Helper Table...................................................................222 Practice 14-1: Localizing Repository Metadata........................................................229 Solutions 14-1: Localizing Repository Metadata......................................................233 Practice 15-1: Localizing Oracle BI Data .................................................................235 Solutions 15-1: Localizing Oracle BI Data ...............................................................243 Practice 16-1: Setting an Implicit Fact Column ........................................................245 Solutions 16-1: Setting an Implicit Fact Column ......................................................249 Practice 17-1: Integrating a Third-Party Reporting Tool ..........................................251 Practice 18-1 Creating a Repository Using a Multidimensional Data Source ..........257 Practice 19-1: Creating Users and Groups ..............................................................259 Solutions 19-1: Creating Users and Groups ............................................................263 Practice 19-2: Setting Permissions for Users and Groups.......................................264 Solutions 19-2: Setting Permissions for Users and Groups.....................................267 Practice 19-3: Authenticating Users Using an External Database...........................268 Practice 19-4: Authenticating Users with Database Authentication .........................272 Practice 19-5: Setting Query Limits and Timing Restrictions...................................276 Solutions 19-5: Setting Query Limits and Timing Restrictions .................................279 Practice 19-6: Setting Filters to Personalize Information .........................................280 Practice 20-1: Inspecting Cache Files .....................................................................285

Page 5: Build Repositories Ag

v

Solutions 20-1: Inspecting Cache Files....................................................................290 Practice 20-2: Modifying Cache Parameters ...........................................................292 Solutions 20-2: Modifying Cache Parameters..........................................................297 Practice 20-3: Seeding the Cache ...........................................................................299 Practice 21-1: Enabling Usage Tracking..................................................................303 Solution 21-1: Enabling Usage Tracking..................................................................308 Practice 22-1: Setting Up a Multi-User Environment ...............................................309 Practice 22-2: Using a Multi-User Development Environment.................................314 Solutions 22-2: Using a Multi-User Development Environment ...............................321 Practice 23-1: Exploring Administration Tool Features............................................323 Practice 25-1 Exploring Repository Design Principles.............................................335 (Optional) Practice: Exploring Level Keys................................................................343

Page 6: Build Repositories Ag

vi

Page 7: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 1

Practice 1-1: Exploring an Oracle BI Repository

Goal To explore the three layers of an Oracle BI repository

Scenario Before beginning the development of a repository, you use the Administration Tool to explore an existing repository to get a better understanding of its three layers and how the layers relate to one another, and to understand the link between physical data sources and the information presented in the Oracle BI Answers user interface.

Time 15–20 minutes

Instructions

1. Stop the Oracle Business Intelligence Server service. a. Double-click the Services icon on your desktop. b. Right-click the Oracle BI Server service and click Stop. c. Ensure that the status is blank, that is, the service is stopped. d. Minimize the Services window.

2. Copy the repository for this practice to the appropriate directory. a. Navigate to D:\Labs. b. Copy the ClassStart.rpd file. c. Paste the file in D:\OracleBI\server\Repository.

3. Start the Oracle BI Administration Tool and open the ClassStart repository in offline mode. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > Open > Offline. c. In the Open dialog box, double-click ClassStart.rpd. d. Log in as Administrator; no password needed.

4. Examine the properties of the ORCL database object. a. In the Physical layer, double-click the ORCL database object to view its properties. b. Click the General tab. c. What is the database platform type for this database?

d. Click the Features tab. Each database comes with a set of features that determine the SQL Oracle BI Server will issue for this database. Features can have a Boolean value (on or off), integer value, or a string value. Scroll to the right to view the Value and Default columns. The features are specified in the DBFeatures.ini file located in the

Page 8: Build Repositories Ag

Lesson 1: Repository Basics

2 Oracle BI Suite EE 10g R3: Build Repositories

D:\OracleBI\server\Config directory. If the Default check box is selected, the default SQL features are identified. Default SQL features that are supported by the database type of the data source are automatically selected.

e. Click the Connection Pools tab. This tab identifies all the connection pools associated with this database.

f. Click the Display Folders tab. Physical layer objects can be organized into display folders. When there are display folders in the Physical layer, they are listed here.

g. Click Cancel to close the Properties dialog box.

5. Explore the properties of a connection pool object. a. In the Physical layer, expand the ORCL database object. b. Double-click the SUPPLIER CP connection pool object. c. What is the call interface type for this connection pool?

The call interface is the application programming interface (API) used to access the data source. Some databases may be accessed using native APIs, some using ODBC.

d. What is the data source name for this connection pool? The data source is accessed by Oracle Call Interface (OCI). The data source name, ORCL, is a tnsnames.ora entry.

e. Click Cancel.

6. Examine the properties of a physical schema and its physical table objects. a. Expand the SUPPLIER2 schema folder to display the physical table objects in the Physical

layer. These physical table objects map to tables in the physical database.

There are more tables in the physical database. The tables displayed here are the tables that have been imported into the Physical layer. You learn more about importing tables in the lesson titled “Building the Physical Layer of a Repository.”

b. Expand D1_ORDERS2 to view the physical columns for this table. D1_ORDERS2 is the “fact” table in this business model. These columns correspond to the columns in the physical database.

Page 9: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 3

c. Right-click D1_ORDERS2 and select View Data. The first 100 rows of data for this table are

displayed.

d. Click Close. e. Double-click the D1_ORDERS2 table object to view its properties. f. Click the Columns tab to view the columns in this table. This is another way to create, view,

and modify physical columns. g. Click the Foreign Keys tab. h. Which tables have join relationships with D1_ORDERS2?

Page 10: Build Repositories Ag

Lesson 1: Repository Basics

4 Oracle BI Suite EE 10g R3: Build Repositories

i. Double-click one of the foreign keys. The Physical Foreign Key dialog box opens and displays the join relationship in the Expression field.

j. Click Cancel to close the Physical Foreign Key dialog box. k. Click Cancel to close the Physical Table dialog box. l. Right-click D1_ORDERS2 and select Physical Diagram > Object(s) and Direct Joins. The

Physical Diagram opens and displays the physical join relationships.

m. Double-click the connector between D1_CUSTOMER2 and D1_ORDERS2. The Physical

Foreign Key dialog box opens and displays the join relationship in the Expression field. This is another way to view, build, and modify joins between tables in the Physical layer.

n. Click Cancel. o. Close the Physical Diagram.

Page 11: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 5

7. Examine the properties of a physical column object. a. Expand the D1_CUSTOMER2 table object. b. Double-click the Address physical column to view the properties. c. Can this column object have null values?

d. Click Cancel.

8. Examine the properties of a logical table in the SupplierSales business model. a. If necessary, expand the SupplierSales business model in the Business Model and Mapping

layer. b. What are the logical table objects in the SupplierSales business model?

c. Expand the SalesFacts logical table to view the logical columns for this table. SalesFacts is the logical “fact” table in this business model. These columns map to columns in the Physical layer.

d. Double-click the SalesFacts logical table object. e. Click the General tab. Note that the logical columns and their corresponding properties are

listed. On this tab you can change the name of the logical table, reorder the columns, and add, edit, or remove a column.

f. Click the Sources tab. The source for this logical table is the D1_ORDERS2 table that you explored in the Physical layer. In a more complex business model, there may be many physical sources for a logical table.

g. Click the Keys tab. Typically, there are no keys defined for a logical fact table. h. Click the Foreign Keys tab. Foreign key joins are typically not used in the Business Model

and Mapping layer. All joins in the Business Model and Mapping layer are logical joins. i. Click Cancel to close the Logical Table properties dialog box.

Page 12: Build Repositories Ag

Lesson 1: Repository Basics

6 Oracle BI Suite EE 10g R3: Build Repositories

j. Right-click SalesFacts and select Business Model Diagram > Whole Diagram. The Logical Table Diagram opens and displays the logical join relationships.

k. Double-click the connector between Customers and SalesFacts. The Logical Join dialog box

opens. Note that there is no join expression in the Expression field and that there is a one-to-many relationship between the Customers logical dimension table and the SalesFacts logical fact table. You learn more about complex logical joins in the lesson titled “Building the Business Model and Mapping Layer of a Repository.”

l. Click Cancel to close the Logical Join dialog box. m. Close the Logical Table Diagram.

Page 13: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 7

9. Examine the logical table source for the SalesFacts logical table. a. Expand the Sources folder for the SalesFacts table to display the D1_ORDERS2 logical table

source for this logical table. In this example, there is only one logical table source. It is, however, possible to have many logical table sources for a single logical table.

b. Double-click the D1_ORDERS2 logical table source to view the properties. c. Click the General tab. d. Which physical table does the D1_ORDERS2 logical table source map to?

e. Click the Column Mapping tab. f. If necessary, scroll to the right to view the Physical Table column. Do all columns in the

SalesFacts logical table map to the same physical table?

g. Which physical column does the Dollars logical column map to?

h. Explain why some logical columns have names that are different from the physical columns to which they map.

i. Click the Content tab. Currently, there is no information on the tab. Later in this course, you learn how to use this tab to identify aggregation content and fragmentation content.

j. Click Cancel to close the Logical Table Source dialog box.

10. Examine the properties of a logical column in the SalesFacts logical table. a. Double-click the Dollars logical column to open the properties window. Dollars is a measure

in this business model. b. Click the General tab. This tab provides general information about the column, like the

column name, the table it belongs to, and a description of the column. c. Click the Data Type tab. d. Which physical table and physical column does the Dollars logical column map to?

e. Which logical table source does the Dollars logical column belong to?

f. Double-click the D1_ORDERS2 logical table source in this dialog box. Note that this is another way to access the Logical Table Source properties dialog box.

g. Click Cancel to close the Logical Table Source properties dialog box. h. Which aggregation rule is applied to the Dollars logical column?

Page 14: Build Repositories Ag

Lesson 1: Repository Basics

8 Oracle BI Suite EE 10g R3: Build Repositories

i. Click the Aggregation tab. Note that the default aggregation rule is set to Sum. It is common to apply aggregation rules to measures in business models. Open the aggregation rule drop-down list to see the other available aggregation rules.

j. Make sure that the Sum aggregation rule is selected and click Cancel to close the Logical

Column dialog box.

11. Examine the properties of the SupplierSales presentation catalog object. a. In the Presentation layer, double-click the SupplierSales presentation catalog to open the

Presentation Catalog properties dialog box. b. Click the General tab. Note that the presentation catalog name is the same as the business

model name. This is because the presentation catalog was created by dragging the business model from the Business Model and Mapping layer to the Presentation layer. If desired, you could use this tab to change the name of the presentation catalog. The description appears in the Answers user interface.

c. Click Permissions to open the Permissions dialog box. This shows the permissions for all users and groups in the repository. Currently, there are no users and groups defined, so the default is to give everyone read permission for this presentation catalog. You learn more about setting up security in the lesson titled “Security.”

d. Click Cancel to close the Permissions dialog box. e. Click the Presentation Tables tab to display a list of presentation tables. You can use this

tab to add, remove, edit, or change the display order of the presentation tables. f. Click the Aliases tab. If you change the name of a presentation catalog, the tool

automatically creates an alias using the previous name. You can use this tab to specify or delete an alias for a presentation folder.

g. Click Cancel to close the Presentation Catalog dialog box.

Page 15: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 9

12. Examine the properties of a presentation table in the SupplierSales presentation catalog. a. In the Presentation layer, expand SupplierSales to view the presentation tables. b. Double-click the SalesFacts table to view the properties. c. Click the General tab. You can use this tab to change the name of the presentation table. A

description would appear as a “tool tip” in the Answers user interface. d. Click the Columns tab to see a list of columns in the SalesFacts presentation table. You can

use this tab to add, remove, edit, or change the display order of the presentation columns. e. Which logical table and logical column in the Business Model and Mapping layer does the

Dollars presentation column map to?

f. Double-click Dollars to open the Presentation Column properties dialog box. This is one method for viewing and modifying presentation column properties.

g. Click Cancel to close the Presentation Column properties dialog box. h. Click Cancel to close the Presentation Table properties dialog box. i. Double-click the SupplierSalesDM presentation catalog. j. Click the General tab. Note that this presentation catalog also maps to the SupplierSales

business model. Many presentation catalogs can map to a single business model, but each presentation catalog can map to only one business model.

k. Click Cancel to close the Presentation Catalog dialog box.

13. Examine the properties of a presentation column in the SalesFacts table. a. Expand the SalesFacts presentation table. b. Double-click Dollars to open the Presentation Column properties dialog box. Note that this is

the same dialog box you saw earlier. This is another method for viewing and modifying presentation column properties.

c. Click Cancel to close the Presentation Column properties dialog box. d. Click File > Close to close the repository without saving any changes. e. Leave the Administration Tool open.

14. Modify the NQSConfig.ini file to load the ClassStart repository on Oracle BI Server startup. a. Navigate to D:\OracleBI\server\Config. b. Double-click NQSConfig.ini to open the file. c. Scroll to the REPOSITORY section. d. Modify the file to load the ClassStart repository. Your file should look similar to this:

e. Save and close NQSConfig.ini.

15. Start the Oracle BI Server service. a. Return to the Services window.

Page 16: Build Repositories Ag

Lesson 1: Repository Basics

10 Oracle BI Suite EE 10g R3: Build Repositories

b. Right-click the Oracle BI Server service and select Start. c. Wait until the status displays as Started. d. Minimize the Services window. e. Navigate to D:\OracleBI\server\Log. f. Open NQServer.log. This log file contains information about Oracle BI Server. It is

useful in diagnosing and troubleshooting Oracle BI Server startup and shutdown issues. g. Ensure that you see the message “Oracle BI Server started.” It may be necessary to scroll to

the bottom of the file. h. Close NQServer.log.

16. Examine the relationship between the columns in the Presentation layer and the columns displayed in Oracle BI Answers. a. In the Administration Tool, select File > Open > Offline. b. Double-click ClassStart.rpd. c. Click Yes to open as read-only. d. Click OK to log in as Administrator; no password needed. e. Select Start > Programs > Oracle Business Intelligence > Presentation Services. f. Log in as Administrator; no password needed. g. Click the Answers link to navigate to the Answers start page. h. What are the names of the subject areas listed on the Answers start page?

i. Which object in the repository corresponds to the SupplierSales subject area in Answers?

j. Size the windows of Answers and the Administration Tool so you can see the two applications side-by-side.

k. Click the SupplierSales subject area link on the Answers start page. l. Expand the Facts table in Answers to see the nested SalesFacts table. m. Expand the SupplierSales presentation catalog in the Administration Tool. Note that the

SupplierSales tables listed in Oracle BI Answers have the same names as the tables listed in the Presentation layer in the Administration Tool.

n. Expand the SalesFacts table in Answers. o. Expand the SalesFacts table in the Presentation layer in the Administration Tool. Note that

the column names in the Presentation layer of the Administration Tool are the same as the columns listed for the SalesFacts table in Answers.

p. Do some more exploration on your own. Examine tables and columns of the SupplierSales subject area in Answers and note how they correspond to the Presentation layer. The key point to understand is this: What you see in Answers is driven by what is defined in the repository in the Administration Tool.

17. Create a simple request. a. In Answers, expand the Customers table and select the Region column to add it to the

request criteria in the right pane.

Page 17: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 11

b. Expand Facts > SalesFacts and select the Dollars column to add it to the request.

c. Click the Results tab. The table displays the total dollars (sales) for each region.

18. Log out of Oracle Business Intelligence.

19. Close the browser.

20. In the Administration Tool, close the repository.

21. Select File > Exit to close the Administration Tool.

Page 18: Build Repositories Ag

Lesson 1: Repository Basics

12 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 1-1: Exploring an Oracle BI Repository

Answers

4.c. What is the database platform type for this database? Oracle 10gR1

5.c. What is the call interface type for this connection pool? Default (OCI 10g)

5.d. What is the data source name for this connection pool? ORCL

6.h. Which tables have join relationships with D1_ORDERS2? D1_CUSTOMER2, D1_PRODUCTS, D1_CALENDAR2

7.c. Can this column object have null values? Yes

8.b. What are the logical table objects in the SupplierSales business model? Customers, Periods, Products, SalesFacts

9.d. Which physical table does the D1_ORDERS2 logical table source map to? D1_ORDERS2

9.f. Scroll to the right to view the Physical Table column. Do all columns in the SalesFacts logical table map to the same physical table? Yes

9.g. Which physical column does the Dollars logical column map to? ACTLEXTND

9.h. Explain why some logical columns have names that are different from the physical columns to which they map. Because the names were changed in the logical (BMM) layer

10.d. Which physical table and physical column does the Dollars logical column map to? D1_ORDERS2.ACTLEXTND

10.e. Which logical table source does the Dollars logical column belong to? D1_ORDERS2

10.h. Which aggregation rule is applied to the Dollars logical column? Sum

Page 19: Build Repositories Ag

Lesson 1: Repository Basics

Oracle BI Suite EE 10g R3: Build Repositories 13

12.e. Which logical table and logical column in the Business Model and Mapping layer does the Dollars presentation column map to? SalesFacts.Dollars

16.h. What are the names of the subject areas listed on the Answers start page? SupplierSales, SupplierSalesDM

16.i. Which object in the repository corresponds to the SupplierSales subject area in Answers? SupplierSales presentation catalog

Page 20: Build Repositories Ag

Lesson 1: Repository Basics

14 Oracle BI Suite EE 10g R3: Build Repositories

Page 21: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 15

Practice 2-1: ABC Business Scenario

Goal To read the ABC document to familiarize with the business scenario for the fictitious company used throughout the course

Time 10–15 minutes

Background ABC sells food and nonfood items to restaurant chain customers throughout the United States. ABC’s product line includes food, condiments, cookware, clothing, and other miscellaneous restaurant supplies.

ABC employees currently rely on reports generated by their IT department to analyze sales and shipment data. These reports are generated monthly and therefore contain static information. ABC is looking for a way to generate dynamic, interactive reports to analyze this data in order to effectively manage its orders, monitor sales performance, and increase overall customer satisfaction. ABC recognizes the importance of a business intelligence solution that will provide its employees with the data and tools they need to query large data sets, generate reports, analyze data, identify trends, and monitor business performance.

To achieve these goals, ABC has decided to implement an Oracle Business Intelligence (BI) solution. The solution will enable its sales executives and operations managers to answer business questions that are important to running the part of the business for which they are responsible. The desired system will provide timely, up-to-date sales order data and provide sales and shipment performance monitoring, which will allow ABC to better its customer service efforts. ABC also has the vision of making this data directly available to customers, so they can analyze their purchase history better and compare it with what is being purchased nationally or regionally. This initiative is consistent with ABC’s commitment to deliver a high quality business intelligence solution that will set it apart from its competitors, and result in additional sales and revenue.

Page 22: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

16 Oracle BI Suite EE 10g R3: Build Repositories

Business Requirements You are a consultant hired by ABC to implement a business intelligence solution. From your initial interviews with the managers at ABC, you obtain the following information about ABC:

• Managers want to use their own information to ask and answer questions about the sales history of their products, the buying history of their customers, the order fulfillment performance of their operations group, and the selling performance of the sales force.

• The company has little experience in data analysis and does not expect to hire any data analysts in the future. Therefore, the managers want to be able to ask relevant questions and analyze the results themselves using an intuitive user interface.

• The database has about 350,000 invoice-level records that span the period from January 2, 1998 to April 21, 1999.

To make this kind of information widely available within the enterprise, the business intelligence solution must have a structure that is consistent with the way employees think about the business. From further interviews and an examination of the existing sample reports presenting invoice-based data, you determine the following:

• ABC employees think about their business in terms of sales, products and product hierarchies, time periods, and relationships between customers and the sales force.

• ABC employees measure product data at five levels. The product levels from the top level to the bottom (most detailed) level are:

1. Total 2. Type 3. Subtype 4. Generic Product 5. Specific Product

• ABC employees measure sales organization data at five levels. These levels mirror organizational management responsibilities. They are (in descending order):

1. Total 2. Region 3. District 4. Sales Representative 5. Customer

• ABC employees measure time data at five levels: 1. Total time 2. Year 3. Quarter 4. Month 5. Day

• Many existing reports contain data presented at these levels. An example of a report containing product data levels is:

o Total Product sales o Product Type sales: Cheese o Product Subtype sales: American Cheese o Generic Product sales: American Cheese Slices o Specific Product sales: 2 Pack American Cheese Slices 16 Slices

Page 23: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 17

In addition to these hierarchies, ABC wants to group and analyze customers using geographical attributes such as postal code, city, and state. They also want to analyze products by characteristics such as diet type and suppliers.

The most common measures used in reports are dollar sales, units ordered, units shipped, and net weight shipped. Another important measure for order fulfillment is “cuts,” that is, the difference between the units ordered and the units shipped. Operations management wants to track this because cuts equate to lost sales, and operations management is responsible for minimizing cuts.

ABC would like to analyze these measures at all levels of the hierarchies, by the important product and customer attributes, by the various time periods, and be able to compare performance with previous years.

Page 24: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

18 Oracle BI Suite EE 10g R3: Build Repositories

Source Data By interviewing ABC’s database administrators and examining the documents they provide, you learn that the source data resides in an invoice system on an Oracle database. The core data containing the business measures is stored in an invoice (orders) table.

In addition to the invoice information, there are various tables providing information about customers, the product lines, the time periods, and the relationship between customers and the company’s sales organization.

The relevant data exist in the following tables, which are part of the invoice schema:

The following are examples of data in some of the tables.

D1_PRODUCTS

Page 25: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 19

D1_PRODUCT_TYPE

D1_PRODUCT_SUBTYPE

D1_CUSTOMER2

Page 26: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

20 Oracle BI Suite EE 10g R3: Build Repositories

D1_ORDERS2

Page 27: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 21

Training Objective The primary objective of this training is to build the metadata and administer Oracle BI Server to support the business requirements of ABC. The metadata will allow ABC employees to build interactive reports and Interactive Dashboards that they can use to analyze, monitor, and manage business better, and improve overall customer satisfaction. The recommended strategy for building metadata is to use an iterative approach. Begin by building a relatively simple repository:

• Minimize the number of source tables. • Expose only stored measures with simple aggregation rules. • Use the query log to check query results. • Create presentation folders and test with Answers.

After the initial repository is built and tested, add additional features to the business model:

• Import the additional physical tables needed to support the business model. • Add calculated measures that involve operations on existing columns. • Add more complex calculated measures (for example, level-based measures and shares). • Add time series calculations (for example, percentage change in a measure compared to that

in the same period in the previous year). • Add security information. • Add aggregate table data sources to improve performance. • Localize Oracle BI metadata and data. • Configure many-to-many relationships. • Configure implicit fact columns.

In the lessons that follow, you follow this strategy to build the metadata that presents the business model to support the business requirements of ABC. At first, the metadata will include only the basic set of physical tables needed to support the initial business model. You will add more tables and complexity in future iterations.

Page 28: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

22 Oracle BI Suite EE 10g R3: Build Repositories

Page 29: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 23

Practice 2-2: Gathering Information to Build an Initial Business Model

Goal To analyze the business requirements to begin building the metadata

Scenario Before you begin building the metadata, you need to gather and analyze the business requirements of the ABC company. In this practice, you use the information provided in the ABC document that you read in the previous practice to determine the structure of the initial business model.

Outcome You identified the structure of the initial business model.

Time 10–15 minutes

Instructions

Use the information in the ABC document to help you determine the following information, which you will need to implement the initial business model.

1. What measures (facts) does ABC want to report on?

2. What hierarchies can you identify?

3. Against which attributes (dimensions) does ABC want to analyze its facts?

4. By which additional attributes does ABC want to analyze products?

Page 30: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

24 Oracle BI Suite EE 10g R3: Build Repositories

5. By which geographical attributes does ABC want to analyze data?

6. Complete the following diagram with your identified facts and dimensions:

(Facts)

(Dimension)

(Dimension) (Dimension)

Page 31: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 25

Page 32: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

26 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 2-2: Gathering Information to Build an Initial Business Model

Answers

1. What measures (facts) does ABC want to report on? Dollar sales, Units Ordered, Units Shipped, Net Weight Shipped, Cuts

2. What hierarchies can you identify? Product, Time (Period), Customer/Sales Rep

3. Against which attributes (dimensions) does ABC want to analyze its facts? Product, Time (Period), Customer

4. By which additional attributes does ABC want to analyze products? Supplier, Diet Type

5. By which geographical attributes does ABC want to analyze data? Zip Code, City, State

Page 33: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 27

6. Complete the following diagram with your identified facts and dimensions:

Sales

Time Period

Customer Product

Page 34: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

28 Oracle BI Suite EE 10g R3: Build Repositories

Page 35: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 29

Practice 2-3: Creating a Repository and Importing a Data Source

Goals To create a new repository and import the table schema from an external data source

Scenario First, you check an existing ODBC data source for an Oracle database. Then you create a new repository and import tables from the SUPPLIER2 schema into the Physical layer of the repository using the Server Administration Tool.

Outcome You have a new repository file, ABC.rpd, which contains the D1_CALENDAR2, D1_CUSTOMER2, D1_ORDERS2, and D1_PRODUCTS tables in the Physical layer.

Time 10–15 minutes

Instructions

1. Before you import tables from the SUPPLIER2 schema into the Physical layer of the repository, you examine the tables and columns defined in the database using Oracle Enterprise Manager. a. Open Internet Explorer and enter the following URL: http://<machine name>:1158>/em. b. Log in to the ORCL database as SUPPLIER2/SUPPLIER2; connect as Normal.

2. Examine the SUPPLIER2 schema. a. Click the Administration link. b. In the Schema section, under Database Objects, click Tables. c. In the Schema field, enter SUPPLIER2, if it is not entered automatically. d. Click Go.

3. Examine the properties of the D1_CALENDAR2 table in the SUPPLIER2 schema. a. Click the D1_CALENDAR2 link. b. Is there a primary key constraint defined on this table?

c. How many rows are there in this table?

d. Scroll and examine the properties of the table columns. e. Repeat this process and examine the D1_CUSTOMER2, D1_ORDERS2, and D1_PRODUCTS

tables.

Page 36: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

30 Oracle BI Suite EE 10g R3: Build Repositories

f. When you have finished the process, log out of Oracle Enterprise Manager and close the browser.

4. Create a new ABC repository file. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > New. c. To name the repository, enter ABC.rpd in the File Name field and click Save. The ABC

repository opens. Every repository contains three layers. The Physical layer is where information about the 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.

5. Import tables from the SUPPLIER2 schema to the Physical layer of the repository. a. Select File > Import from Database. b. Select the OCI 10g/11g connection type. c. In the TNS Name field, enter ORCL. d. In the User Name field, enter SUPPLIER2. e. In the Password field, enter SUPPLIER2.

f. Click OK. The Import dialog box opens. This may take a moment. g. Scroll to the SUPPLIER2 schema folder and expand it. h. Scroll to view all of the tables in the SUPPLIER2 schema. i. In the Table name mask field, enter D%. j. Contract and then reexpand the SUPPLIER2 schema. Note that by entering something in the

Table name mask field, you can filter the tables that appear for selection. The percentage sign is the wildcard character (as in SQL). The list is filtered when you reopen the container object (the SUPPLIER2 schema folder in this example). D% filters the list of tables so that

Page 37: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 31

only tables that begin with “D” are visible. The filter is case-sensitive.

k. Select the D1_CALENDAR2 table. This automatically deselects any higher-level container

objects in the tree. l. Press and hold [Ctrl] and select the remaining three tables to import to the Physical layer to

build ABC’s initial business model: D1_CUSTOMER2, D1_ORDERS2, and D1_PRODUCTS. m. Ensure that the check boxes for Tables and Keys are selected. This is the default. The check

boxes allow you to select the information to import. You can import tables, keys, foreign keys, database views, aliases, synonyms, and system tables. Import tables, aliases, synonyms, or views only if you plan to generate queries against them. That is, import only objects that are needed to support your business model. Even if you import extra objects at this point, you can delete them later if they do not support your business model.

Page 38: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

32 Oracle BI Suite EE 10g R3: Build Repositories

n. Scroll to ensure that no higher-level container objects are selected, and that only the four tables for import are selected. Your screen should look similar to the following screenshot:

o. Click Import. The Connection Pool dialog box opens. p. Change the Connection Pool name to SUPPLIER CP. q. Ensure that the call interface is set to OCI 10g/11g. r. Ensure that the data source name is ORCL. The username and password fields are

automatically populated with SUPPLIER2. The data source name, ORCL, is the same as the tnsnames.ora entry for this Oracle database instance.

Page 39: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 33

s. Click OK. The import process begins. t. When the import is complete, click Close to close the Import dialog box. u. Note that the metadata is imported into the Physical layer of the repository and the ORCL

database object appears in the Physical layer. v. To display the tables, expand the ORCL database object and then expand the SUPPLIER2

schema folder. w. Ensure that the four tables are imported successfully and that the connection pool name is

changed to SUPPLIER CP.

D1_CALENDAR2 is the table containing the period information. It contains columns that are useful in queries using time periods as the criteria for selecting and grouping data. D1_CUSTOMER2 contains customer information and D1_PRODUCTS contains product

Page 40: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

34 Oracle BI Suite EE 10g R3: Build Repositories

information for the business model. D1_ORDERS2 contains the invoice-level information needed to create the measures in the business model. As per commonly used nomenclature, D1_CALENDAR2, D1_CUSTOMER2, and D1_PRODUCTS are dimension tables and D1_ORDERS2 is a fact table. In the next practice, you create keys and joins so that the four tables form a star schema.

6. Examine the connection pool for ORCL data source. a. Double-click the SUPPLIER CP connection pool object. Recall that you provided this name

for the connection pool during the import process. Connection pools regulate access to the data source. Every data source must have at least one connection pool. A connection pool provides connections for multiple concurrent data source requests (queries), reducing the immediate overhead of connecting to a data source. Connection pools automatically queue connection requests when they exceed connection pool limits.

b. Why would you create more than one connection pool for a single data source?

c. Call interface is the application program interface with which to access the data source; Oracle Call Interface (OCI) in this example.

d. Maximum connections is the maximum number of connections allowed for this connection pool. The default is 10. Each connection consumes about 1 MB of memory.

e. Data source name is configured to access the database to which you want to connect. This value is set automatically when you import the tables to the physical layer.

f. Username and password are also configured automatically during import depending on the parameters set for the ODBC data source in the ODBC Administrator.

g. Enable connection pooling allows a single database connection to remain open for a specified time (in minutes) for use by future query requests. Connection pooling saves the overhead of opening and closing a new connection for every query. If you do not select this option, each query sent to the database opens a new connection.

h. For more information about connection pool parameters, consult the Oracle BI Server Administrator Guide or click the Help button.

i. Click OK to close the Connection Pool dialog box.

7. Examine the properties of the database object in the Physical layer. a. Right-click the ORCL database object and select Properties. You can also double-click the

object. b. Click the General tab, if not selected by default. This tab provides general information about

the data source, such as the database name, database type, and so on. c. Verify the database type is set to Oracle 10g R1. d. Click the Features tab. This tab lists features that, when selected or deselected, determine the

SQL that Oracle BI Server will issue for this database. This features table is set to the database’s default values during the schema import process. You can turn off any of these

Page 41: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 35

features if there is a reason to do so. Oracle BI Server will adjust the SQL that it sends to the database accordingly and will compensate for the deselected features with its own functionality. Note that turning a feature on when the default is “off” may or may not cause that feature to be used in the generated SQL. To use a feature, Oracle BI Server needs to know how the feature is implemented in that database platform. If it does not know, it will not use it, even though the feature is selected.

e. Click the Find button. f. In the Find field, enter INTERSECT and click OK. g. Is the INTERSECT_SUPPORTED feature implemented on this database platform?

h. Click the Find Again button to display the next feature containing the INTERSECT search string.

i. Is the INTERSECT_ALL_SUPPORTED feature implemented on this database platform?

j. Click the Connection Pools tab. This tab displays all connection pools associated with this data source. In this example, there is only one connection pool.

k. Click the Display Folders tab. You could use this tab to create folders to organize the information in the Physical layer.

l. Click OK to close the Database properties dialog box.

Page 42: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

36 Oracle BI Suite EE 10g R3: Build Repositories

8. Examine the properties of a physical table object in the Physical layer. a. Right-click D1_CALENDAR2 and select Properties. The Physical Table properties dialog box

opens. b. Click the General tab. c. Note that it is possible to rename the object using the Name field. Do not rename the object

now. d. Note that the Cacheable check box is selected by default. This determines that queries that

hit this table will be cached. You could also select Cache persistence time and use the field and drop-down list to determine the cache persistence time. This determines how long the cached queries that include this table as a source should be used to provide information to users. Ensure that the default, Cache never expires, is selected. You learn more about caching in the lesson titled “Cache Management.”

e. Note that you can select a table type from the Table Type drop-down list. Physical Table is the default and means that the object represents a physical table. You can also select Stored Proc or Select. Stored Proc is used to call a stored procedure. Select can be used when you want to create a SQL statement to represent a physical table. Leave the table type set to Physical Table.

f. Note that the Hint box is editable. This box is editable only when the database is Oracle. A hint specified here is included in all SQL that references this table.

g. Note that it is possible to add a description of the physical object. h. Click the Columns tab. i. Note that all columns and the corresponding column properties are listed on this tab. It is also

possible to add new columns. j. Select the Keys and Foreign Keys tabs. Note that no keys are created for this table. You

learn how to create keys later in this practice. k. Click Cancel to close the Physical Table properties dialog box.

9. Examine the properties of a physical column object in the Physical layer. a. Expand the D1_CALENDAR2 table object. b. Double-click any column to open the Physical Column properties dialog box. The physical

column properties include the data type of the columns and whether the column is nullable (the column can contain NULL values). The Server Administration Tool automatically selects compatible data types based on the data types of the source database.

c. Click Cancel to close the Physical Column properties dialog box.

10. Update row counts and view data. It is a good idea to update row counts or view data after an import from an Oracle data source because typically the call interface has changed from ODBC to OCI. Viewing data or updating row count, if successful, tells you that you have everything configured correctly for OCI. Note that you cannot update row counts or view data from some data sources (Access or Excel) that do not support count (distinct). a. Update the row count for all tables by selecting Tools > Update All Row Counts. This may

take a moment. In this practice you imported a small number of tables. Note that updating row counts for all tables can take a long time if you have imported many large tables. It is also possible to update row count for a single physical layer object by right-clicking the object and selecting Update Row Count.

Page 43: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 37

b. When Update All Row Counts completes, move the cursor over the tables and observe that row count information is now visible, including when the row count was last updated.

c. Expand any table. d. Move the cursor over the columns for the table and observe that row count information is

now visible. e. Right-click any table and select View Data to view the data for the table. f. Close the View Data dialog box.

11. Save the repository. a. Select File > Save or click the Save button on the toolbar. If the toolbar is not visible, select

Tools > Options > Show Toolbar. b. 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. Because these layers are not defined yet, bypass this check until the other layers in the repository are built.

12. Leave the repository open and remain logged in to the Administration Tool for the next practice.

Page 44: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

38 Oracle BI Suite EE 10g R3: Build Repositories

Page 45: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 39

Solutions 2-3: Creating a Repository and Importing a Data Source

Answers

4.b. Is there a primary key constraint defined on this table? No

4.c. How many rows are there in this table? 474

7.b. Why would you create more than one connection pool for a single data source? To give certain users more immediate access to data over others. You can affect the immediacy of access to the database by creating multiple connection pools.

8.g. Is the INTERSECT_SUPPORTED feature implemented on this database platform? Yes

8.i. Is the INTERSECT_ALL_SUPPORTED feature implemented on this database platform? No

Page 46: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

40 Oracle BI Suite EE 10g R3: Build Repositories

Page 47: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 41

Practice 2-4: Defining Keys and Joins

Goals To define the primary keys, foreign keys, and joins in the Physical layer

Scenario You have just created a new repository and imported the initial tables from the SUPPLIER2 schema to the Physical layer of the repository. Now, you must define the keys and joins that exist on the physical database in the Physical Layer of the repository. If the imported database had primary key-foreign key relationships defined and the primary keys and foreign keys were imported into the repository, then the join conditions would be set up automatically. But that is not always what you want because foreign key relationships are set in a database for only one purpose (referential integrity), which may not correspond to the purpose of the Administration Tool (knowing which joins to include in the SQL). In this database, primary keys, foreign keys, and joins have not been defined. Therefore, you need to define the keys and join conditions manually using an object’s Properties dialog box and the Physical Diagram feature of the Administration Tool.

Outcome Keys and joins defined on the physical tables

Time 15–20 minutes

Instructions

1. In this step, you define joins and keys using the Physical Diagram feature of the Administration Tool. a. Right-click the ORCL database object and select Physical Diagram > Object(s) and All

Joins to open the Physical Diagram dialog box. Alternatively, you can select the ORCL database object and then click the Physical Diagram button on the toolbar.

b. Rearrange the table objects so they are all visible. c. Click the New Foreign Key button on the toolbar. d. Click the D1_CALENDAR2 table, and then click the D1_ORDERS2 table. The Physical

Foreign Key dialog box opens. It matters which table you click first. The join creates 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.

e. Select the columns that join the tables. Select the D1_CALENDAR2.YYYYMMDD column, and then select D1_ORDERS2.PERIODKEY. Ensure that the Expression edit box (at the bottom) contains the following expression: D1_CALENDAR2.YYYYMMDD = D1_ORDERS2.PERIODKEY

f. Click OK.

Page 48: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

42 Oracle BI Suite EE 10g R3: Build Repositories

g. A prompt appears with the message: “A matching table key doesn’t exist in table ‘D1_CALENDAR2’. Do you want to create one?” Click Yes. This automatically creates a key on the YYYYMMDD column in the D1_CALENDAR2 table.

h. Observe the 1:N relationship between D1_CALENDAR2 and D1_ORDERS2 represented in the Physical Diagram view:

i. Repeat the process you just completed and create joins and keys for the other tables. Create

the joins using the following expressions as a guide: D1_CUSTOMER2.NEWKEY = D1_ORDERS2.CUSTKEY D1_PRODUCTS.PRODUCTKEY = D1_ORDERS2.PRODKEY As you create the join links, you note that the tool “guesses” at which columns to join on the basis of common names. Override the tool when necessary and check the join expressions in the Expression edit field. As you create the joins, the same message appears asking you to create a column as a “key column” on the first table, which is necessary to create the relationship to the foreign key column in the second table. When you see this message, click Yes.

2. Observe the Physical Diagram and check your work:

a. You may want to adjust the scale of the objects in the Physical Diagram. If so, right-click the

white space in the Physical Diagram window, select Zoom, and one of the zoom options. You can also use right-click to adjust the grid properties and options.

b. Close the Physical Diagram window.

3. Observe additional options for viewing the physical table diagram. a. Right-click the D1_CALENDAR2 table and select Physical Diagram > Object(s) and Direct

Joins. b. Observe the Physical Diagram:

c. Close the Physical Diagram window. d. Repeat this process for the D1_ORDERS2 table by selecting Physical Diagram > Object(s)

and Direct Joins for the D1_ORDERS2 table. Why are all the tables visible in the diagram with D1_ORDERS2?

Page 49: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 43

e. Close the Physical Diagram window.

4. Observe the changes to the physical table properties. a. Double-click the D1_ORDERS2 table to open the Physical Table properties dialog box. b. Click the Foreign Keys tab. Note that the foreign key information is visible. This

information was created automatically when you created the join expressions in the earlier steps.

c. Double-click any of the foreign key expressions and note that the Physical Foreign Key dialog box opens, displaying the join information.

d. Click Cancel to close the Physical Foreign Key dialog box. e. Click Cancel to close the Physical Table properties dialog box.

5. Click the Save button to save the ABC repository.

6. Click No when prompted to check global consistency.

7. Leave the Administration Tool open for the next practice. Congratulations! You have successfully created a new repository, imported a table schema from an external data source into the Physical layer, and defined keys and joins.

Page 50: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

44 Oracle BI Suite EE 10g R3: Build Repositories

Page 51: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 45

Solutions 2-4: Defining Keys and Joins

Answer

3.d. Why are all the tables visible in the diagram with D1_Orders2? All the tables have a one-to-many relationship with D1_Orders2.

Page 52: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

46 Oracle BI Suite EE 10g R3: Build Repositories

Page 53: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 47

Practice 2-5: Creating Alias and Select Tables

Goals To create alias and select table types, and deploy a view

Scenario You create an Order Date alias that points to the D1_CALENDAR2 table, and a RegionEast select table. You also practice deploying and undeploying a view and checking the results.

Outcome A new alias table called ORDER_DATE and a select table called RegionEast

Time 15–20 minutes

Instructions

1. Create the ORDER_DATE alias table. a. Right-click D1_CALENDAR2 and select New Object > Alias. The Alias Physical Dialog box

opens. b. Name the alias ORDER_DATE. c. Click the Columns tab. Note that alias tables inherit all column definitions from the source

table. d. Double-click any of the columns listed to open the Physical Column properties dialog box.

Note that the column is read-only and cannot be modified. e. Click Cancel to close the Physical Column dialog box. f. Click OK to close the Alias Physical Table dialog box. The alias table is added to the

Physical layer. Note the green arrow icon.

2. Create a new column in the source table and observe the results. a. Right-click D1_CALENDAR2 and select New Object > Physical Column. The Physical

Column dialog box opens. b. Name the column ALIAS_COLUMN.

Page 54: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

48 Oracle BI Suite EE 10g R3: Build Repositories

c. Leave type set to UNKNOWN and click OK. The column is added to the D1_CALENDAR2 source table.

d. Expand the ORDER_DATE alias table and ensure that the column was automatically added.

Creating a new column in a source table automatically creates the same column in all its alias tables.

e. Double-click ALIAS_COLUMN in the ORDER_DATE alias table. The Physical Column

dialog box opens. f. Ensure that the type is UNKNOWN. g. Click Cancel. h. Return to the D1_CALENDAR2 table and double-click ALIAS_COLUMN. i. Change the type to VARCHAR. j. Click OK. k. Return to the ORDER_DATE alias table and double-click ALIAS_COLUMN. l. Ensure that the type is changed to VARCHAR. Modification of a source column forces the

same changes to be reflected in the alias columns. m. Click OK. n. Return to the D1_CALENDAR2 table and delete ALIAS_COLUMN. o. Click Yes to confirm the deletion. p. Return to the ORDER_DATE table and ensure that ALIAS_COLUMN is deleted. Deletion of a

source column automatically deletes the corresponding alias columns.

3. Create a Select table. a. Right-click the D1_CUSTOMER2 table object and select Duplicate. The

D1_CUSTOMER2#1 table is created. b. Double-click D1_CUSTOMER2#1. The Physical Table dialog box opens. c. Click the General tab and rename the table RegionEast. d. Change the table type to Select. The Default Initialization String pane is enabled.

Page 55: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 49

e. In the Default Initialization String pane, enter the following SQL: Select * From D1_CUSTOMER2 Where REGION = 'East'

f. Click OK. g. Right-click the RegionEast table and select Update Row Count. h. Place the cursor over the table and ensure that there are 56 rows. i. View the data and ensure that the correct rows are returned. (Region column has the expected

value, which is East.) j. Close the View Data dialog box.

4. Before deploying the select table as a view, ensure that view deployment is supported for the database. a. Double-click the ORCL database object. b. Click the Features tab. c. Click Find. d. In the Find dialog box, enter CREATE_VIEW_SUPPORTED and click OK. e. Confirm that the Value field check box is selected for CREATE_VIEW_SUPPORTED. f. Click OK to close the ORCL database object dialog box.

5. Deploy a view. a. Save the repository without checking global consistency.

Page 56: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

50 Oracle BI Suite EE 10g R3: Build Repositories

b. Right-click the RegionEast table and select Deploy View(s). The View Deployment dialog box opens and identifies which views will be deployed.

c. Click OK. A message appears indicating that the view was successfully deployed.

d. Click OK to close the dialog box.

6. Ensure that the view is created in the database. a. Open Internet Explorer. b. In the Address field, enter http://<machine name>:1158/em to open Oracle

Enterprise Manager. You should bookmark this link for future access. c. Log in as SUPPLIER2 with password SUPPLIER2; connect as Normal. d. Click the Administration link. e. Scroll to the Schema section. f. Click the Views link. g. Click Go to search for all views in the SUPPLIER2 schema. h. Ensure that the REGIONEAST view appears.

i. Do not close Oracle Enterprise Manager.

Page 57: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 51

7. Undeploy the view. a. Return to the Administration Tool, right-click RegionEast and select Undeploy View(s).

The Undeploy View(s) dialog box appears.

b. Click Yes. A message appears indicating that the view was successfully undeployed.

c. Click OK.

8. Ensure that the view is undeployed on the database. a. Return to Oracle Enterprise Manager. b. Click Go to search for all views in the SUPPLIER2 schema. c. Ensure that no objects are found.

d. Log out of Oracle Enterprise Manager. e. Close Internet Explorer.

9. Return to the Administration Tool and delete the RegionEast select table and the ORDER_DATE alias table. You do not use either of these tables in the remaining practices.

Page 58: Build Repositories Ag

Lesson 2: Building the Physical Layer of a Repository

52 Oracle BI Suite EE 10g R3: Build Repositories

10. Save the repository without checking global consistency.

11. Close the repository.

12. Close the Administration Tool.

Page 59: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 53

Practice 3-1: Creating the Business Model

Goal To create a business model in the Business Model and Mapping layer of the repository

Scenario In the previous practice, you created the Physical layer of the repository. You are now ready to begin building the business model in the Business Model and Mapping layer of the repository. The main purpose of the business model is to capture how users think about their businesses using their own vocabulary. The business model simplifies the physical schema and maps the users’ business vocabulary to physical sources. Most of the vocabulary translates into logical columns in the business model. Collections of logical columns form logical tables. Each logical column (and, therefore, each logical table) can have one or more physical objects as sources. There are two main categories of logical tables: fact and dimension. Logical fact tables contain the measures by which ABC gauges its business operations and performance. Logical dimension tables contain the data used to qualify the facts. This practice assumes that a business model has already been designed on paper. You know what measures are important to ABC, what ABC employees compare measures to, and how the company likes to analyze its data. The goal of this practice is to capture this information in a business model in the Business Model and Mapping layer of the repository.

Outcome In the Business Model and Mapping layer, the SupplierSales business model with Periods, Customers, Products, and SalesFacts logical tables

Time 15–20 minutes

Instructions The business model that ABC has defined is based on Sales, Products, Customers, and Period data. These data elements will be used to model the initial application. The physical model you are working with now looks like this:

1. Open the ABC repository in offline mode. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > Open > Offline.

Page 60: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

54 Oracle BI Suite EE 10g R3: Build Repositories

c. Double-click ABC.rpd to open the repository file. d. Log in as Administrator. There is no need to enter a password.

2. Use your understanding of ABC’s business requirements to identify the mappings to the physical tables. Refer to prior practices if necessary. a. Which physical source table does the following data elements—customer, sales rep, district,

and region—map to?

b. Which physical source table does main product information data map to?

c. Which physical source table does invoice sales data map to?

d. Which physical source table does month codes, month names, and year data map to?

3. Create a business model in the Business Model and Mapping layer. a. Right-click the white space of the Business Model and Mapping layer and select New

Business Model. b. In the Name field, enter SupplierSales. c. Click OK. The new Business Model and Mapping folder appears in the Business Model and

Mapping layer. The red symbol on the business model indicates that it is not yet enabled for querying. You enable the business model for querying after the Presentation layer is defined and the repository passes a global consistency check.

4. Create the logical tables. a. In the Physical layer, expand the ORCL database object and expand the SUPPLIER2

schema. b. Click and Drag each of the following four tables one at a time from the Physical layer onto

the SupplierSales business model. D1_CALENDAR2 D1_CUSTOMER2 D1_ORDERS2 D1_PRODUCTS This creates logical tables in the business model with logical columns.

c. Expand the logical tables and note that a Sources folder is created for each logical table. In each Sources folder, there is a named source. For example, the named source for the D1_CALENDAR2 logical table is the D1_CALENDAR2 physical table.

Page 61: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 55

d. Note also that each logical table has a yellow table icon. In the Business Model and Mapping layer, this indicates a fact table. Because you dragged each table one at a time, all table icons are yellow. The icon color for dimension tables changes to white later when you create logical joins.

If you had dragged all four tables simultaneously from the Physical layer onto the business model, the logical keys and joins would have been created automatically in the business model. This is because the keys and join relationships were already created in the Physical layer. However, you typically do not drag all physical tables simultaneously, except in very simple models. In later steps, you manually build the necessary logical keys and joins in the Business Model and Mapping layer.

5. Rename the logical tables in the business model to make them more meaningful. a. Double-click the D1_CALENDAR2 table in the SupplierSales business model. The Logical

Table dialog box opens. b. If necessary, click the General tab. c. In the Name field, enter Periods. d. Click OK. e. Repeat the process and rename the following tables. Alternative methods for renaming

include right-clicking an object and selecting Rename, or clicking twice slowly on an object to highlight the name and making it editable. Note that logical table names are purely a business model artifact. They are not necessarily exposed to users. Table Rename to:

D1_CUSTOMER2 Customers

D1_PRODUCTS Products

D1_ORDERS2 SalesFacts

6. Delete columns that are not needed for analysis. a. Expand the SalesFacts table and then click the first column below. Then press and hold

[Ctrl] and select the remaining columns to be deleted. Columns

PRODKEY

PERIODKEY

INVNBR

CUSTKEY

DWACOSTEXTND

Page 62: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

56 Oracle BI Suite EE 10g R3: Build Repositories

REPCOSTEXTND

CMDOLRS

NULL_FIELD

b. Ensure that the SalesFacts table is not selected, before you click the Delete key. c. Click the Delete key. An alternative method is to right-click one of the selected objects and

click Delete. d. Click Yes to confirm the delete. e. Expand the Periods table and delete all columns except for the columns listed below.

Columns

DAY_IN_MONTH

DAY_IN_YEAR

DAY_NAME

FULL_GREGORIAN_DTE

MONTH

MONTHCODE

MONTH_IN_YEAR

YEAR

YYYYMMDD

f. Expand the Products table. g. Right-click the PGCODE column and select Delete. h. Click Yes to confirm the delete. i. Expand the Customers table and delete the REPNO and FACTOR columns.

7. Rename logical columns so that users can understand them better. The names you give logical columns in the business model can be exposed to client tools and end users. However, it is possible to override logical column names in the Presentation layer. Periods Table Rename As

DAY_IN_MONTH Day in Month

DAY_IN_YEAR Day in Year

DAY_NAME Day Name

FULL_GREGORIAN_DTE Date

MONTH Month

MONTHCODE Month Code

MONTH_IN_YEAR Month in Year

YEAR Year

YYYYMMDD Day

Page 63: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 57

SalesFacts Table Rename As

ACTLEXTND Dollars

NETWGHTSHPD Net Weight Shipped

UNITSHPD Units Shipped

UNITORDD Units Ordered

Customers Table Rename As

ADDRESS Address

CITY City

DISTRICT District

NAME Customer

NEWKEY Customer Key

PHONE Phone

REGION Region

ROUTECODE Route Code

SALESREP Sales Rep

STATE State

ZIP_CODE Zip Code

Products Table Rename As

DIETCODE Diet Code

GENERICDESCRIPTION Generic

PACKAGECODE Package Code

PACKAGE_WEIGHT Package Weight

PRODUCTKEY ProductKey

SPECIFICDESCRIPTIN Specific

SUBTYPECODE Subtype Code

SUPPLIERCODE Supplier Code

TYPECODE Type Code

8. In this step, you check the logical table keys. For a business model to be valid, each logical dimension table must have a logical key. Logical keys can be composed of one or more logical columns. The logical key defines the lowest level (the most detailed level) of information of any source in the logical table. In this example, the logical table keys were built automatically when you dragged the tables from the Physical layer to the business model. a. Double-click the Customers logical table in the business model. b. Click the Keys tab. c. Double-click D1_CUSTOMER2_Key. d. Ensure that the Customer Key column is defined as the key for this table.

Page 64: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

58 Oracle BI Suite EE 10g R3: Build Repositories

e. Click OK. f. Click OK. g. Repeat these steps and ensure that the Day column is defined as the logical table key for the

Periods table and ProductKey is defined as the logical table key for the Products table.

9. In this step, you create the logical table joins. Another requirement for a valid business model is that the logical tables must be joined via logical joins. Without logical joins, the Administration Tool issues a warning that it is “unable to load the navigation space” for the business model. Logical joins express the cardinality relationships between the logical tables. Logical fact tables are always at the “many” end of these cardinality relationships. Logical joins help Oracle BI Server understand the relationships between the various pieces of the business model. When a query is sent to Oracle BI Server, the server figures out how to construct physical queries by examining how the logical model is structured. Examining logical joins is an integral part of this process. a. Right-click the SupplierSales business model and select Business Model Diagram > Whole

Diagram. The Logical Table Diagram window opens. b. Rearrange the table icons so they are all visible. Right-click the white space and adjust the

zoom factor, if desired. c. Click the New Complex Join button (the yellow one) on the toolbar. d. Click the Products table icon first and then click the SalesFact table icon in the Logical

Table Diagram window. The order is important. The second table clicked is the “many” side of the relationship. The Logical Join dialog box opens.

e. Leave the default values as they are, but note which properties you can set in the Logical Join dialog box: name, business model, tables, driving table, join type, and cardinality. Also, note which properties you cannot set: the join expression and the join columns.

f. Do not change the default values and click OK. Typically, when defining logical joins, you leave the defaults as they are and click OK.

g. Repeat the process and create logical joins from the Periods table to the SalesFacts table and from the Customers table to the SalesFacts table.

h. Check your work in the Logical Table Diagram window:

i. Close the Logical Table Diagram window. j. Note that the color of the table icons for the three dimension tables has changed to white in

the business model. In a business model, a yellow icon indicates a fact table and a white icon indicates a dimension table. Defining the join relationships determined which tables are the logical dimension tables and which is the logical fact table. Recall that a fact table is always on the “many” side of a logical join. You now have a logical star schema consisting of one

Page 65: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 59

logical fact table, SalesFacts, and three logical dimension tables: Periods, Products, and Customers.

10. Save the repository.

11. Click No when prompted to check global consistency.

12. Leave the repository open for the next practice.

Page 66: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

60 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 3-1: Creating the Business Model

Answers

2.a. Which physical source table does the following data elements—customer, sales rep, district, and region—map to? D1_CUSTOMER2

2.b. Which physical source table does main product information data map to? D1_PRODUCTS

2.c. Which physical source table does invoice sales data map to? D1_ORDERS2

2.d. Which physical source table does month codes, month names, and year data map to? D1_CALENDAR2

Page 67: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 61

Practice 3-2: Creating Simple Measures

Goals To examine the logical-to-physical column mappings and create simple measures

Scenario The SupplierSales business model is now defined in the Business Model and Mapping layer. In this practice, you review the logical-to-physical table and column mappings to better understand the relationships that exist between logical tables and their logical table sources. You then create measures by setting aggregation rules for logical columns. Then you check the physical tables referenced by the business model.

Outcome Measures defined in the SalesFacts logical table

Time 15–20 minutes

Instructions

1. In this step, you examine a logical table source (LTS). Each logical table in a business model has a subfolder called Sources that contains the logical table sources. Logical table sources contain the mappings from the logical columns in the Business Model and Mapping (BMM) layer to the physical columns in the Physical layer. Every logical column maps directly (or indirectly via another logical column) to a column or columns in the Physical layer. a. Expand the Sources folder of the SalesFacts logical table. What is the name of the

logical table source for the SalesFacts table?

b. How was this logical table source created?

c. Double-click the SalesFacts logical table source, D1_ORDERS2. The Logical Table Source dialog box opens.

d. Click the General tab. By default, the logical table source name corresponds to the name of the physical table that was dragged from the Physical layer, but this name could be changed to something more meaningful. For this exercise, leave the name as is. Note also that the path to the physical table is identified.

e. Click the Column Mapping tab. If necessary, adjust the column widths and heights, or drag the entire dialog box window to make it larger or smaller.

Page 68: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

62 Oracle BI Suite EE 10g R3: Build Repositories

f. Which physical column is the Dollars logical column mapped to?

g. Which physical table is the Dollars logical column mapped to?

h. The Content tab is discussed later in this course. Click Cancel to close the dialog box.

2. In this step, you create some measures by defining default aggregation rules on logical columns defined in the SalesFacts table. Measures are typically data that is additive, such as total dollars or total quantities. The SalesFacts logical fact table contains the measures in your business model. You aggregate some of its logical columns by summing. a. Double-click the Dollars logical column in the SalesFacts table. The Logical Column

dialog box opens. b. Click the Aggregation tab. c. Set the default aggregation rule for Dollars to Sum. d. Click OK. e. Select Units Shipped, press and hold [Ctrl] and select Units Ordered and Net Weight

Shipped. f. Right-click and select Set Aggregation. g. Set the default aggregation rule to Sum.

h. Click OK. Using this method allowed you to set the same aggregation rule for multiple

columns at once. i. What happens to the logical column icons after you change the default aggregation rule to

Sum?

Page 69: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 63

3. In this step, you check which physical tables are referenced by a business model. In most situations, there will be tables that are included in the Physical layer, but not in the Business Model and Mapping layer. Only the tables referenced in the Business Model and Mapping layer, that is, only the tables included in logical table sources, are used in queries. All other physical tables are ignored when Oracle BI Server queries the physical database. a. Select Tools > Options. b. Click the General tab. c. Select Show row count in physical view. d. Click OK. e. Select the SupplierSales business model. f. Click the Physical Diagram icon on the toolbar. g. The Physical Diagram displays all the physical tables currently referenced by the

SupplierSales business model. It also displays the row count for tables with updated row counts.

h. Double-click the connector between the D1_CUSTOMER2 and the D1_ORDERS2 tables. i. Which join type is displayed, the physical or logical?

j. How did you determine which join type is displayed?

k. Click Cancel to close the join dialog box. l. Close the physical diagram.

4. Save the repository.

5. Do not check global consistency.

6. Leave the repository open for the next practice. Congratulations! You have successfully built a business model in the Business Model and Mapping layer of a repository and created business measures.

Page 70: Build Repositories Ag

Lesson 3: Building the Business Model and Mapping Layer of a Repository

64 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 3-2: Creating Simple Measures

Answers

1.a. Expand the Sources folder of the SalesFacts logical table. What is the name of the logical table source for the SalesFacts table? D1_ORDERS2

1.b. How was this logical table source created? It was created automatically during the process of dragging the D1_ORDERS2 physical table to the business model.

1.f. Which physical column is the Dollars logical column mapped to? ACTLEXTND

1.g. Which physical table is the Dollars logical column mapped to? D1_ORDERS2

2.i. What happens to the logical column icons after you change the aggregation rule to Sum? It changes to a summation symbol.

3.i. Which join is displayed, the physical or logical? Physical

3.j. How did you determine which join is displayed? There are foreign key joins.

Page 71: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 65

Practice 4-1: Creating the Presentation Layer

Goal To create the Presentation layer of a repository

Scenario You have created the initial SupplierSales business model in the repository. You now create the Presentation layer of the repository. This allows you to expose the business model to users in Oracle BI Answers so that they can build requests to analyze their data.

Outcome In the Presentation layer of the repository, there is a SupplierSales presentation catalog and a SupplierSalesDM presentation catalog.

Time 10–15 minutes

Instructions

1. In this step, you create the Presentation layer for the SupplierSales business model. The Presentation layer has three types of objects: presentation catalog, presentation table, and presentation column. In Oracle BI Answers, the catalog appears as a subject area, the presentation table appears as a folder, and the presentation columns appear as columns in the folders. The ABC repository should be open in the Administration Tool from the previous practice. a. Ensure that the Presentation layer is visible. If it is not, select View > Presentation. b. Drag the SupplierSales business model into the Presentation layer. A presentation catalog

appears with the name SupplierSales. When you create a presentation in this manner, the business model becomes a presentation catalog, the logical tables become presentation tables, and the logical columns become presentation columns. Note that all objects within a presentation catalog must derive from a single business model.

2. In this step, you examine the properties of a presentation catalog. a. Double-click the SupplierSales presentation catalog in the Presentation layer. The

Presentation Catalog properties dialog box opens. b. Click the General tab. You use this tab to create or edit a presentation catalog.

Page 72: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

66 Oracle BI Suite EE 10g R3: Build Repositories

c. Note that it is possible to change the name of the catalog. For the purpose of these lessons, leave the name as SupplierSales. This is the name that appears as a subject area in Answers. Also, as you will see in later lessons, the name of the presentation catalog can be used in the FROM clause of a logical SQL statement. Therefore, short catalog names are desirable. The tool prevents you from giving the same name to a presentation catalog and presentation table. It is also advisable to avoid using characters ($, %) that may cause illegal SQL syntax with particular client tools

d. Click the Permissions button. This dialog box is used to assign user and group permissions to this repository object. Permissions are discussed in more detail in the lesson titled “Security.”

e. Click Cancel to close the Permissions dialog box. f. The custom display name is used if you are planning to present the name in local languages.

You can ignore this for the purposes of this practice. g. Note that the business model is grayed out and cannot be modified. This is because all

objects within a presentation catalog derive from a single business model and cannot span multiple business models. After the business model is set, it cannot be changed and the tool prevents you from including objects from other business models.

h. Note that export logical keys is deselected by default. This is irrelevant to users of Answers, but may be advantageous to some query and reporting tools. If selected, columns in the Presentation layer that are key columns in the Business Model and Mapping layer will be presented as key columns to an ODBC client and will have a key icon in the Presentation layer.

i. Note that the implicit fact column is not assigned. If you set an implicit fact column, this column is added to a query when it contains columns from two or more dimension tables and no measures. It is used to specify a default join path between dimension tables when there are several possible alternatives.

j. In the Description field, enter something similar to Analyze Sales and Shipment Data. This information is visible under the corresponding subject area in Answers. You confirm this in the next set of practices.

k. Click the Presentation Tables tab.

Page 73: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 67

l. Use the Up and Down buttons or drag objects to rearrange the presentation tables into the following order:

m. Click the Aliases tab. If you change the name of a presentation catalog, the tool

automatically creates an alias using the previous name. You can use this tab to specify or delete an alias for a presentation folder.

n. Click OK to close the Presentation Catalog properties dialog box. o. Expand the SupplierSales presentation catalog and note that the order of the presentation

tables is now changed.

3. In this step, you explore the properties of a presentation table. You can use presentation tables to hold columns from multiple logical tables, thereby reducing the number of apparent logical tables. You can also use presentation tables to organize logical columns into smaller groupings, thereby increasing the number of apparent logical tables. For example, you might have a hundred measures in a logical fact table. You may want to create multiple presentation tables as containers for those measures and thus present them in an organized way (for example, all dollar measures in one folder; all unit measures in another folder). These measure folders could be nested within a single folder in the Answers user interface. a. Double-click the Customers presentation table. The Presentation Table dialog box opens. b. Click the General tab. c. Note that, by default, the presentation table name is the same as the logical table name. With

Oracle BI Answers, the name can be anything, except that it should not contain single quotation marks, double quotation marks, or the “%” sign. For client tools that generate SQL, it is advisable to avoid names that might violate valid SQL syntax. For example, avoid SQL key words, spaces, single and double quotation marks, and other characters such as “$” or “%.” A presentation table name cannot be the same as the presentation catalog name or any logical column name in that catalog. As in a presentation catalog, changing a presentation

Page 74: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

68 Oracle BI Suite EE 10g R3: Build Repositories

table name does not have any affect on the logical table name in the Business Model and Mapping layer. The Alias tab keeps a record of any changes.

d. Type a brief description in the Description field. This will show up as a “tool tip” in the Answers UI when the user places the cursor over the object. You confirm this in the next set of practices.

e. Click the Columns tab. f. Change the order of the columns, using the Up and Down buttons or by dragging, into the

following order: Columns

Region

District

Sales Rep

Customer

Address

Phone

City

State

Zip Code

Route Code

Customer Key

g. Click OK to close the Presentation Table dialog box.

4. In this step, you explore the properties of a presentation column. Presentation columns can come from multiple logical tables in a business model. By default, a presentation column uses the same name as its corresponding logical column in the Business Model and Mapping layer. If you rename the column in the Business Model and Mapping layer, corresponding presentation columns are automatically renamed wherever they appear in the Presentation layer. Even if you rename a presentation column, it does not impact the corresponding logical column in the Business Model and Mapping layer. However, as with presentation catalogs and tables, the repository stores an alias for the column using the previous name. a. Expand the Customers presentation table. b. Ensure that the columns are now in the order you specified in the previous step. c. Double-click the District column. The Presentation Column dialog box opens. d. Click the General tab. e. Deselect Use Logical Column Name. The Name field can now be edited. f. Change the column name by entering Sales District in the Name field. g. Click the Aliases tab. What is the logical column name (or alias) for this presentation

column?

h. Return to the General tab. i. Click the Edit button. The Logical Column dialog box opens.

Page 75: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 69

j. Click the General tab in the Logical Column dialog box. k. Which logical column does this presentation column map to?

l. Which business model does this presentation column map to?

m. Which logical table does this presentation column map to?

n. Click the Data Type tab. o. Which physical table and column does this presentation column map to?

p. Click OK to close the Logical Column window. q. Click OK to close the Presentation Column window

5. In this step, you simplify the content by deleting unnecessary presentation columns. You may not want to expose all the logical columns of a business model in a presentation catalog. You can delete columns from the Presentation layer safely without affecting the existence of the logical column in the Business Model and Mapping Layer. Key columns in presentation tables can be deleted, unless the client tools require that key information be provided. a. In the Presentation layer, in the Customers table, delete the Customer Key column. b. Click Yes to confirm the deletion. c. In the Products table, delete the ProductKey column d. Click Yes to confirm the deletion.

6. In this step, you create a nested folder. Nested folders are a useful way to organize the way information is presented to the user in Answers. a. Double-click the SupplierSales presentation catalog to open the Presentation Catalog

properties dialog box. b. Click the Presentation Tables tab. c. Click Add. d. In the Name field, enter Facts. e. Click OK to return to the Presentation Tables tab.

Page 76: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

70 Oracle BI Suite EE 10g R3: Build Repositories

f. Position the Facts presentation table directly above the SalesFacts presentation table.

g. Double-click SalesFacts to open the Presentation Table dialog box. h. Click the General tab. i. Add a hyphen and a space before SalesFacts in the Name field. This will nest the

SalesFacts folder under the Facts folder in Answers. Alternatively, you can enter a hyphen and a greater than sign in the Description field to achieve the same result. You ensure this in the next set of practices.

j. Click OK to close the Presentation Table dialog box. k. Click OK to close the Presentation Catalog dialog box. l. Observe that SalesFacts now appears below Facts in the SuppliersSales presentation

catalog.

7. In this step, you use the duplicate feature to create a new presentation catalog in the Presentation layer. This new presentation catalog is for ABC’s District Managers. District Managers analyze

Page 77: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

Oracle BI Suite EE 10g R3: Build Repositories 71

information required to manage their sales district, such as sales dollars and sales reps. District managers do not need to analyze any information related to ABC’s products. a. Right-click the SupplierSales presentation catalog and select Duplicate. A presentation

catalog folder appears with the name SupplierSales#1. b. Expand SupplierSales#1 and note that it contains all the same objects as the SupplierSales

presentation catalog. c. Rename the SupplierSales#1 presentation catalog to SupplierSalesDM. d. Since ABC’s district managers do not need to analyze the SupplierSales product information

in their view of the data, delete the Products presentation table from the SupplierSalesDM presentation catalog.

e. Click Yes to confirm the deletion.

8. Save the repository.

9. Click No when prompted to check global consistency.

10. Leave the repository open for the next practice. Congratulations! You have successfully built the Presentation layer of a repository.

Page 78: Build Repositories Ag

Lesson 4: Building the Presentation Layer of a Repository

72 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 4-1: Creating the Presentation Layer

Answers

4.g. Click the Aliases tab. What is the logical column name (or alias) for this presentation column? District

4.k. Which logical column does this presentation column map to? District

4.l. Which business model does this presentation column map to? SupplierSales

4.m. Which logical table does this presentation column map to? Customers

4.o. Which physical table and column does this presentation column map to? D1_CUSTOMER2.DISTRICT

Page 79: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 73

Practice 5-1: Testing the Repository

Goal To test the repository by generating some queries, retrieving the results, and examining the query log

Scenario You finished building the initial business model and now need to test the repository before continuing. You begin by checking the repository for errors using the consistency checking option. You then test the repository by running queries using Oracle BI Answers. Finally, you examine the query log file to verify the SQL generated by Oracle BI Server.

Outcome A tested and verified repository file

Time 25–35 minutes

Instructions

1. In this step, you perform a consistency test to check the repository for inconsistencies. A consistent repository has met the following requirements:

All logical columns are mapped directly or indirectly to one or more physical columns.

All logical dimension tables have a logical key.

All logical tables have a logical join relationship to another logical table.

There are at least two logical tables in the business model: one is a logical fact table, the other is logical dimension table; and both tables may map to the same physical table.

There are no circular logical join relationships.

A presentation catalog exists for the business model.

a. Select File > Check Global Consistency. A message appears indicating that the SupplierSales business model is consistent and asks if you want to make it unavailable for queries.

b. Click Yes. The Consistency Check Manager opens and displays a Warning message: The user ‘Administrator’ belongs to the ‘Administrators’ Group and has an empty password and a Best Practice message: The Physical Table '"ORCL".."SUPPLIER2"."D1_ORDERS2"' has no keys defined. Please note that your results may be slightly different.

Page 80: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

74 Oracle BI Suite EE 10g R3: Build Repositories

The Consistency Check Manager provides three types of messages: Error messages indicate errors that need to be fixed to make the repository consistent.

Warning messages indicate conditions that may or may not be errors, depending upon the intent of the Oracle BI Server administrator. For example, a warning message about a disabled join may be the result of the administrator intentionally disabling a join, such as eliminating a circular join condition.

Best Practices messages provide information about conditions but do not indicate an inconsistency, for example, “fact table does not contain a logical key.”

2. For the purposes of this training you can safely disable the Warning message and the Best Practices messages. a. Click the Options tab. b. Expand the Warnings folder. c. Expand the User folder. d. Select Search for Administrators with no Password. e. Click Disable. f. Click the Best Practices folder. g. If the Best Practices folder is already disabled, leave as is. Otherwise, click Disable. h. Click the Messages tab.

Page 81: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 75

i. Click Check All Objects. The Consistency Check Manager appears with no messages displayed, indicating that the repository is consistent.

j. Close the Consistency Check Manager. The SupplierSales business model folder has changed

from unavailable for queries to available for queries . k. Save the repository. l. Click No when prompted to check global consistency because you just checked consistency.

3. In this step, you enable query logging for the Administrator user. To test the repository, you need to generate some queries, retrieve the results, and examine the query log. You log query activity at the individual user level. Logging is intended for testing, debugging, and technical support. In production mode, logging is normally disabled because query logging can impact performance by producing very large log files. a. Select Manage > Security. b. In the left pane, select Users. The Administrator user appears in the right pane. c. In the right pane, double-click Administrator. The User dialog box opens. d. Ensure that the User tab is clicked. e. In the Logging level field, set the value to 2. f. Click OK. g. Select Action > Close to close the Security Manager window. More security-related topics

are addressed in the lesson titled “Security.” h. Save the repository. i. Click No when prompted to check consistency. j. Select File > Close to close the repository. k. Select File > Exit to exit the Server Administrator.

4. In this step, you update the Repository and Cache sections of the NQSConfig.ini initialization file. An entry in the Repository section of the initialization file instructs Oracle BI

Page 82: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

76 Oracle BI Suite EE 10g R3: Build Repositories

Server to load a specific repository into memory upon startup. If Oracle BI Server detects a syntax error while loading the repository, it logs the error to the server log file (D:\OracleBI\server\Log\NQServer.log). You also disable caching. Caching is typically not used during development, except to test the cache. You learn more about caching in the lesson titled “Cache Management.” a. Double-click D:\OracleBI\server\Config\NQSConfig.ini. b. Locate the REPOSITORY section and change the entry from Star = ClassStart.rpd,

DEFAULT; to Star = ABC.rpd, DEFAULT;. c. In the CACHE section, immediately below the REPOSITORY section, change the ENABLE

parameter from YES to NO.

d. Save the changes and close the file. e. Close or minimize Windows Explorer.

5. Start the Oracle BI Server service to load the ABC repository into memory, and ensure that the Oracle BI Presentation Server service is started. a. If the Services window is not open, double-click the Services icon on your desktop. b. If the Oracle BI Server service is already started, right-click Oracle BI Server and select

Restart. If Oracle BI Server is not started, right-click and select Start. c. If Oracle BI Presentation Server is not started, right-click and select Start. d. Ensure that the Oracle BI Server and Oracle BI Presentation Server services are started by

clicking the Refresh button until the Status column displays the value Started. e. Minimize the Services window.

6. Examine the NQServer.log file to ensure that startup is successful. a. Navigate to D:\OracleBI\server\Log. b. Double-click NQServer.log to open it. c. Locate the message “Loading repository D:\OracleBI\server\Repository\ABC.rpd.” d. Ensure that SupplierSales is the Subject Area that was loaded and note the Oracle BI

Server started message. The log should look similar to the following screenshot.

Page 83: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 77

The log file can contain messages indicating why the server startup failed. For example, if there was a syntax error in the NQSConfig.ini file, the NQServer.log file would contain messages about the syntax error. After examining the log messages, if errors were detected, you would correct the problem and start the server again.

e. Close the NQServer.log file.

7. Start Oracle BI Answers. a. Ensure that the Oracle BI Server and Oracle BI Presentation Server services are started. b. Select Start > Programs > Oracle Business Intelligence > Presentation Services. c. Log in as Administrator. There is no need to enter a password. d. Click the Answers link. e. Ensure that the description you entered for the SupplierSales presentation catalog appears

under the SupplierSales subject area. Recall that presentation catalogs appear as subject areas in Answers.

8. Execute queries to test the SupplierSales business model. In this step, you create a request showing the dollars for each sales rep in the MidAtlantic district in the year 1999. a. Click the SupplierSales subject area. b. Place the cursor over the Customers folder and ensure that the description you entered in an

earlier practice appears as a “tool tip.” c. Expand the Facts folder and ensure that SalesFacts is nested under the Facts folder.

Page 84: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

78 Oracle BI Suite EE 10g R3: Build Repositories

d. Expand the Customers table and click the Sales Rep and Sales District columns to add the columns to the request.

e. Expand the SalesFacts table and click the Dollars column to add it to the request.

f. In the Dollars column, click the Column Properties button.

g. In the Column Properties dialog box, click the Data Format tab. h. Click Override Default Data Format. i. In the Treat Number As field, select Currency. j. In the Currency Symbol field, select $. k. In the Decimal Places field, select 2. l. Select the Use 1000’s Separator check box. m. Check your work:

n. Select Save > as the system-wide default for ‘“-SalesFacts”.Dollars’.

Page 85: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 79

o. In the Dollars column, click the Order by button once to select the Order Ascending icon.

p. Expand the Periods table and press and hold [Ctrl] and select the Year column. The Create/Edit Filter dialog box opens.

q. In the Value field, enter 1999 and click OK. r. In the Sales District column, click the Add Filter button . s. Click All Choices. t. Select MidAtlantic from the list and click OK. u. Check the filters:

v. Click the Remove Column icon for the Sales District column so that this column

will not be displayed in the request results. w. Your request now includes two columns:

And two filters:

x. Click the Results tab to view the results. Ensure that the Dollars column is formatted as

expected.

y. Which sales rep in the MidAtlantic sales district produced the highest revenue (dollars) in

1999?

9. In this step, you create a request showing the dollars for each sales district in the East region for the year 1999. a. Click the Create a new request icon and select the SupplierSales subject area. b. Create the following request:

c. In the Dollars column, click the Order by icon once, to select Order Ascending

icon.

Page 86: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

80 Oracle BI Suite EE 10g R3: Build Repositories

d. Press and hold [Ctrl] and add the following filters for Year and Region:

e. Click Results.

f. Which sales district in the East region had the highest revenue (dollars) in 1999?

10. Examine the query log file. a. Select Settings > Administration > Manage Sessions. b. In the Cursor Cache section, click View Log for the last entry. c. If necessary, scroll to the bottom of the file and then scroll up to locate the last query

executed by Administrator. The log file should look similar to the following screenshot:

d. Locate the SQL Request section. This section contains the logical SQL issued from

Answers. e. Which presentation table does Sales District information come from?

f. Which presentation table does Dollars information come from?

Page 87: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 81

g. Which catalog name does the FROM clause identify?

h. What filters were applied to this request?

i. Locate the General Query Info section, just below the SQL Request section. This section identifies the repository, subject area, and presentation catalog from which the query was run.

j. Which repository (logical name) was accessed for this query?

k. Which subject area was accessed for this query?

l. Which presentation catalog was accessed for this query?

m. Locate the Sending query to database named ORCL section, just below the General Query Info section. This section identifies the physical data source to which Oracle BI Server connects.

n. Which physical tables were accessed for this query?

o. Which physical columns were accessed for this query?

p. For which physical column was an aggregation rule applied?

q. Which logical column maps to the physical column with the aggregation rule?

r. Which physical join specifications are used in this query?

s. Which physical column orders the query results?

t. Did this query complete successfully?

u. How many rows were retrieved from the database?

Page 88: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

82 Oracle BI Suite EE 10g R3: Build Repositories

v. Close the log file. w. Click Finished to close the Session Management window. x. Click Close Window to close the Oracle BI Presentation Services Administration window. y. Leave Oracle BI open for the next practice. Congratulations! You have successfully used the Consistency Check Manager, Oracle BI Answers, and the query log to test and check the repository.

Page 89: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 83

Solutions 5-1: Testing the Repository

Answers

8.y. Which sales rep in the MidAtlantic sales district produced the highest revenue (dollars) in 1999? Paula Madison

9.f. Which sales district in the East region had the highest revenue (dollars) in 1999? Yankee

10.e. Which presentation table does Sales District information come from? Customers

10.f. Which presentation table does Dollars information come from? SalesFacts

10.g. Which catalog name does the FROM clause identify? SupplierSales

10.h. What filters were applied to this request? year = 1999 and region = east

10.j. Which repository (logical name) was accessed for this query? Star

10.k. Which subject area was accessed for this query? SupplierSales

10.l. Which presentation catalog was accessed for this query? SupplierSales

10.n. Which physical tables are accessed for this query? D1_CUSTOMER2, D1_CALENDAR2, and D1_ORDERS2

10.o. Which physical columns were accessed for this query? DISTRICT and ACTLEXTND

10.p. For which physical column was an aggregation rule applied? ACTLEXTND

10.q. Which logical column maps to the physical column with the aggregation rule? SalesFact.Dollars

Page 90: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

84 Oracle BI Suite EE 10g R3: Build Repositories

10.r. Which physical join specifications are used in this query? D1_CALENDAR2.YYYYMMDD = D1_ORDERS2.PERIODKEY D1_CUSTOMER2.NEWKEY = D1_ORDERS2.CUSTKEY

10.s. The query results are ordered by which physical column? ACTLEXTND (Dollars)

10.t. Did this query complete successfully? Yes

10.u. How many rows were retrieved from the database? 4

Page 91: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 85

Practice 5-2: Checking Consistency

Goal To understand the requirements for a consistent business model

Scenario You have successfully tested the business model and made it available to end users for querying. In this practice, you modify your business model to generate an inconsistent business model. This is to further understand the requirements for troubleshooting an inconsistent business model.

Time 10–15 minutes

Instructions

1. Before modifying the repository, stop the Oracle BI Server service. a. Double-click the Services icon on your desktop. b. Right-click Oracle BI Server and select Stop. c. Ensure that Oracle BI Server stopped by checking that the Status column displays no

value. d. Minimize the Services window.

2. Make a copy of the ABC.rpd file. a. Navigate to D:\OracleBI\server\Repository. b. Right-click ABC.rpd and select Copy. c. Right-click anywhere in the right pane and select Paste. d. Rename the copied file to ABC_CHECK.rpd.

3. Open the ABC_CHECK repository in offline mode. a. Double-click ABC_CHECK.rpd to open the repository file. b. Log in as Administrator. There is no need to enter a password. c. On the title bar, ensure that you have opened ABC_CHECK.rpd.

4. Modify the business model to generate an inconsistent business model due to a missing logical join. a. In the Business Model and Mapping layer, right-click SupplierSales and select Business

Model Diagram > Whole Diagram. b. Select the join connection between the Periods and SalesFacts logical tables. c. Right-click and select Delete to create a condition in the business model where an undefined

join condition exists. d. Click Yes to confirm the delete. e. Close the Logical Table Diagram window.

Page 92: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

86 Oracle BI Suite EE 10g R3: Build Repositories

f. In the Business Model and Mapping layer, right-click SupplierSales and select Check Consistency. The Consistency Check Manager appears and displays an error message for the SupplierSales business model. The error description explains that Oracle BI Server could not load the navigation space for the subject area SupplierSales because the logical table, Periods, does not join any other logical table.

g. Click Close. h. Use the Business Model Diagram to repair the logical join. Recall that you need to create a

complex join, not a foreign key join. i. Check consistency and ensure that the business model is consistent again.

5. Modify the business model to generate an inconsistent business model due to the fact that a logical column is not mapped to a physical column. a. Expand the SupplierSales business model. b. Expand the Customers table and its corresponding Sources folder. c. Double-click the D1_CUSTOMER2 logical table source. d. Click the Column Mapping tab. e. Ensure that both Show mapped columns and Show unmapped columns are selected. f. To which physical table and physical column is the Customer logical column mapped?

g. Click the ellipsis button next to the Customer logical column to open the Expression Builder.

h. Select the expression in the Expression Builder and delete it. i. Click OK. j. Note that the Expression and Physical Table fields are now blank. k. Click OK to close the Logical Table Source dialog box. l. Right-click the SupplierSales business model and select Check Consistency. The

Consistency Check Manager appears and displays an error message for a logical column in the Customer object. The error description explains that the Customer logical column in the Customers logical table has no physical data source mapping.

m. Close the Consistency Check Manager. n. Open the Logical Table Source dialog box again and use the Expression Builder to repair the

mapping. o. Check consistency and ensure that the business model is consistent again.

6. Modify the business model to generate an inconsistent business model due to the fact that a logical dimension table does not have a logical key. a. Double-click the Customers dimension table to open the Logical Table dialog box.

Page 93: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 87

b. Click the Keys tab. c. Double-click D1_CUSTOMER2_key. d. Which column(s) is part of the logical key?

e. Click OK to close the Logical Key dialog box. f. Click Delete to delete D1_CUSTOMER2_Key. g. Click Yes to confirm delete. h. Click OK to close the Logical Table dialog box. i. Check consistency for the SupplierSales business model. The Consistency Check Manager

appears and displays an error and a warning message. The error message description explains that the logical table Customers does not have a properly defined primary key. This error would prevent Oracle BI Server from starting successfully. The warning message indicates that the logical table Customers does not have a defined key. This would not prevent Oracle BI Server from loading the repository, but should be addressed.

j. Close the Consistency Check Manager. k. Return to the Customers Logical Table dialog box and repair the key. l. Check consistency and ensure that the business model is consistent again.

7. Modify the business model to generate an inconsistent business model due to the fact that there are trailing spaces in a presentation column name. a. In the Presentation layer, expand the SupplierSalesDM presentation catalog and then expand

the Customers presentation table. b. Double-click the Sales District column. The Presentation Column dialog box opens. c. Ensure that the General tab is clicked. d. Change the column name by adding a space in front of Sales District in the Name field. e. Click OK. f. Select File > Check Global Consistency. The Consistency Check Manager appears and

displays a warning message. The warning message indicates that the presentation column Sales District in the SupplierSalesDM presentation catalog has leading or trailing spaces. This would not prevent Oracle BI Server from loading the repository, but should be addressed.

g. Close the Consistency Check Manager. h. In the Business Model and Mapping layer, right-click SupplierSales and select Check

Consistency.

Page 94: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

88 Oracle BI Suite EE 10g R3: Build Repositories

i. Why is it that you do not see the error message relating to SupplierSalesDM having leading or trailing spaces in it?

j. Close the Consistency Check Manager. k. Return to the SupplierSalesDM presentation catalog and repair the Sales District column.

Make sure that you click the Aliases tab and delete the Sales District alias.

8. Close the ABC_CHECK repository without saving. You do not use this repository in any of the remaining practices.

9. Close the Oracle BI Administration Tool.

Page 95: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

Oracle BI Suite EE 10g R3: Build Repositories 89

Solutions 5-2: Checking Consistency

Answers

5.f. To which physical table and physical column is the Customer logical column mapped? table = D1_CUSTOMER2, column = NAME

6.d. Which column(s) is part of the logical key? CustomerKey

7.i. Why is it that you do not see the error message relating to SupplierSalesDM having leading or trailing spaces in it? The consistency check from the Business Model and Mapping layer checks only for errors associated with the subject area that you have selected, such as finding logical columns that are not mapped to physical sources, checking for undefined logical join conditions, and determining if physical tables referenced in a business model are not joined to tables referenced in the business model. Global consistency checks verify the entire repository.

Page 96: Build Repositories Ag

Lesson 5: Testing and Validating a Repository

90 Oracle BI Suite EE 10g R3: Build Repositories

Page 97: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 91

Practice 6-1: Enhancing the Product Dimension

Goal To import normalized tables that contain additional product information into the Physical layer of the repository

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

Time 5–10 minutes

Instructions

1. Ensure that Oracle BI Server is stopped. a. Open the Services window. b. Locate Oracle BI Server and ensure that it is stopped and the Status field has no value. c. Minimize Services.

2. Start the Server Administrator and open the ABC.rpd repository in offline mode. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > Open > Offline. c. Double-click ABC.rpd. d. Ensure that User is Administrator and that the Password field is blank. e. Click OK.

3. In this step, you import additional product tables that store product code, pricing, and supplier information. The product dimension is an example of where information has been stored physically in a normalized table structure. Data warehouse design writers such as Ralph Kimball refer to this as “snowflaking a dimension.” Many database administrators regard this as good database design, so this is a very common practice. So far, you have only included the information in the root product table in the logical subject area. After import, you can include information from the other product tables. a. Select File > Import > From Database. b. Select the OCI 10g/11g connection type. c. In the TNS Name field, enter ORCL. d. In the User Name field, enter SUPPLIER2.

Page 98: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

92 Oracle BI Suite EE 10g R3: Build Repositories

e. In the Password field, enter SUPPLIER2. f. Click OK. The Import dialog box opens. This may take a few moments. g. Scroll to the SUPPLIER2 folder and expand it. h. Select the following tables (press and hold [Ctrl]) to import:

Table Name

D1_PRICELIST

D1_PRODUCT_SUBTYPE

D1_PRODUCT_TYPE

D1_PROD_DIET_TYPES

D1_SUPPLIERS

i. Ensure that the Tables and Keys check boxes are selected. j. Click Import. Wait for the import process to complete. k. Click Close to close the Import dialog box. l. Ensure that the tables were imported into the Physical layer.

m. Update row counts for the new tables.

4. Define joins and foreign keys using the Physical Diagram. a. In the Physical layer, right-click the ORCL database and select Physical Diagram >

Object(s) and All Joins to open the Physical Diagram view. b. Drag the new table objects so they are all visible and use the zoom feature as needed. c. Use the New Foreign Key button on the toolbar to create the following join relationships. As

in earlier lessons, click Yes if you are asked to create a matching table key. D1_PRODUCT_SUBTYPE.SUBTYPECODE = D1_PRODUCTS.SUBTYPECODE D1_PROD_DIET_TYPES.DIETCODE = D1_PRODUCTS.DIETCODE D1_SUPPLIERS.SUPPLIERCODE = D1_PRODUCTS.SUPPLIERCODE D1_PRICELIST.PRODUCTKEY = D1_PRODUCTS.PRODUCTKEY D1_PRODUCT_TYPE.TYPECODE = D1_PRODUCT_SUBTYPE.TYPECODE

Page 99: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 93

d. Check your results:

e. Close the Physical Diagram. f. Save the repository. Do not check consistency.

Page 100: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

94 Oracle BI Suite EE 10g R3: Build Repositories

Practice 6-2: Creating Multiple Sources for a Logical Table Source (Manual)

Goal To add the information from the price list table to the Product dimension

Scenario You have imported the product tables that store detailed information about ABC’s products into the Physical layer of the repository and configured keys and joins for the tables. So far, the Product dimension in the Business Model and Mapping layer has only information from the root product table: D1_PRODUCTS. You are ready to add the information from the price list table to the Product dimension, and while doing that, simplify the data structure (in effect, creating a denormalized logical table).

Outcome In the Business Model and Mapping layer, the D1_PRICELIST physical table is added to the existing logical table source for the Product dimension and the Price logical column is added to the Product dimension and mapped to the appropriate physical table.

Time 5 minutes

Instructions

1. In this step, you add the information from the price list table to the existing logical table source for the Product dimension. There are two methods to add multiple sources for an existing logical table source. In this practice, you use the Properties window of an existing logical table source, which is a manual process and requires several steps. In the next practice, you use a more automated process. a. In the Business Model and Mapping layer, expand the Products logical table and then the

Sources folder, and then double-click the D1_PRODUCTS logical table source to view the properties.

b. Click the General tab and click Add. The Browse window automatically includes those tables that are joined directly to the table already in the logical table source. In this case, it includes all tables that join to D1_PRODUCTS. Only tables that join to tables included in the logical source can be added to the logical source. In other words, if tables do not have a join relationship in the Physical layer to tables included in the logical source, they cannot be added to the logical table source.

Page 101: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 95

c. Which product table is not visible in the browse list?

d. Why is this table not visible in the list?

e. In the Browse window, select the D1_PRICELIST table and click the Select button. The table is added to the logical table source and the join is displayed in the Joins section on the General tab.

f. Select the join in the Joins section. The View Details button becomes active. g. Click View Details to open the join dialog box and view the read-only details of the join. h. Click Cancel to close the join dialog box. i. To change a join to an outer join, you could use the drop-down list in the Type column. This

allows you to change the join type from inner to three kinds of outer joins. For the purpose of these practices, leave the type as Inner. You can think of the tables in a logical dimension table source as being like a database view. When it formulates physical SQL, Oracle BI Server will leave out the tables in this “view” that are not needed to satisfy the logical query (join elimination), but only if the join type is Inner. When the join type is Outer, however, Oracle BI Server will always include the tables.

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

2. In this step, you create a new logical column based on the new logical table source. Using the manual method in the previous step to add a physical table to a logical table source neither automatically adds logical columns to the logical table nor changes the logical to physical mapping of any existing column. Now that the physical table that stores the pricing information

Page 102: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

96 Oracle BI Suite EE 10g R3: Build Repositories

has been added to the Product logical table source, you create a new logical column and map it to the appropriate physical table. a. In the Business Model and Mapping layer, right-click the Products table and select New

Object > Logical Column. b. Enter Price in the Name field and click OK. c. Double-click the D1_PRODUCTS logical table source to open its properties dialog box. d. Click the Column Mapping tab. e. If necessary, select the Show unmapped columns check box. Note that the column you just

created, Price, is not mapped to any physical column. f. In the Logical Column section, click the ellipsis (…) button next to Price to open the

Expression Builder. g. In the lower-left pane of the Expression Builder, click the Physical Tables folder. h. In the center pane, click D1_PRICELIST. i. In the right pane, click PRICE. j. Click the Insert button and examine the expression. k. Click OK to close the Expression Builder. l. Ensure that Show Mapped Columns is selected, and that the Price logical column is now

mapped to the PRICE physical column in the D1_PRICELIST physical table.

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

Page 103: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 97

Solutions 6-2: Creating Multiple Sources for a Logical Table Source (Manual)

Answers

1.c. Which product table is not visible in the browse list? D1_PRODUCT_TYPE

1.d. Why is this table not visible in the list? Because it does not have a direct join relationship with D1_PRODUCTS in the Physical layer. The Browse window automatically includes those tables that are joined directly to the table already in the logical table source.

Page 104: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

98 Oracle BI Suite EE 10g R3: Build Repositories

Practice 6-3: Creating Multiple Sources for a Logical Table Source (Automated)

Goal To add the information from the additional product tables to the Product dimension

Scenario You have manually added information from the price list table to the Product dimension. You are ready to add information from the other product tables to the Product dimension using an alternate method. You create multiple sources for the Product logical table source and simultaneously add the columns to the Product dimension.

Outcome In the Business Model and Mapping layer, the D1_PROD_DIET_TYPES, D1_PRODUCT_SUBTYPE, D1_PRODUCT_TYPE, and D1_SUPPLIERS physical tables are added to the existing logical table source for the Products logical table.

In the Business Model and Mapping layer, the DIET_TYPE, ITEMSUBTYPE, ITEMTYPE, and ITEMSUPPLIER logical columns are added to the Products logical table and mapped to the appropriate physical tables.

Time 5–10 minutes

Instructions

1. In this step, you use a second method to add additional information to the Product dimension and simultaneously add a new source to the existing D1_PRODUCTS logical table source. a. In the Physical layer, expand the D1_PROD_DIET_TYPES table and select the

DIET_TYPE column. b. In the Physical layer, drag the DIET_TYPE column onto the D1_PRODUCTS logical table

source in the Products dimension in the Business Model and Mapping layer. c. Ensure that the DIET_TYPE column is added to the Products logical table. d. Double-click the D1_PRODUCTS logical table source to view its properties. e. Click the Column Mapping tab. f. To which physical column and physical table is the DIET_TYPE logical column mapped?

g. Click OK to close the Logical Table Source properties dialog box.

Page 105: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 99

2. Repeat the steps above to add more product information to the Products dimension, simultaneously adding new sources to the existing D1_PRODUCTS logical table source. a. Drag the following columns from the Physical layer to the D1_PRODUCTS logical table

source: Physical Table Physical Column

D1_PRODUCT_SUBTYPE ITEMSUBTYPE

D1_PRODUCT_TYPE ITEMTYPE

D1_SUPPLIERS ITEMSUPPLIER

b. Open the D1_PRODUCTS logical table source properties dialog box and click the Column Mapping tab to check your results.

c. Which new table sources are added to the D1_PRODUCTS logical table source? It may be necessary to scroll to the right.

d. Click OK to close the Logical Table Source properties dialog box.

3. Rename the new logical columns in the Product dimension so they are meaningful to users. a. In the Business Model and Mapping layer, slowly double-click the DIET_TYPE logical

column to make the column editable or right-click the column and select Rename. b. Change the name to Diet Type. c. Rename the other new columns to the following:

From… To…

ITEMSUBTYPE Subtype

ITEMTYPE Type

ITEMSUPPLIER Supplier

4. Add the new product information to the SupplierSales presentation catalog. a. Drag the five new columns from the Business Model and Mapping layer onto the Products

table in the SupplierSales presentation catalog and reorder the columns in the Presentation layer as follows:

Column Name

Price

Type

Subtype

Diet Type

Supplier

5. Select File > Check Global Consistency to validate your work. If you receive any error messages, fix them before proceeding.

Page 106: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

100 Oracle BI Suite EE 10g R3: Build Repositories

6. Close the Consistency Check Manager.

7. Save and close the repository.

8. Close the Administration Tool.

9. Start the Oracle BI Server service.

10. Start Answers. a. Select Start > Programs > Oracle Business Intelligence > Presentation Services. b. Log in as Administrator. There is no need to enter a password. c. Click the Answers link.

11. Create a request to check your work. a. Select the SupplierSales subject area. b. Create the following request:

c. Click the Results tab to view the results.

12. Examine the query log to determine which table or tables have been accessed for this simple query. a. Select Settings > Administration > Manage Sessions.

Page 107: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 101

b. Click View Log for the last entry in the Cursor Cache section. c. Ensure that three tables: D1_PRODUCTS, D1_PRODUCT_SUBTYPE, and

D1_PRODUCT_TYPE, have all been accessed, despite the fact that the D1_PRODUCT_TYPE table alone contains all the data requested. The log should look similar to the following screenshot:

d. Why are all the three tables included in the query?

e. Close the query log. In the next practice, you specify a more economical way for Oracle BI Server to access this data.

13. Log out of Oracle BI.

Page 108: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

102 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 6-3: Creating Multiple Sources for a Logical Table Source (Automated)

Answers

1.f. To which physical column and physical table is the DIET_TYPE logical column mapped? D1_PROD_DIET_TYPES.DIET_TYPE

2.c. Which new table sources are added to the D1_PRODUCTS logical table source? It may be necessary to scroll to the right. D1_PRODUCT_SUBTYPE, D1_PRODUCT_TYPE, and D1_SUPPLIERS

12.c. Why are all three tables included in the query? Because of the join conditions. The only way the query can access the D1_PRODUCT_TYPE table is through the D1_PRODUCTS table.

Page 109: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 103

Practice 6-4: Adding a New Logical Table Source

Goal To add a second logical table source to the Product dimension

Scenario Examining the physical sources and the Products dimension table, you discover that the Type Code and Type columns are mapped to different physical tables, while the information for both is stored in a common physical table. In order to model the most economical method for Oracle BI Server to find information for these two columns, you decide to add a second logical table source to the Product dimension so that Oracle BI Server queries only one table for the Type Code and Type information.

Outcome In the Business Model and Mapping layer, Type is added as second logical table source for the Products logical table.

Time 5 minutes

Instructions

1. Open the ABC repository file in offline mode. a. Stop the Oracle BI Server service. b. Navigate to D:\OracleBI\server\Repository. c. Double-click ABC.rpd. d. Log in as Administrator with no password.

2. Examine the existing column mappings for the two columns, Type and Type Code, to determine the most economical method for Oracle BI Server to find information. a. In the Business Model and Mapping layer, expand the Sources folder of the Products table

and double-click D1_PRODUCTS. b. Click the Column Mapping tab. c. To what physical table and physical column is Type Code mapped?

d. To what physical table and physical column is Type mapped?

e. Click Cancel to close the Properties window.

Page 110: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

104 Oracle BI Suite EE 10g R3: Build Repositories

3. Determine which physical table stores information for both Type Code and Type. a. In the Physical layer, expand the D1_PRODUCT_TYPE physical table. b. Ensure that this table stores the information for ITEMTYPE and TYPECODE.

4. Model a new mapping for the Type Code logical column by creating a second logical table source for the Products dimension. a. In the Business Model and Mapping layer, right-click the Products table and select New

Object > Logical Table Source. b. Ensure that the General tab is selected. c. In the Name field, enter Type to name the new logical table source. d. Click Add. e. In the Browse dialog box, double-click the D1_PRODUCT_TYPE physical table to select it. f. Click OK to close the Logical Table Source properties dialog box. Note that the new logical

table source, Type, is added to the Sources folder.

g. Double-click the Type logical table source to view its properties. h. Click the Column Mapping tab. i. Use the Expression Builder to map the Type Code logical column to the

D1_PRODUCT_TYPE.TYPECODE physical column. This maps the Type Code logical column to the TYPECODE physical column in the D1_PRODUCT_TYPE physical table for this logical table source.

j. Click OK to close the Expression Builder. k. Use the Expression Builder to map the Type logical column to the

D1_PRODUCT_TYPE.ITEMTYPE physical column. This maps the Type logical column to the ITEMTYPE physical column in the D1_PRODUCT_TYPE physical table for this logical table source.

Page 111: Build Repositories Ag

Lesson 6: Adding Multiple Logical Tables Sources

Oracle BI Suite EE 10g R3: Build Repositories 105

l. Click OK to close the Expression Builder. m. Check your work:

n. Click OK to close the Logical Table Source properties dialog box. There are now two logical

table sources for the Products dimension and the Type Code logical column maps to both the D1_PRODUCT_TYPE and D1_PRODUCTS tables. In a later practice, you let Oracle BI Server know which source to use by specifying the aggregation content for the Type logical table source.

o. Select File > Check Global Consistency to validate your work. If you receive any error messages, fix the errors before proceeding.

p. If the repository is consistent, save and close the repository. q. Select File > Exit to close the Administration Tool.

Page 112: Build Repositories Ag

Lesson 6: Adding Multiple Logical Table Sources

106 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 6-4: Adding a New Logical Table Source

Answers

2.c. To what physical table and physical column is Type Code mapped? Type Code is mapped to the D1_PRODUCTS physical table and to the TYPECODE physical column.

2.d. To what physical table and physical column is Type mapped? Type is mapped to the D1_PRODUCT_TYPE physical table and to the ITEMTYPE physical column.

Page 113: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 107

Practice 7-1: Creating Calculation Measures by Using Logical Columns

Goal To derive a new calculation based on existing business measures

Scenario You want to enable users to track the difference between the units ordered and units shipped by selecting a single fact column called Cuts. This business measure can potentially help track lost revenue. You use the Expression Builder to configure a formula for Cuts using existing logical columns as objects in the formula.

Outcome In the Business Model and Mapping layer, the Cuts logical column is added to the SalesFacts logical table.

In the Presentation layer, the Cuts presentation column is added to the SalesFacts presentation table.

Time 10–15 minutes

Instructions

1. Because you modify the ABC repository in online mode in this practice, ensure that the Oracle BI Server service is started.

2. In this step, you start the Administration Tool and open the ABC repository in online mode. Up to this point, all the changes you have made to the repository have been in offline mode. Now that you have a consistent repository and Oracle BI Server is running and using it, you can make changes to the metadata in online mode. Offline, the relationship between the Administration Tool and the repository is similar to the relationship between any Windows application and a file: an application, the Administration Tool in this case, opens a file for editing, makes changes to its in-memory copy, and tells the OS to save the changed file. In online mode, the relationship is different. Oracle BI Server has already opened the repository file and the operating system has put a write-lock on the file. In this mode, Oracle BI Server can act as an agent of the Administration Tool. When the Administration Tool tells it to, Oracle BI Server sends the Administration Tool a copy of its in-memory repository. Then it listens for messages from the Administration Tool about changes, makes those changes to its in-memory copy, and, when told by the Administration Tool, tells the OS to save the changed file. When you start the Administration Tool in online mode, you pick an Oracle BI ODBC DSN that points to the repository you want to edit (the repository that is the default repository in the DSN).

Page 114: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

108 Oracle BI Suite EE 10g R3: Build Repositories

The Administration Tool then communicates changes to Oracle BI Server and Oracle BI Server makes the corresponding changes to its in-memory copy. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > Open > Online. c. In the Open Online Analytics Web dialog box, log in as Administrator; no password

needed. d. Ensure that the title bar displays (Online) indicating you are in online mode.

3. In this step, you set a user preference to check out objects automatically. Because Oracle BI Server may be processing queries while you are editing the repository, you must check out objects before editing them. After the objects have been edited, you check them in again. Then the changes you made become active. When you have finished editing, you can save the changes to the repository. a. Select Tools > Options. b. Select the General tab. c. Make sure that Check out objects automatically is selected. d. Click OK.

4. In this step, you define a new logical measure called Cuts (the difference between what was ordered and what was shipped) in the SalesFacts logical table, using existing logical columns to define the calculation formula. a. In the Business Model and Mapping layer, right-click the SalesFacts logical table and

select New Object > Logical Column. b. Ensure that the General tab is selected. c. Enter Cuts in the Name field to name the column. d. Select the Use existing logical columns as the source check box. e. To open the Expression Builder, click the Ellipsis button (to the right of the text edit

box). f. In the left pane of the Expression Builder, select the Logical Tables folder. g. In the middle pane, select the SalesFacts logical table. h. In the Search field under the right pane, enter the letter U. This narrows the list of objects in

the pick list. This is a useful feature in large repositories. i. In the right pane, select the Units Ordered logical column. j. Click Insert. k. Click the minus sign on the toolbar. l. In the right pane, double-click the Units Shipped logical column to insert it in the

formula.

Page 115: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 109

m. Check your results:

n. Click OK to close the Expression Builder. Note that the expression is now displayed in the

Logical Column dialog box. o. Select the Data Type tab. The data type of logical columns derives from the data types of the

underlying physical columns. The Administration Tool examines the data types of the physical sources and selects the most inclusive data type for the logical column. Data types may be changed by the formula you create. For example, consider a logical column that is defined as ColumnA * ColumnB. If ColumnA and ColumnB are integers, then the product of those two columns is also an integer. If the formula was 1.0 * ColumnA * ColumnB instead, the resulting data type would be a DOUBLE. The data type transformation happens in left to right order within the normal order of operations. If the data were from SQL Server (which has an Integer data type) and both UNITORDD and UNITSHPD were integers, Cuts would have an INT data type instead of DOUBLE. Note also that the formula is expressed in terms of the physical column data types and that it also includes the aggregation functions (sum).

p. Click OK. Note that the icon for Cuts is blue and that all other logical columns in the

SalesFacts logical table have a check mark. This indicates that the logical columns have not yet been checked in to the server.

5. Add the new Cuts column to the SupplierSales presentation catalog. a. In the Presentation layer, ensure that the SupplierSales presentation catalog is expanded. b. Select Cuts from the SalesFacts logical table and drag it onto the SalesFacts

presentation table.

Page 116: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

110 Oracle BI Suite EE 10g R3: Build Repositories

6. Select File > Check In Changes or click the Check In Changes button on the toolbar.

7. Click Yes to check global consistency. Fix errors, if any, before proceeding.

8. If the repository passes the consistency check, close the Consistency Check Manager.

9. Save the repository.

10. Check your work. a. Log in to Oracle BI Presentation Services as Administrator; no password is needed. b. Click the Answers link and the SupplierSales subject area. c. Click Reload Server Metadata. d. Create the following request:

e. Click the Results tab to view the results.

f. Ensure that the Cuts calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered.

g. Is the value in the Cuts column for the Frozen food type accurate?

Page 117: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 111

h. Ensure that the Cuts calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered.

i. Is the value in the Cuts column for the Lamb food type accurate?

j. Leave Answers open.

11. Examine the query log to see what query was sent to the database. a. Select Settings > Administration > Manage Sessions > View Log to open the query log.

What you see should be similar to the following:

b. Note that Cuts is included in the logical query.

c. Note that the difference between units ordered and units shipped is being calculated in the

outer query block (D1.c1 - D1.c2 as c4 here). Because you defined the Cuts calculation using logical columns, the columns are summed first and then the difference is calculated. You compare these results to the query results in the next practice.

d. Close the query log. e. Leave Answers open. f. What would happen if you deleted a logical column that is used to define the formula of

another logical column? The derived column would not be deleted automatically. However,

Page 118: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

112 Oracle BI Suite EE 10g R3: Build Repositories

the tool would display an icon that warns you about this condition. Don’t do this! This is just for informational purposes.

Page 119: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 113

Solutions 7-1: Creating Calculation Measures by Using Logical Columns

Answers

10.g. Is the value in the Cuts column for the Frozen food type accurate? Yes, 0 is the correct value.

10.i. Is the value in the Cuts column for the Lamb food type accurate? Yes, 39 is the correct value.

Page 120: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

114 Oracle BI Suite EE 10g R3: Build Repositories

Practice 7-2: Creating Calculation Measures by Using Physical Columns

Goals To modify a repository in online mode and create a calculation measure using physical columns

Scenario You want users to be able to track the difference between the units ordered and units shipped by selecting a single fact column called CutsP. In the previous practice, you used logical columns to create the calculation. In this practice, you use the Expression Builder again to configure a formula for CutsP using physical columns as objects in the formula.

Outcome In the Business Model and Mapping layer, CutsP is added to the SalesFacts logical table.

In the Presentation layer, CutsP is added to the SalesFacts presentation table.

Time 10–15 minutes

Instructions

1. Return to the ABC repository, which should still be open in online mode.

2. Configure a new logical column in the SalesFacts logical table that uses physical columns in its formula. a. In the Business Model layer, right-click the SalesFacts table and select New Object >

Logical Column. b. Enter CutsP in the Name field to name the column. c. Select the Aggregation tab. d. In the Default aggregation rule field, select Sum. e. Click OK.

3. Map the new CutsP column to a physical source. a. In the Business Model and Mapping layer, expand the Sources folder for the SalesFacts

table and double-click D1_ORDERS2. b. Select the Column Mapping tab. c. If necessary, select the Show unmapped columns check box to display the CutsP logical

column. d. To open the Expression Builder, click the Expression Builder button (. . .) next to CutsP. e. In the left pane of the Expression Builder, select the Physical Tables folder.

Page 121: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 115

f. In the middle pane, select the D1_ORDERS2 table. g. Following the process used in the previous practice, create a formula that subtracts units

shipped from units ordered using physical columns. Check your results:

h. Click OK to close the Expression Builder. i. Note that you can see the formula in the Expression column for CutsP on the Column

Mapping tab. You may need to adjust the column width to see the entire formula. j. Click OK to close the Logical Table Source properties dialog box. k. Double-click the CutsP logical column. l. Click the General tab and note that CutsP is not defined using existing logical columns as

the source. m. Click the Data Type tab and note the data type of the logical column based on its formula

definition and the data types of the sources. Note also that formula finds the difference between the columns first and then sums the difference.

n. Click OK to close the Logical Column properties dialog box. o. Select CutsP in the SalesFacts logical table and drag it onto the SalesFacts presentation

table in the Presentation layer.

4. Check in the changes made to the repository: a. Select File > Check In Changes or click the Check In Changes button on the toolbar. b. Click Yes when asked to check consistency. Fix errors, if any, before proceeding. c. If the repository is consistent, close the Consistency Check Manager.

5. Save the repository.

6. Reload the server metadata in Answers. a. Return to Answers. b. Click the Reload Server Metadata link to update the repository. c. Ensure that CutsP appears in the SalesFact presentation table.

7. Check your work. a. Create the following request:

Page 122: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

116 Oracle BI Suite EE 10g R3: Build Repositories

b. Click the Results tab to view the results.

c. Ensure that the CutsP calculation is accurate for the Frozen food type by manually

subtracting Units Shipped from Units Ordered. Is the value in the CutsP column accurate?

d. Ensure that the CutsP calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsP column accurate?

8. Examine the query log to see what query was sent to the database:

Page 123: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 117

a. Open the query log. Your results should resemble the following screenshot:

b. Note that CutsP is included in the logical query.

c. Note also that the difference between units ordered and units shipped is calculated first and

then summed (sum(T285.UNITORDD - T285.UNITSHPD) as c4 in the example here). Compare these results with the query results in the previous practice.

d. Close the query log. e. Leave Answers open. f. What are the advantages and disadvantages of defining a logical column in terms of other

logical columns, rather than in terms of the physical sources directly? The advantage of defining a logical column formula based on existing logical columns is that you have to define it only once. When you create formulas based on physical columns, you have to map for each physical source it could be derived from. Sometimes, you have no choice, however, if you have to use physical columns to apply an aggregation rule after a calculation.

Page 124: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

118 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 7-2: Creating Calculation Measures by Using Physical Columns

Answers

7.c. Ensure that the CutsP calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsP column accurate? Yes, 0 is the correct value.

7.d. Ensure that the CutsP calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsP column accurate? Yes, 39 is the correct value.

Page 125: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 119

Practice 7-3: Creating Calculation Measures by Using the Calculation Wizard

Goals To modify a repository in offline mode and create calculation measures using the Calculation Wizard

Scenario You want to model two calculation measures using the Calculation Wizard, called Change Units Shipped and Percent Change Units Shipped. The Change Units Shipped measure calculates the difference between the units ordered and units shipped. The Percent Change Units Shipped measure calculates what percentage of the units ordered has not been shipped. The calculation measures that are created by the wizard are based on existing logical columns. You rename these columns CutsW and Percent Not Shipped in the Presentation layer.

Outcome In the Business Model and Mapping layer, Change Units Shipped and Percent Change Units Shipped are added to the SalesFacts logical table.

In the Presentation layer, CutsW and Percent Not Shipped are added to the SalesFacts presentation table.

Time 10–15 minutes

Instructions

1. Return to the ABC repository, which should still be open in online mode.

2. In this step, you model two calculation measures using the Calculation Wizard. a. In the Business Model and Mapping layer, expand the SalesFacts table. b. Right-click the Units Ordered column and select Calculation Wizard. c. In the Calculation Wizard – Introduction dialog box, click Next. d. In the Choose columns pane, SalesFacts is selected. The columns appear in the right

pane. e. Select the Units Shipped check box. f. Click Next. g. In the Generate Calculations section, ensure that the Change and Percent Change check

boxes are both selected.

Page 126: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

120 Oracle BI Suite EE 10g R3: Build Repositories

h. In the Generate Calculations section, ensure that Change is highlighted.

i. In the Calculation Name field, enter CutsW. j. Note the results that are returned when Units Shipped is NULL:

k. In the Generate Calculations section, select Percent Change so that it is highlighted.

l. Change the Calculation Name to Percent Not Shipped. m. Note the results that are returned when Units Shipped is not available (NULL) or is zero

using the following parameters. The screenshot shows only partial results:

n. Click Next to open the Check Out Objects window. o. Review the objects that must be checked out. p. Click Next. q. Review the two calculations measures that will be created by the Wizard: CutsW and

Percent Not Shipped. r. Click Finish.

Page 127: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 121

s. In the Business Model and Mapping layer, ensure that there are two new columns created by the Calculation Wizard in the SalesFacts table.

t. Drag the new CutsW and Percent Not Shipped logical columns from the

SalesFacts logical table onto the SalesFacts presentation table in the SupplierSales presentation catalog in the Presentation layer.

3. Check in changes.

4. Check global consistency.

5. If the repository is consistent, close the Consistency Check Manager. If not, fix any errors before proceeding.

6. Save the repository.

7. Return to Answers.

8. Reload Server Metadata.

9. Create the following request:

10. Format the Percent Not Shipped column to display percentages. a. In the Percent Not Shipped column, click the Column Properties button . b. Click the Data Format tab. c. Select the Override Default Data Format check box. d. In the Treat Numbers As drop-down list, select Percentage. e. In the Decimal Places drop-down list, select 2. f. Save these settings as the system-wide default for Percent Not Shipped.

Page 128: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

122 Oracle BI Suite EE 10g R3: Build Repositories

g. Check your changes:

h. Click OK to close the Column Properties dialog box.

11. Click Results.

Page 129: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 123

12. Ensure that the CutsW calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsW column accurate?

13. Ensure that the CutsW calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsW column accurate?

14. To ensure that the Percent Not Shipped value is accurate, you divide CutsW by Units Shipped. For example, for the Lamb food type, you divide 39 by 961 to get 4.06. This tells you that 4.06% of the units ordered have not been shipped.

15. Examine the query log to see what query was sent to the database. Your query results should resemble the following screenshot:

a. Note that the CutsW and Percent Not Shipped columns are listed in the logical

query.

Page 130: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

124 Oracle BI Suite EE 10g R3: Build Repositories

b. Also, note that the parameters you specified for NULL values are included.

c. Close the log file. d. Leave Answers and the Administration Tool open for the next practice.

Page 131: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

Oracle BI Suite EE 10g R3: Build Repositories 125

Solutions 7-3: Creating Calculation Measures by Using the Calculation Wizard

Answers

12. Ensure that the CutsW calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsW column accurate? Yes, 0 is the correct value.

13. Ensure that the CutsW calculation is accurate for the Lamb food type by manually subtracting Units Shipped from Units Ordered. Is the value in the CutsW column accurate? Yes, 39 is the correct value.

Page 132: Build Repositories Ag

Lesson 7: Adding Calculations to a Fact

126 Oracle BI Suite EE 10g R3: Build Repositories

Page 133: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 127

Practice 8-1: Creating Dimension Hierarchies

Goal To create dimensions to introduce hierarchies into the business model

Scenario Dimensions are metadata objects that allow you to introduce hierarchies into a business model. The dimensions and hierarchies remain hidden to users, but they enable Oracle BI Server to provide useful calculations. You need to implement three dimensions for ABC: Product, Customer, and Period. Creating dimensions and hierarchies allows you to build level-based measures, to define aggregation rules that vary by dimension, to provide drill down on charts and tables in Answers and dashboards, and to describe the content of aggregate sources.

Outcome In the Business Model and Mapping layer, there are ProductsDim, CustomersDim, and PeriodsDim dimension objects.

Time 20–25 minutes

Instructions

1. Return to the ABC repository, which should still be open in online mode.

2. In order to create a dimension hierarchy, you need to know the levels in the hierarchy, the columns that uniquely define each level, and the distinct values for each level. In this step, you identify these for the product dimension. a. The business requirements determine the levels. In the case of the product hierarchy for

ABC, the levels are (from top to bottom): Type, Subtype, Generic, and Specific. b. Typically, a database administrator provides you the columns that define each level. In

ABC’s case, the columns are: Level Column on D1_PRODUCTS table that defines the level

Type TYPECODE

Subtype SUBTYPECODE

Generic GENERICDESCRIPTION

Specific SPECIFICDESCRIPTIN

c. In the Physical layer, navigate to D1_PRODUCTS.TYPECODE. Note that there are 22 rows for the TYPECODE column. (If the row count is not visible, run Update Row Count). This is the manual method to determine the number of elements at each level of a hierarchy. You update row counts and then use the row count information to set the number of elements at each level in a dimension hierarchy. In a later step, you learn how to use an automated method to determine the number of elements at each level.

d. Confirm the row counts for the other columns in D1_PRODUCTS.

Page 134: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

128 Oracle BI Suite EE 10g R3: Build Repositories

Level Column on D1_PRODUCTS table that defines the level Row Count

Subtype SUBTYPECODE 159

Generic GENERICDESCRIPTION 186

Specific SPECIFICDESCRIPTIN (this spelling is correct) 192

3. In this step, you create a dimension object to represent the hierarchy of products. a. In the Business Model and Mapping layer, right-click SupplierSales and select New Object

> Dimension. The Dimension dialog box opens. b. In the Name field, enter ProductsDim. c. Click OK. The new dimension appears in the Business Model and Mapping layer. Note the

three-arrow icon.

4. In this step, you add the parent level of the hierarchy. a. Right-click the ProductsDim dimension and select New Object > Logical Level. b. In the Name field, enter TotalProduct. c. Because this level represents the grand total for products, select the Grand total level check

box. Note that when you do this, the Supports rollup to higher level of aggregation field is grayed out and protected.

d. Note that the Number of elements at this level field has the value of 1. The TotalProduct level has only one element (the grand total). Therefore, 1 is the appropriate value for this level and cannot be changed.

e. Click OK. The new level appears as a child of the ProductsDim dimension.

5. Add the child levels of the hierarchy. a. Right-click the TotalProduct level and select New Object > Child Level. b. In the Name field, enter Type. c. In the Number of elements at this level field, enter 22. Recall that this is the value you

determined in an earlier step. This number does not have to be exact. The ratio from one level to the next is more important than the absolute number. These numbers only affect which aggregate source is used (optimization, not correctness of queries).

d. Ensure that Supports rollup to higher level of aggregation is selected. This field is selected because if data is stored at the Type level, it can be aggregated to produce the total for its parent level without double counting or leaving anything out. There are some hierarchies where certain levels might not include all the elements of the dimension.

e. Click OK. The Type level appears as a child of the TotalProduct level. f. Repeat the above steps to add further child levels:

Name Number of elements at this level

Subtype 159

Generic 186

Specific 192

g. Ensure that your results appear as follows:

Page 135: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 129

6. In this step, you specify which columns from the logical dimension table are associated with which levels in the dimension hierarchy, starting from top to bottom. Here are some guidelines for associating columns with levels:

Not all columns in the dimension table need to be associated explicitly with a level; the ones that are not will be associated with the lowest level implicitly.

No columns can be associated with more than one level (although it may be part of the level key of a lower level).

If a column pertains to more than one level, associate it with the highest level it belongs to.

No level except the Grand Total level can exist without at least one column being associated with it.

The Detail level (lowest level) must have the column that is the logical key of the dimension table associated with it and it must be the key for that level.

a. In the Business Model and Mapping layer, expand the Products table, select the Type column, and drag it up to the Type level.

b. Drag the logical column Type Code onto the Type level. Check your results:

c. Continue dragging logical columns from the Products table to the ProductsDim levels:

Logical Column Level

Subtype Subtype SubtypeCode Subtype Generic Generic Specific Specific ProductKey Specific

Page 136: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

130 Oracle BI Suite EE 10g R3: Build Repositories

d. Check your results:

Any column not associated explicitly with a level is associated implicitly with the detail level. In this example, Package Weight and Supplier (among others) are by default associated with the Specific level. The logical dimension table key column, ProductKey in this example, must be associated explicitly with the lowest level.

e. Double-click the Type column in the Products logical table. The Logical Column dialog box opens.

f. Click the Levels tab. This tab identifies the dimensions and logical levels associated with this logical column. These values were set when you dragged the column onto the ProductsDim dimension hierarchy.

g. Click the drop-down list for the Type logical level. Note that this is another method for associating logical columns with dimensions and logical levels. You use this method later in the next practice. Leave the logical level set to Type.

h. Click Cancel to closes the Logical Column dialog box.

7. In this step, you specify the level keys for the Type level in the hierarchy. The level key defines the unique elements in each logical level. Each level key can consist of one or more columns at this level (or may include columns at a higher level). When you pick a column to represent a level key, you are saying that the values of all columns associated with the level are dependent on the value of the level key column. If you know the value of the level key column, you can determine the values of the other columns. a. In ProductsDim, double-click the Type level. The Logical Level properties dialog box opens. b. Click the Keys tab. c. Click the New button. The Logical Level Key dialog box opens. d. Select the Type check box. e. Ensure that the Use for drilldown check box is selected. (“Use for drilldown” is explained in

the next step.) f. Click OK. The attribute displays a key icon. g. Click the New button again. h. Select the Type Code check box. i. Deselect the Use for drilldown check box. j. Click OK. k. Click OK.

Page 137: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 131

l. Both level columns now display with key icons.

8. In this step, you set the level keys for the Subtype level using a different method. a. In ProductsDim, right-click the Subtype column (not the level) and select New Logical

Level Key. b. Ensure that the Subtype check box is selected. c. Ensure that the Use for drilldown check box is selected. d. Click OK. e. Right-click the Subtype Code column and select New Logical Level Key. f. Ensure that the Subtype Code check box is selected. g. Deselect the Use for drilldown check box. h. Click OK. Subtype is selected for drilldown and Subtype Code is not. Later, when a

user drills down in Answers or a dashboard, the default drill is to the level key that has Use for drilldown checked in the next lowest level. Based on this example, when a user drills down from the Type level (the next highest level), the default is to drill down to the Subtype column, not the Subtype Code column.

9. Continue specifying the following level keys for the remaining levels: Dimensional Level Key Use for drilldown

Generic Generic Yes

Specific Specific Yes

Specific ProductKey No

10. Check your final results:

11. In this step, you use another method to create the customer dimension and levels. a. Right-click the Customers logical table and select Create Dimension. A new dimension

called CustomersDim is created with two levels, Customers Total and Customers Detail. The Customers Detail level is populated with all columns from the Customers logical

Page 138: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

132 Oracle BI Suite EE 10g R3: Build Repositories

dimension table.

b. Double-click the Customer Detail level, click the General tab, and note that the number of

elements at this level is set to 136. The number was inherited automatically from Customer Key when the dimension hierarchy was created.

c. Click OK to close the Logical Level dialog box. d. Right-click the Customer Detail level and select New Object > Parent Level. e. Name the parent level SalesRep, set the number of elements to 34, and click OK. f. Create a District level as a parent of SalesRep, set the number of elements to 12, and

click OK. g. Create a Region level as a parent of District, set the number of elements to 3, and click

OK. h. Double-click the Customers Total level, ensure that it is set as the grand total level and the

number of elements is set to 1, and click OK. i. Check your work:

j. Add columns to the hierarchy by dragging columns from the Customers Detail level (not the

Customers table) to the other CustomersDim hierarchy levels. This is a useful method when business models are large. It eliminates the need to scroll to locate columns.

Page 139: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 133

Column Level

Region Region District District Sales Rep SalesRep

k. Create the following keys for each level. Level Key Use for drilldown

Region Region Yes

District District Yes

SalesRep Sales Rep Yes

Customers Detail Customer Yes

l. In the Customers Detail level, deselect Use for drilldown for Customer Key (Customers Detail_Key).

m. Check your work:

n. Check in changes. o. Click Yes to check consistency before creating more dimensions. If there are any errors or

warnings, fix them before continuing. p. If there are no errors or warnings, close the Consistency Check Manager. q. Save the repository.

12. In this step, you can use either of the two methods described in the previous steps to create the Periods dimension. a. Create a dimension hierarchy called PeriodsDim based on the Periods logical dimension

table. b. Create the levels within PeriodsDim:

Name Grand Total Level

Supports rollup to higher level of aggregation

Number of elements at this level

TotalPeriod Yes Protected 1

Page 140: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

134 Oracle BI Suite EE 10g R3: Build Repositories

Year No Yes 2

Quarter No Yes 6

Month No Yes 16

Day No Yes 474

13. There is no logical column you can associate with the Quarter level, so you need to create one and map it to the MONTH_IN_YEAR column with a formula using a CASE statement. a. Double-click the D1_CALENDAR2 logical source table for the Periods logical table. b. Click the Column Mapping tab. c. Click the New column button. d. Name the column Quarter and click OK. e. Make sure Show unmapped columns is selected. f. Open the Expression Builder for the Quarter column. g. Use fully qualified column names and build the following formula. Or, you can copy and

paste this formula from the Quarter.txt file in D:\Labs. CASE WHEN "ORCL".""."SUPPLIER2"."D1_CALENDAR2"."MONTH_IN_YEAR" < 4 THEN 1 WHEN "ORCL".""."SUPPLIER2"."D1_CALENDAR2"."MONTH_IN_YEAR" < 7 THEN 2 WHEN "ORCL".""."SUPPLIER2"."D1_CALENDAR2"."MONTH_IN_YEAR" < 10 THEN 3 ELSE 4 END

h. Click OK to close the Expression Builder. The expression is displayed in the Expression field in the Logical Table Source dialog box.

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

14. Add columns to the hierarchy by dragging columns to the PeriodsDim hierarchy levels: Logical Column Level

Year Year Quarter Quarter Month Month MonthCode Month Month in Year Month Day Day Date Day

15. Create the keys for each child level in the PeriodsDim dimension. Note that additional configuration of the key for the Quarter level is completed in a subsequent step. Level Key Use for drilldown

Year Year Yes

Month Month Yes

Month MonthCode No

Quarter Quarter Yes

Day Day Yes

Page 141: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 135

16. Set MonthCode as the primary level key for the Month level. a. Double-click the Month level. b. Click the Keys tab. c. In the Primary Key drop-down list, select MonthCode. d. Click OK.

17. Setting the key for Quarter involves an additional step. Quarters (1, 2, 3, 4) occur each year. However, these numbers do not uniquely identify a quarter, except when combined with Year. Therefore, you need to make Year part of the Quarter level. a. Double-click the Quarter level in PeriodsDim. b. Click the Keys tab. c. Select the Quarter key. d. Click the Edit button. e. Click the Add Button. f. In the Browse dialog box, expand the Periods logical table. g. Select Year and click OK. h. Click OK to close the Logical Level Key dialog box. i. Click OK to close the Logical Level dialog box. j. Check your work. It should look similar to the following screenshot. Your results may vary

depending on which method you used to build the hierarchy.

k. Drag the Quarter logical column from the Periods logical table to the Periods presentation

table in the SupplierSales presentation catalog to make it available for queries in Answers.

18. Check in changes.

19. Check consistency.

20. Fix any consistency errors or warnings before proceeding. If there are no errors or warnings, close the Consistency Check Manager.

21. Save the repository.

22. Open Answers and check your work:

Page 142: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

136 Oracle BI Suite EE 10g R3: Build Repositories

a. Return to Answers. b. Reload server metadata. c. Create the following request:

d. Click Results. e. Drill down on 1998 and ensure that you can see dollars data by quarter. f. Drill down on any quarter and ensure that you can see dollars data by month. g. Drill down on any month and ensure that you can see dollars data by day.

23. Leave Answers open.

24. Leave the Administration Tool open for the next practice.

Page 143: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 137

Practice 8-2: Creating Level-Based Measures

Goal To create level-based measures

Scenario Now that you have created dimension hierarchies with levels, you want to use them to implement level-based measures that calculate total dollars at various levels.

Time 20–25 minutes

Instructions

1. Return to the ABC repository, which should still be open in online mode.

2. In this step, you create new logical fact columns to represent the product level totals based on existing fact columns. a. In the Business Model and Mapping layer, right-click the SalesFacts table and select New

Object > Logical Column. b. In the Name field, enter ProductTotalDollars. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder. e. In the Expression Builder, add Logical Tables > SalesFacts > Dollars to the expression.

Recall that the Dollars column has a default aggregation rule of Sum. f. Click OK. g. Click the Levels tab. h. For the ProductsDim, select TotalProduct from the Level drop-down list to specify that this

measure should be calculated at the grand total level in the product hierarchy. i. Click OK. Note that setting the level causes the measure to automatically appear in the

ProductsDim dimension.

j. Repeat the steps to create a second level-based measure:

Name Dimension Level

ProductTypeDollars ProductsDim Type

Page 144: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

138 Oracle BI Suite EE 10g R3: Build Repositories

k. Check your final results for the Product dimension:

3. Expose the new columns to users by dragging ProductTotalDollars and ProductTypeDollars from the SalesFacts logical table to the SalesFacts presentation table in the SupplierSales catalog in the Presentation layer.

4. Check in changes.

5. Check consistency. Fix any errors or warnings before proceeding.

6. If there are no errors or warnings, close the Consistency Check Manager.

7. Save the repository.

8. Test your results. a. Return to Answers b. Reload server metadata. c. Create the following request:

d. For the ProductTypeDollars column, click the Column Properties button, then click

the Data Format tab, override the default data format, and set to Currency, $, Decimal Places = 2, Use 1000’s Separator.

Page 145: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 139

e. Click Save > as the system-wide default for ‘“SalesFacts”.ProductTypeDollars’.

f. Click Results. Note that ProductTypeDollars returns dollars grouped by Type when the

query is at a different level than Type; Generic in this example.

g. Drill down on a value in the Generic column. Based on how you constructed the hierarchy in

the business model, if you drill down on a value in the Generic column, Answers drills down

Page 146: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

140 Oracle BI Suite EE 10g R3: Build Repositories

to the Specific column by default.

9. Leave Answers open.

Page 147: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 141

Page 148: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

142 Oracle BI Suite EE 10g R3: Build Repositories

Practice 8-3: Creating Share and Rank Measures

Goals To create share and rank measures

Scenario Now that you have created level-based measures, you use them to create a share measure for products. You also create a rank measure for dollars.

Time 15–30 minutes

Instructions

1. Return to the ABC repository, which should still be open in online mode.

2. Create a new share measure referencing existing logical columns. a. In the Business Model and Mapping layer, right-click SalesFacts and select New Object >

Logical Column. b. Name the logical column ProductShare. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder. e. In the left pane, select the Functions folder. f. In the middle pane, select Mathematic Functions. g. In the right pane, select Round. h. Click Insert. The function appears in the edit box. i. Click SourceNumber. j. Enter 100* followed by a space. k. Select Logical Tables > SalesFacts > Dollars. l. Click Insert. m. Using the toolbar, click the Division button. Another set of angle brackets appears,

<<expr>>. n. Click <<expr>>. o. Select Logical Tables > SalesFacts > ProductTotalDollars. Recall that this is the total

measure for the hierarchy. p. Double-click ProductTotalDollars or click Insert. q. Click between the last set of angle brackets, <<Digits>>, and enter 1. This represents the

number of digits of precision with which to round the integer. r. Check your work:

This share measure will allow you to run a query in Answers to show how sales of a specific product compares to overall sales for all products.

Page 149: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 143

s. Click OK to close the Expression Builder. t. Click OK to close the Logical Column properties dialog box. u. The ProductShare logical column is added to the business model.

3. Create a new rank measure referencing existing logical columns. a. In the Business Model and Mapping layer, right-click the SalesFacts table and select New

Object > Logical Column. b. In the Name field, enter RankDollars. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder. e. Select Functions > Display Functions > Rank. f. Double-click Rank or click Insert. g. Click <<numExpr>>. h. Select Logical Tables > SalesFacts > Dollars. i. Click Insert.

j. Click OK to close the Expression Builder. k. Check your work:

l. Click OK to close the Logical Column dialog box. m. RankDollars is added to the business model.

4. Add the ProductShare and RankDollars measures to the Presentation layer by dragging them to the SalesFacts table in the SupplierSales catalog.

5. Check in changes.

Page 150: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

144 Oracle BI Suite EE 10g R3: Build Repositories

6. Check consistency. If there are errors or warnings, correct them before you proceed.

7. If there are no errors or warnings, close the Consistency Check Manager.

8. Save the repository.

9. Test your results. a. Return to Answers b. Reload server metadata. c. Create the following query:

d. For the RankDollars column, click the Order By button once to sort the results in

ascending order. e. For the ProductShare column, click the Column Properties button, then the Data Format

tab, override the default data format, and set to Percentage with Decimal Places = 2. f. Click Save > as the system-wide default for ‘“SalesFacts”.ProductShare’. g. Click the Results tab:

The results show total dollars for each product, the percent of total sales for each product, and how each product ranks in total sales.

h. Create a similar query to view results for Products.Type, SalesFacts.Dollars, SalesFacts.Product Share, and SalesFacts.Rank Dollars.

Page 151: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 145

The results show total dollars for each product type, the percent of total sales for each product type, and how each product type ranks in total sales.

10. Leave Answers open.

Page 152: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

146 Oracle BI Suite EE 10g R3: Build Repositories

Page 153: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Oracle BI Suite EE 10g R3: Build Repositories 147

Practice 8-4: Creating Dimension-Specific Aggregation Rules

Goal To create a measure with dimension-specific aggregation rules

Scenario ABC wants a measure called AvgDailyDollars, which sums dollar amounts over the Customer and Product dimensions and divides by the number of days in the Period dimension. This measure can be used to compare the average daily dollar amount from month-to-month when the number of order days in each month varies.

Outcome A new measure called AvgDailyDollars with dimension-specific aggregation rules

Time 5–10 minutes

Instructions

1. Return to the ABC repository, which should still be open in online mode.

2. Create a new measure with dimension-specific aggregation rules. a. In the Business Model and Mapping layer, right-click SalesFacts and select New Object >

Logical Column. b. Name the logical column AvgDailyDollars. c. Click the Data Type tab. d. If necessary, select Show all logical sources. e. Double-click the D1_ORDERS2 logical table source. f. Click the Column Mapping tab. g. Make sure that Show unmapped columns is selected. h. Map AvgDailyDollars to the ACTLEXTND (dollars) physical column. i. Click OK to close the Logical Table Source dialog box. j. Click the Aggregation tab. k. Select Based on dimensions. l. In the Browse dialog box, select the PeriodsDim dimension and click OK. m. In the Formula field, select the AVG aggregation rule from the drop-down list. n. Click the New button. o. Select Other and click OK. p. Select the SUM aggregation rule for Other.

Page 154: Build Repositories Ag

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

148 Oracle BI Suite EE 10g R3: Build Repositories

q. With Other selected in the Dimension column, use the Up button to change the aggregation rule order.

r. Click OK. s. Drag the AvgDailyDollars measure to the SalesFact presentation table.

3. Check in changes.

4. Check Global Consistency. Fix errors and warnings before you proceed.

5. Close the Consistency Check Manager.

6. Save the repository.

7. Test your work. a. Return to Answers, reload server metadata, and create the following request and filter.

Hint: Add Month Code to the query, create the filter, and then remove Month Code from the query.

b. Check your results:

c. Considering that there are 25 order days in the first month of 1999, use the Windows

calculator to check that the results of the query are correct for average daily dollars.

Page 155: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 149

Practice 9-1: Using Aggregate Tables

Goal To use aggregate tables to speed up processing

Scenario ABC wants to add sources that contain precomputed aggregations. You need to specify the level of aggregation for each source using logical levels. The database administrator for ABC has already created the necessary aggregate tables:

• D1_SALESREPS contains one row for each sales representative, which can be considered an aggregation of the Customer dimension to the SalesRep level.

• MONTHS contains one row for each year and month combination, which can be considered an aggregation of the Period dimension to the Month level.

• D1_ORDER_AGG1 contains sales facts aggregated to the Sales Rep, Product Type, and Month levels.

• D1_PRODUCT_TYPE is already part of your model and contains one row for each product type, which can be considered an aggregation of the Product dimension to the Type level.

Outcome In the Physical layer, there are new physical sources for the aggregate tables listed above. In the Logical layer, there are new logical table sources for Customers, Periods, and SalesFacts.

Time 30–35 minutes

Instructions

1. Return to the Administration Tool and close the ABC repository, which should still be open in online mode.

2. Stop the Oracle BI Server service and open the ABC repository in offline mode. You return to the offline mode in this practice to import tables.

3. Import the physical aggregate tables from the ORCL database to the Physical layer of the repository. You are importing both aggregate fact and aggregate dimension tables because you need to create logical dimension sources at the same level of detail as the fact sources. a. Select File > Import > from database. b. Select the OCI 10g/11g connection type. c. In the TNS name field, enter ORCL. d. In the User name field, enter SUPPLIER2. e. In the Password field, enter SUPPLIER2.

Page 156: Build Repositories Ag

Lesson 9: Using Aggregates

150 Oracle BI Suite EE 10g R3: Build Repositories

f. Click OK. The Import dialog box opens. This may take a few moments. g. Scroll to the SUPPLIER2 schema and expand it. h. Select the following tables for import:

D1_ORDER_AGG1 D1_SALESREPS MONTHS

i. Ensure that only Tables and Keys are selected and click Import to start the import process. j. When the import process is complete, close the Import dialog box. k. Ensure that the aggregate tables are added to the Physical layer of the repository.

4. Update row counts to check connectivity.

5. View the data in the aggregate tables. a. Right-click D1_ORDER_AGG1 and select View Data. D1_ORDER_AGG1 contains sales

facts aggregated to the Sales Rep (REPKEY), Product Type (TYPEKEY), and Month (PERKEY) levels.

Page 157: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 151

b. Close the View Data window. c. Right-click D1_SALESREPS and select View Data. D1_SALESREPS contains one row for

each sales representative, which is an aggregation of the Customer dimension to the SalesRep level.

d. View data for the MONTHS table. The MONTHS table contains one row for each year and

month combination, which is an aggregation of the Period dimension to the Month level.

e. View data for the D1_PRODUCT_TYPE table. D1_PRODUCT_TYPE contains one row for

each product type, which is an aggregation of the Product dimension to the Type level.

6. Create physical joins between the aggregate fact and aggregate dimension tables. Click Yes when prompted to create a matching table key.

Page 158: Build Repositories Ag

Lesson 9: Using Aggregates

152 Oracle BI Suite EE 10g R3: Build Repositories

a. In the Physical layer, press and hold [Ctrl] and select the three tables you just imported plus the D1_PRODUCT_TYPE table, and click the Physical Diagram icon on the toolbar.

b. Rearrange the tables to make them visible in the Physical Diagram. c. Use the New foreign key button and create the following joins:

D1_SALESREPS.SALESREP = D1_ORDER_AGG1.REPKEY MONTHS.MONTHCODE = D1_ORDER_AGG1.PERKEY D1_PRODUCT_TYPE.TYPECODE = D1_ORDER_AGG1.TYPEKEY

d. Check your work:

e. Close the Physical Diagram.

7. Create new logical sources within the current logical fact table that point to the aggregate tables. a. In the Physical layer, expand the D1_ORDER_AGG1 table. b. In the Business Model and Mapping layer, expand SalesFacts. c. Drag the columns ACTLEXTND, UNITSHPD, UNITORDD, and NETWGHTSHPD one at a

time from D1_ORDER_AGG1 and drop each onto their corresponding SalesFacts logical columns: Dollars, Units Shipped, Units Ordered, and Net Weight Shipped. This creates a new D1_ORDER_AGG1 logical table source and corresponding column mappings.

d. Expand the SalesFacts Sources folder. Note that there are two logical table sources: D1_ORDERS2 and D1_ORDER_AGG1.

e. Double-click the D1_ORDER_AGG1 logical table source and click the Column Mapping tab to check your work:

Note that these four columns now map to both the D1_ORDERS2 table and the D1_ORDER_AGG1 table. In the next step, you configure the business model to choose the appropriate table to use during a query based on how content is specified in the Content tab.

8. Specify the aggregation content of the new table source for the SalesFacts table so that Oracle BI Server knows what level of data is stored in the aggregate tables.

Page 159: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 153

a. Click the Content tab. b. In the Aggregation content, group by field, ensure that the value is Logical Level. This is

the default. c. Use the drop-down menus in the Logical Level field to specify the aggregation content as

follows:

You are setting aggregation content for the fact table to the corresponding levels in the dimension hierarchies. In a subsequent step, you set similar levels for the dimension table aggregate sources. Later, when a user queries against a particular level, Oracle BI Server will “know” to access the aggregate tables instead of the detail tables. For example, if a user queries for total sales by month by Sales Rep, the server will access the D1_ORDER_AGG1 aggregate fact table and the corresponding aggregate dimension tables, MONTHS and D1_SALESREP. If a user queries for a level lower than the levels specified here, for example Day instead of Month, or Customer instead of Sales Rep, then the server will access the detail tables (D1_ORDERS2, D1_CALENDAR2, D1_CUSTOMER2). If a user queries for higher level (year instead of month or district instead of sales rep) the aggregate tables will be used as well, because whenever a query is run against a logical level or above, the aggregate tables are used.

d. Click OK to close the Logical Table Source dialog box for D1_ORDER_AGG1. e. Specify the content for the remaining fact logical table source, D1_ORDERS2. You are doing

this because it is good practice to set the levels for the detail source to the lowest levels in the hierarchies. This is because you want the server to access the detail tables when queries are against levels lower than those specified for the aggregate tables. It is also a good practice to specify the content of all sources for documentation purposes, as another administrator could interpret the lack of an aggregation content statement as an inadvertent omission of information.

Page 160: Build Repositories Ag

Lesson 9: Using Aggregates

154 Oracle BI Suite EE 10g R3: Build Repositories

Note that the name of the detail level for CustomersDim may be different from the screenshot, depending on which method you used to create the CustomersDim hierarchy in the previous set of practices.

f. The Administration Tool can also validate the levels of the fact table sources. Change the CustomersDim logical level to Region and select More > check levels. The dialog box shows the recommended levels and the current level.

g. Click the Set button to set the level to the recommended level. You may need to scroll to the

right to see the Set button. h. Close the Results dialog box. i. Click OK to close the Logical Table Source dialog box.

9. Create a new source within the Periods logical table that points to the MONTHS aggregate table. a. In the Physical layer, expand the MONTHS table. b. In the Business Model and Mapping layer, expand Periods. c. Drag the MONTH_IN_YEAR, MONTHCODE, MONTHNAME, QUARTER, and YEAR columns

from the MONTHS aggregate table onto the corresponding Periods logical columns to create the mappings and the new source (drag MONTHNAME to MONTH). Click the Column Mapping tab for the MONTHS logical table source to check your work:

10. Specify the aggregation content for the new MONTHS logical table source for the Periods table so that Oracle BI Server knows what level of data is stored in the aggregate table. Recall that the MONTHS table contains data at the Month level within the Period dimension hierarchy. a. Select the Content tab in the MONTHS logical table source. b. In the Aggregation content, group by field, ensure that the value is Logical Level.

Page 161: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 155

c. Use the drop-down menu in the Logical Level field to specify the aggregation content as follows:

d. Click OK. e. Specify the content for the remaining fact logical table source, D1_CALENDAR2. Again, it is

best practice to set the levels for the detail source to the lowest in the hierarchies.

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

11. Apply a similar process to create a new source within the Customers logical table that points to the D1_SALESREPS aggregate table. Your results should resemble the following screenshot:

12. Apply a similar process as above to specify the aggregation content for the logical table sources for the Customers table so that Oracle BI Server knows what level of data is stored in the aggregate table. Recall that the D1_SALESREPS table contains data at the SalesRep level within the Customer hierarchy. D1_CUSTOMER2 should be set to the lowest level in the hierarchy. Your results should resemble the screenshots. Again, the name of the detail level for CustomersDim may be different from the screenshot, depending on which method you used to create the CustomersDim hierarchy in the previous set of practices.

Page 162: Build Repositories Ag

Lesson 9: Using Aggregates

156 Oracle BI Suite EE 10g R3: Build Repositories

13. Apply a similar process to set the aggregation content for the logical table sources for the Products table. Use the screenshots as a guide.

14. Save the repository.

15. Check global consistency. Fix any errors or warnings before you continue.

16. If there are no errors or warnings, close the Consistency Check Manager.

17. Close the repository. Leave the Administration Tool open.

Page 163: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 157

18. Why don’t you need to change the Presentation layer?

19. Test your results. a. Start the Oracle BI Server service. b. Return to Answers and reload server metadata. c. Query for Customers.Sales Rep and SalesFacts.Dollars and click the Results tab.

20. Select Settings > Administration > Manage Sessions > View Log to inspect the query log.

21. Ensure that the query uses the D1_ORDER_AGG1 aggregate fact table and the related D1_SALESREPS aggregate dimension table.

22. Experiment with using Sales District in the query. a. Return to Answers and run a query for Customers.Sales District and SalesFacts.Dollars.

Page 164: Build Repositories Ag

Lesson 9: Using Aggregates

158 Oracle BI Suite EE 10g R3: Build Repositories

b. Open the log file and inspect the query.

c. Note that the query still uses the same aggregate tables. Why is this?

23. Experiment with using Customer in the query. a. Return to Answers and run a query for Customers.Customer and SalesFacts.Dollars.

b. Open the log file and inspect the query.

c. Note that the detail fact table, D1_ORDERS2, and the detail dimension table, D1_CUSTOMER2, are accessed instead of the aggregate tables. Why is this?

Page 165: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 159

Solutions 9-1: Using Aggregate Tables

Answers

18. Why don’t you need to change the Presentation layer? You made changes in the business model that impact how the queries are processed and which sources are accessed. The user interface remains the same, so there is no need to change the Presentation layer. It will automatically use the new sources.

22.c. Note that the query still uses the same aggregate tables. Why is this? Sales District is at a higher level than Sales Rep; therefore, the aggregate tables can still be used.

23.c. Note that the detail fact table, D1_ORDERS2, and the detail dimension table, D1_CUSTOMER2, are accessed instead of the aggregate tables. Why is this? The data requested is at a lower level than what is contained in the aggregate tables; therefore, the aggregate tables do not contain the data and the detail tables must be used.

Page 166: Build Repositories Ag

Lesson 9: Using Aggregates

160 Oracle BI Suite EE 10g R3: Build Repositories

Practice 9-2: Using the Aggregate Persistence Wizard

Goal To use the Aggregate Persistence Wizard to automate the creation of aggregate tables and their corresponding objects in the repository

Scenario The traditional process for creating aggregates for Oracle BI Server queries is manual, requiring the writing of DDL and DML scripts to create tables in the databases involved. Additionally, these aggregated tables need to be mapped into the repository metadata to be available for queries. This is a time consuming and, possibly, an error prone process. The Aggregate Persistence Wizard allows an administrator to automate the creation of aggregate tables and their corresponding objects in the repository. Recall that your repository contains an aggregate table called D1_ORDER_AGG1, which contains sales fact data aggregated at the month, sales representative, and product type levels, and corresponding dimension aggregate tables for product type, sales rep, and months. In this practice, you use the Aggregate Persistence Wizard to create similar aggregate tables and the corresponding metadata.

Time 20–30 minutes

Instructions

1. In this step, you use the Aggregate Persistence Wizard to build a script that is used to create aggregate tables and the corresponding metadata. a. Return to the Administration Tool and open the ABC repository in online mode. b. Select Tools > Utilities > Aggregate Persistence Wizard and click Execute. c. Click Browse. The Repository directory opens by default. d. In the File Name field, enter CREATE_AGG and ensure that the sql file type is selected. This

specifies the file where the output script is saved. This file stores the aggregate specifications and is updated if more aggregates are specified.

e. Click Open. f. Click Next. g. In the top pane, select the SupplierSales business model. When there are multiple business

models only one business model can be selected. h. In the bottom pane expand the SalesFacts fact table. When there are multiple fact tables,

only one fact table can be selected.

Page 167: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 161

i. Select the Dollars, Units Shipped, Units Ordered, and Net Weight Shipped measures.

j. Click Next. k. Select the following levels. Leave the Use Surrogate Key? field check box deselected.

ProductsDim: Type PeriodsDim: Month CustomersDim: SalesRep

l. Click Next. m. In the top pane, select the ORCL database. n. In the second pane, expand ORCL and select the SUPPLIER2 schema. The SUPPLIERCP

connection pool is selected by default.

Page 168: Build Repositories Ag

Lesson 9: Using Aggregates

162 Oracle BI Suite EE 10g R3: Build Repositories

o. In the Aggregate table name field, accept the default name ag_SalesFacts for the aggregate table name.

p. Click Next.

Page 169: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 163

q. Review the aggregate definition. The screen displays the logical SQL that generates the aggregate tables based on the parameters defined in the previous steps.

r. Select I am done. s. Click Next. The Complete Aggregate Script dialog box appears confirming that the script has

been generated and stored in the location identified in an earlier step. t. Click Finish. u. Navigate to D:\OracleBI\server\Repository and ensure that the

CREATE_AGG.sql script file was generated.

2. Examine the aggregate parameters in the NQSConfig.ini file. a. Navigate to D:\OracleBI\server\Config and open NQSConfig.ini. b. In the General section, note the setting for AGGREGATE_PREFIX. This is the prefix that is

added automatically to the names of the dimension (level) aggregates when they are generated by the script.

c. Close NQSConfig.ini without making any changes.

3. Set a password for the Administrator user. You do this because you need to provide a password to run a batch file in the next step. a. Select Manage > Security. b. Select User in the left pane. c. Double-click Administrator in the right pane to open the User dialog box.

Page 170: Build Repositories Ag

Lesson 9: Using Aggregates

164 Oracle BI Suite EE 10g R3: Build Repositories

d. Enter Administrator in the Password and Confirm Password fields. e. Click OK. f. Select Action > Close to close the Security Manager. g. Check in changes. h. Save the repository. i. Close the repository. Leave the Administration Tool open.

4. Create and run a batch file to drive the aggregate creation process. a. Open Notepad and create the following create_agg batch file:

The file has the following format: nqcmd Oracle BI Server command utility -d Oracle BI Server data source name -u repository username -p repository password -s path to the create aggregate SQL script

b. Save the file as D:\OracleBI\server\Repository\create_agg.bat. c. Close the file. d. Ensure that the Oracle BI Server service is started. Oracle BI Server must be running to

create the aggregates. e. Open the command prompt. f. In the command prompt window, navigate to D:\OracleBI\server\Repository and

run create_agg.bat. g. Ensure that you receive the message Statement execute succeeded. h. Close the command prompt window.

5. Ensure that the aggregates are created in the Physical layer of the repository. a. Open the ABC repository in online mode as Administrator with Administrator as

the password. b. In the Physical layer, ensure that the aggregates were created in the SUPPLIER2 schema.

There should be one new ag_SalesFacts aggregate and three new dimension aggregates in the Physical layer. Your results should resemble the screenshot.

Page 171: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 165

c. Update row counts for the new aggregates to check connectivity. Confirm that you see the

following row counts: ag_SalesFacts: 10,212 rows SA_Month…: 16 rows SA_SalesRe…: 34 rows SA_Type…: 21 rows

d. Double-click ag_SalesFacts, click the Foreign Keys tab, and ensure that joins are created between ag_SalesFacts and the new dimension aggregates.

e. Double-click the foreign keys to view the join relationships in the Physical Foreign Key dialog box.

f. Click Cancel to close the Physical Foreign Key dialog box. g. Click Cancel to close the Physical Table - ag_SalesFacts dialog box.

6. Ensure that the aggregates are created in the Business Model and Mapping layer of the repository. a. In the Business Model and Mapping layer, open the Sources folder for the SalesFacts,

Customers, Periods, and Products logical tables and ensure that new logical table sources are created for the aggregates.

b. In the Sources folder for the SalesFacts logical table, double-click the ag_SalesFacts logical table source.

c. Click the General tab and ensure that the ag_SalesFacts logical table source maps to the ag_SalesFacts physical table.

d. Click the Column Mapping tab and ensure that the Dollars, Units Ordered, Units Shipped, and Net Weight Shipped logical columns map to the corresponding physical columns in the ag_SalesFacts physical table.

Page 172: Build Repositories Ag

Lesson 9: Using Aggregates

166 Oracle BI Suite EE 10g R3: Build Repositories

e. Click the Content tab and ensure that the logical levels are set correctly.

f. Click Cancel to close the ag_SalesFacts Logical Table Source dialog box. g. Check in changes. h. Check global consistency. Fix any errors or warnings before you continue. i. If there are no errors or warnings, close the Consistency Check Manager. j. Save the repository.

7. Ensure that the aggregates are created in the database. a. Open Internet Explorer and enter the following URL to open the Oracle Enterprise Manager:

http://<machine name>:1158/em. b. Enter SUPPLIER2 as the username and password, and log in. c. Click the Administration link. d. Click the Tables link. e. Ensure that SUPPLIER2 is entered as the schema name, and click Go. f. Ensure that the four new aggregate tables are created in the SUPPLIER2 schema. g. Log out of Oracle Enterprise Manager.

8. Deactivate the D1_ORDER_AGG1 logical table source. a. Double-click the D1_ORDER_AGG1 logical table source in SalesFacts > Sources. b. Click the General tab. c. Deselect Active. d. Click OK to close the Logical Table Source dialog box. e. Repeat the steps and deactivate the D1_SALESREPS and MONTHS logical table sources for

the Customers and Periods logical tables, respectively. You are deactivating these logical table sources so you can ensure that the aggregate tables you just created are accessed when you run a query in Answers in the next step.

f. Check in changes. g. Check global consistency. Fix any errors or warnings before you proceed. h. Close the Consistency Check Manager. i. Save the repository.

9. Use Answers to test your work. a. Return to Answers and log out. b. Log back in as Administrator with Administrator as the password.

Page 173: Build Repositories Ag

Lesson 9: Using Aggregates

Oracle BI Suite EE 10g R3: Build Repositories 167

c. Reload server metadata. d. Create and run the following query:

10. Inspect the query log and ensure that the query used the ag_SalesFacts aggregate table and the related SalesRep dimension aggregate. Your file should resemble the screenshot.

11. Reverse some of your changes to the repository for the remaining lessons. This practice illustrated how Aggregate Persistence Wizard can be used to create aggregate tables. The tables that were created with the wizard are not used in the remaining lessons in this course. In this step, you deactivate the new aggregate tables and reactivate the original aggregate tables. a. Return to the ABC repository open in online mode. b. In the Business Model and Mapping layer, expand the Sources folder for the SalesFacts

logical table. c. Double-click the D1_ORDER_AGG1 logical table source. d. Click the General tab and click Active. e. Click OK to close the logical table source dialog box. f. Repeat the steps and activate the D1_SALESREPS and MONTHS logical table sources. g. Return to the Sources folder for the SalesFacts logical table and double-click the

ag_SalesFacts logical table source. h. Click the General tab and deselect Active to deactivate the ag_SalesFacts logical table

source.

i. Click OK to close the logical table source dialog box.

Page 174: Build Repositories Ag

Lesson 9: Using Aggregates

168 Oracle BI Suite EE 10g R3: Build Repositories

j. Use similar steps to deactivate the corresponding dimension logical table sources beginning with SA_ for Customers, Periods, and Products. Only Products is shown in the screenshot.

k. Check in changes. l. Check global consistency. Fix any errors or warnings before you proceed. m. Close the Consistency Check Manager. n. Save the repository. o. Leave the Administration Tool open.

Page 175: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 169

Practice 10-1: Modeling a Value-Based Partition

Goal To model a value-based partition

Scenario ABC wants to implement separate partitions for customer data. One partition will store data for customers A–M, the other will store data for customers N–Z.

Outcome In the Physical layer, there are new physical sources: custAtoM and custNtoZ. In the Logical layer, the logical sources for the Customers logical table are changed.

Time 15–20 minutes

Instructions

1. Examine customer data results. You use this information to compare results later in this practice. a. Return to Answers. If necessary, log in as Administrator with Administrator as the

password. b. Reload server metadata. c. Create and run a request for Customers.Customer. d. Record the name of the first customer in the list:

e. Click the last record button to move to the end of the list. f. Record the total number of customers in the list:

2. Use the Direct Database Request feature to create new partitioned customer tables. a. Click Settings > Administration to open the Oracle BI Presentation Services Administration

window. b. Click Manage Privileges to open the Privilege Administration screen. c. Scroll to the Answers section. Note that the Edit Direct Database Requests privilege is

granted to Presentation Server Administrators. By default, the Administrator user is a member of this group.

d. Note also that the Execute Direct Database Requests privilege is not granted to anyone (not permitted).

e. Click (not permitted) for the Execute Direct Database Requests privilege to open the Change Privilege Permissions screen.

Page 176: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

170 Oracle BI Suite EE 10g R3: Build Repositories

f. Click the Add link next to the Presentation Server Administrators group to give this group explicit access to this privilege.

g. Click Finished to close the Change Privilege Permissions window. Note the change to the

privilege permissions for Execute Direct Database Requests. Presentation Server Administrators can now execute direct database requests.

h. Click Finished to close the Privilege Administration window. i. Click Close Window to close the Oracle BI Presentation Services Administration window. j. Click the Answers link to return to the Answers start page. k. Click the Create Direct Request link. l. In the Connection Pool field, enter SUPPLIER CP. This is the connection pool name for the

ORCL data source. m. Enter the following SQL in the SQL Statement field:

CREATE TABLE D1_custAtoM AS SELECT * FROM D1_CUSTOMER2 WHERE Name < 'N'

n. Click Results. You should see a No Results message. o. Click the Criteria tab. p. Remove the CREATE TABLE SQL from the SQL Statement field. q. Enter the following SQL in the SQL Statement field:

SELECT COUNT(*) FROM D1_custAtoM

r. Click Validate SQL and Retrieve Columns. s. Click Results. You should see COUNT(*) = 94. t. Click the Criteria tab. u. Remove the SELECT COUNT(*) SQL statement from the SQL Statement field. v. Enter the following SQL in the SQL Statement field:

CREATE TABLE D1_custNtoZ AS SELECT * FROM D1_CUSTOMER2 WHERE Name >= 'N'

w. Click Results. You should see a No Results message. x. Click the Criteria tab. y. Remove the CREATE TABLE SQL from the SQL Statement field.

Page 177: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 171

z. Enter the following SQL in the SQL Statement field: SELECT COUNT(*) FROM D1_custNtoZ

aa. Click Validate SQL and Retrieve Columns. bb. Click Results. You should see COUNT(*) = 42.

3. Return to the ABC repository, which should still be open in online mode.

4. Import the new partitioned sources D1_CUSTATOM and D1_CUSTNTOZ into the Physical layer. a. Select File > Import > from Database. b. Select the OCI 10g/11g connection type. c. In the TNS Name field, enter ORCL. d. In the User Name field, enter SUPPLIER2. e. In the Password field, enter SUPPLIER2. f. Click OK. g. In the Import dialog box, expand the SUPPLIER2 schema. h. Press and hold [Ctrl] and select the D1_CUSTATOM and the D1_CUSTNTOZ tables. i. Click Import. j. When the import process completes, close the Import dialog box. k. Ensure that the two new tables are visible in the Physical layer. l. Check in changes. m. Update row counts for the two new tables to ensure connectivity.

CUSTATOM: 94 CUSTNTOZ: 42

5. Use the Physical Diagram and New foreign key button to create the following physical joins from the new customer tables to the D1_ORDERS2 table. Create matching keys when prompted. D1_CUSTATOM.NEWKEY = D1_ORDERS2.CUSTKEY D1_CUSTNTOZ.NEWKEY = D1_ORDERS2.CUSTKEY

6. Add the new sources and change the business model to use the new partitions instead of the original source. a. From the Physical layer, drag D1_CUSTATOM to Customers in the Business Model and

Mapping layer. b. Delete the following new logical columns since they are duplicates and not needed: NEWKEY,

NAME, ZIP_CODE, SALESREP, and ROUTECODE. c. Double-click D1_CUSTATOM in the Sources folder and click the Content tab. d. Click the ellipsis button to open the Fragmentation Content expression builder. e. Select Logical Tables > Customers, and then double-click Customer. The expression is

added to the expression builder.

Page 178: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

172 Oracle BI Suite EE 10g R3: Build Repositories

f. Click “<” and enter ‘N’.

g. Click OK to close the Expression Builder. h. Select This source should be combined with others at this level. i. Click the Column Mapping tab, make sure both mapped and unmapped columns are shown,

and map the logical columns to physical columns. Use the screenshot as a guide.

j. Click OK to close the Logical Table Source dialog box. k. From the Physical layer, drag D1_CUSTNTOZ to Customers in the Business Model and

Mapping layer. l. Delete the following logical columns because they are duplicates and not needed: NEWKEY,

NAME, ZIP_CODE, SALESREP, and ROUTECODE (the last five columns). m. Double-click D1_CUSTNTOZ in the Sources folder and click the Content tab.

Page 179: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 173

n. Click the ellipsis button to open the Fragmentation Content expression builder. o. Select Logical Tables > Customers, and then double-click Customer. p. Click “>=” and enter ‘N’. q. Click OK. r. Select This source should be combined with others at this level. s. Click the Column Mapping tab and modify the mappings as follows:

t. Click OK. u. Deactivate the original source by double-clicking D1_CUSTOMER2, clicking the General

tab, and deselecting the Active flag. v. Click OK. w. Note that you did not have to change the Presentation layer.

7. Check in changes.

8. Check consistency. Fix errors or warnings, if any, before you proceed.

9. If there are no errors or warnings, close the Consistency Check Manager.

10. Save the repository.

11. Test your results. a. Return to Answers. b. Reload server metadata. c. Build a request for Customers.Customer and click the Results tab. d. Click the All Pages button to see all records. e. Compare your results to those in step 1. There should not be any difference. The query

returns 134 customer records.

Page 180: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

174 Oracle BI Suite EE 10g R3: Build Repositories

12. Ensure that the query being issued accesses your new tables. a. Open the query log. b. Ensure that it references your new tables. Both partition tables are used because you

deactivated the detail source table, D1_CUSTOMER2, and did not apply a filter to Customer in the query. Note that a separate select statement is sent to each table and Oracle BI Server performs a UNION ALL to combine the results.

c. Close the log file.

13. Execute a new query for names greater than or equal to “N.” a. Return to Answers and add a filter to Customer to show names greater than or equal to “N.” b. Add SalesFacts.Dollars and run the query. c. Ensure that your result displays only names starting with “N” and above.

d. Open the query log and ensure that the query being issued accesses the correct partition,

D1_CUSTNTOZ, for the Customer data.

e. Close the log file.

Page 181: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 175

14. Further test that your results are correct for names less than “N.” a. Return to Answers and edit the filter to show names less than “N.” b. Run the query. c. Ensure that your result displays only names less than “N.”

d. Open the query log and ensure that the query being issued accesses the correct partition,

D1_CUSTATOM, for the Customer data.

e. Close the log file.

Page 182: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

176 Oracle BI Suite EE 10g R3: Build Repositories

Page 183: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 177

Solutions 10-1: Modeling a Value-Based Partition

Answers

1.d. Record the name of the first customer in the list: 2nd & Goal Sports Cafe

1.f. Record the total number of customers in the list: 134

Page 184: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

178 Oracle BI Suite EE 10g R3: Build Repositories

Page 185: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 179

Practice 10-2: Modeling a Fact-Based Partition

Goals To incorporate quotas in the business model and create new business measures using a fact-based partition

Scenario ABC sets sales quotas for its sales organization. These quotas are set at the region level by quarter. In addition, each of the region sales quotas is broken down by product type. Quota numbers are stored in an Excel workbook. The workbook, quota.xls, is stored on your machine. You incorporate the quota numbers in the business model and create business measures to report variance from quota and percent of quota.

Time 10–15 minutes

Instructions

1. Create an ODBC data source for an Excel spreadsheet. a. Double-click Data Sources (ODBC) on your desktop to open the ODBC Data Source

Administrator. b. Click the System DSN tab. c. Click Add. d. Select the Microsoft Excel Driver and click Finish. e. Enter xls_quota as the data source name. f. Click Select Workbook. g. Navigate to D:\Labs and select the quota.xls workbook. h. Click OK. i. Click OK to close the ODBC Microsoft Excel Setup dialog box. j. Click OK to close the ODBC Data Source Administrator.

2. Import the xls_quota data source into the ABC repository. a. Return to the ABC repository, which should still be open in online mode. b. Select File > Import > from Database. c. Select the xls_quota data source, and enter Administrator as the username; no password

is needed. d. Click OK. The Import dialog box opens. e. Expand D:\Labs\quota. f. Select and import the following tables:

Item Types Quarters Regions regiontypequota

Page 186: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

180 Oracle BI Suite EE 10g R3: Build Repositories

g. Close the Import dialog box.

3. Because Excel has limited data types, check or change the data types to conform to existing data types for the relevant fields. Expand the physical tables and double-click the physical columns to open the properties dialog box. ItemType: VARCHAR 20 Quarter: DOUBLE YR: DOUBLE Region CHAR 16 Dollars: DOUBLE

4. Specify joins and keys. a. For each table, double-click the table, click the Keys tab, and use the New button to specify

the table keys as follows:

b. Use the Physical Table Diagram to specify the following foreign key joins:

ItemTypes.ItemType = regiontypequota.ItemType Regions.Region = regiontypequota.Region Quarters.YR = regiontypequota.YR AND Quarters."Quarter" = regiontypequota."Quarter" Hint: Press and hold [Ctrl] and create the multicolumn join for the Quarters columns or enter the join expression in the Expression edit field:

Page 187: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 181

c. Check your work:

d. Close the Physical Diagram.

5. Create a new measure for quotas. a. Create a new logical column in the SalesFacts table and name it Quota. b. Set the aggregation rule to SUM.

6. Create a new logical table source for SalesFacts by dragging the Dollars physical column from the regiontypequota physical table onto the Quota logical column that was just created. This automatically creates a new regiontypequota logical table source.

Page 188: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

182 Oracle BI Suite EE 10g R3: Build Repositories

7. Specify the content for the new regiontypequota logical table source on the Content tab of the Logical Table Source properties dialog box:

8. Create new logical table sources for the dimension tables. a. Drag the YR physical column from the Quarters physical table onto the Year logical

column in the Periods logical table. This automatically creates a new Quarters logical table source for the Periods logical table.

b. Repeat the steps for the following columns: Physical Table.Column Logical Table.Column Quarters.Quarter into Periods.Quarter Regions.Region into Customers.Region ItemTypes.ItemType into Products.Type This automatically creates a Regions logical table source for the Customers logical table and an ItemTypes logical table source for the Products logical table.

9. Specify the content level for the Quarters, Regions, and ItemTypes logical table sources. Use the screenshots as a guide.

Page 189: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 183

It is best practice to set the aggregation level of these dimension sources. You specify the content of a dimension table source in terms of the hierarchy of that dimension only. The content of a fact table source is specified in terms of the content of all dimensions.

10. Drag the Quota logical column into the SalesFacts presentation table.

11. Check in changes.

12. Check consistency. If you get a warning that the features in database xls_quota do not match the defaults, you can ignore the warning for the purposes of this practice. If you want to prevent the warning message from appearing, click Options > Warnings > Database, and disable Check Features Match Default. Fix any other errors or warnings before you proceed.

13. Close the Consistency Check Manager.

14. Save the repository and leave it open for the next practice.

Page 190: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

184 Oracle BI Suite EE 10g R3: Build Repositories

Page 191: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 185

Practice 10-3: Using the Calculation Wizard to Create Derived Measures

Goals To utilize the Administration Tool Calculation Wizard to create derived measures

Scenario Use the Calculation Wizard to create two derived measures: Variance from Quota and Percent of Quota.

Time 5–10 minutes

Instructions

1. In this step, you use the Calculation Wizard to create two new measures. a. Right-click the Dollars logical column and select Calculation Wizard. The Calculation

Wizard opens. b. Click Next. The Calculation Wizard – Choose Columns dialog box opens. c. Click SalesFacts. d. In the right pane, select the Quota check box. e. Click Next. f. Ensure that the Change check box is checked in the Generate Calculations section and enter

Variance from Quota in the Calculation Name field to change the name of this calculation.

g. Deselect the Percent Change calculation check box. h. Select the Percent check box, and rename the measure Percent of Quota. The

Calculation Wizard writes the correct formula for each measure, handling the cases of NULL and zero values according to the default.

Page 192: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

186 Oracle BI Suite EE 10g R3: Build Repositories

i. Click Next. Objects that have to be checked out are displayed. j. Click Next. The new calculations that the wizard will create are displayed. k. Click Finish to close the Calculation Wizard. The new measures are added to the business

model. l. Drag the new measures to the Sales Facts presentation table in the Presentation layer.

2. Check in changes.

3. Check consistency. Fix any errors or warnings before you proceed.

4. Close the Consistency Check Manager.

5. Save and close the repository.

6. Return to Answers, reload server metadata, and run the following query and filter:

Page 193: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 187

7. Check your results. In the screenshot, the columns have been formatted.

8. Check the query log. The log shows that a single logical query generated two physical queries. Oracle BI Server automatically joined the two result sets on the basis of common values in the logical dimension columns. The join of two results sets from two different sources is always a full outer join. Mapping two sources to the same logical columns (as you did for region, year, quarter, and type) was all that was necessary to cause this join to happen.

9. Close the query log.

Page 194: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

188 Oracle BI Suite EE 10g R3: Build Repositories

Page 195: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 189

Practice 10-4: Modeling Fragmented Inventory Data

Goal To create a business model for fragmented inventory data

Scenario ABC’s inventory data is fragmented, that is, it is split into multiple tables. Data values determine which table contains which data. In this example, eight quarters of inventory data are stored in eight separate tables. You need to create a business model for this fragmented inventory data.

Time 60 - 75 minutes

Instructions

1. Stop the Oracle BI Server service and open the ABC repository in offline mode.

2. Import the inventory tables into the repository. a. Select File > Import > from Database. b. Select the OCI 10g/11g connection type. c. Enter ORCL as the TNS name. d. Enter SUPPLIER2 as the username and password, and click OK. The Import dialog box

opens. This may take a few moments. e. Scroll to and expand the SUPPLIER2 schema. f. Select the following tables for import:

g. Ensure that Tables, Keys, and Foreign Keys are selected. h. Click Import. The import process starts. Because you are importing foreign keys, this may

take a while. i. When importing is complete, close the Import dialog box. j. Ensure that the new tables are added to the Physical layer.

Page 196: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

190 Oracle BI Suite EE 10g R3: Build Repositories

k. Select all the newly imported tables and click the Physical Diagram button on the toolbar. Rearrange the tables and use the zoom feature as necessary to make the tables visible in the diagram. Assuming you imported both keys and foreign keys, the physical diagram should resemble the following screenshot:

If you did not import the foreign keys, you need to manually configure the joins in the physical diagram or delete the tables and reimport with foreign keys selected. Because the names of keys and foreign keys match, if you do elect to manually configure the joins, the Administration Tool automatically selects the correct columns when you join the tables.

l. Close the Physical Diagram. m. Update row counts to check connectivity. n. If desired, right-click the new Inventory tables and select View Data to get an idea of what

data is contained in these tables.

3. Create the business model. a. Right-click in the white space of the Business Model and Mapping layer and select New

Business Model. b. Name the business model Inventory and click OK.

4. Create the fact table. a. Right-click the Inventory business model and select New Object > Logical Table. b. Name the logical table Inventory Facts and click OK to close the dialog box.

This fact table will have four facts: Beginning Inventory Dollars, Ending Inventory Dollars,

Page 197: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 191

Beginning Inventory Quantity, and Ending Inventory Quantity. These facts will map to physical columns in the eight Inventory physical tables.

c. Expand INVENTORY_Q1_2004. d. Drag the following four columns simultaneously to the Inventory Facts logical table:

BOH_DLL BOH_QTY EOH_DLL EOH_QTY Note that INVENTORY_Q1_2004 is added as a logical table source to the Inventory Facts table.

e. Expand the INVENTORY_Q1_2005 table and drag the same four columns simultaneously to the Inventory Facts logical table. Because the column names are identical, you can drag all four columns simultaneously. Note that INVENTORY_Q1_2005 is added as a source to the Inventory Facts table.

f. Repeat this process for the remaining six INVENTORY tables. The Inventory Facts table should look like this when the process is complete:

All of these sources are at the same level of aggregation and they all contain mappings to the same logical facts. The only difference in the tables is the time period of the data.

g. Rename the logical fact columns: Old Name New Name

BOH_DLL Beginning Inventory Dollars

EOH_DLL Ending Inventory Dollars

BOH_QTY Beginning Inventory Quantity

EOH_QTY Ending Inventory Quantity

Page 198: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

192 Oracle BI Suite EE 10g R3: Build Repositories

5. Create the dimension tables for the Inventory business model. a. Create a Products logical table with the logical columns and logical table sources shown

here:

b. Create a Periods logical table:

c. Create a Regions logical table:

6. Create the logical joins (using the New Complex Join button) in the business model diagram:

7. Drag the Inventory business model to the Presentation layer.

8. Check global consistency. Fix any errors or warnings before you proceed.

9. If the repository is consistent, a message appears that business model Inventory is consistent. Click Yes. The Consistency Check Manager opens.

10. Close the Consistency Check Manager. The Inventory business model is now available for queries.

11. Save the repository. Do not check consistency again.

Page 199: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 193

12. Create three dimensions in the Inventory business model. You need the dimensions because the inventory measures are semiadditive, that is, they have dimension-specific aggregation rules. You need dimensions in order to define these rules. Remember to include the correct number of elements at each level. a. Create the PeriodsDim dimension:

b. Create the ProductsDim dimension:

c. Create the RegionsDim dimension:

13. Add aggregation rules to the measures. a. Create aggregation rules for Beginning Inventory Dollars. The rules are to sum beginning

inventory dollars over product and region, and then take the first of these by time to get beginning inventory dollars. Use the screenshot as a guide.

Page 200: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

194 Oracle BI Suite EE 10g R3: Build Repositories

b. Create aggregation rules for Ending Inventory Dollars. The rule is the same as that for Beginning Inventory Dollars, except to take the Last by time.

c. Repeat the process for Beginning Inventory Quantity and Ending Inventory Quantity.

14. Define the fragmentation content for the Inventory Facts logical table sources. a. Right-click the LU_QUARTER table in the Physical layer and select View Data. You use this

information to build the fragmentation content for the logical table sources in the steps that follow.

b. Specify the fragmentation content for the INVENTORY_Q1_2004 logical table source.

Make sure that This source should be combined with other sources at this level is selected. This lets Oracle BI Server know that to obtain a complete set of information at this level, the sources need to be combined (union). If deselected, the server would infer that sources contained redundant information. Also, note that the fragmentation content is specified in terms of the logical columns from the dimension table. That is, it uses the values that a user is likely to include in a query filter.

Page 201: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 195

c. Specify the fragmentation content for the INVENTORY_Q1_2005 logical table source.

d. Use these two examples as models and specify fragmentation content for the remaining six

logical table sources. Hint: Cut and paste the fragmentation content formula and then modify accordingly.

15. Use the Query Repository Utility to check fragmentation content. a. Select Tools > Query Repository.

Page 202: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

196 Oracle BI Suite EE 10g R3: Build Repositories

b. In the Type field, select Logical Table Source. c. Click the Filter button. d. In the Item field, select Has fragmentation. Ensure that the filter condition is Has

fragmentation = true.

e. Click OK. f. Click Query. The results should include all eight Inventory logical table sources.

g. Close the Query Repository utility.

16. Modify the Presentation layer so that it resembles the following screenshot:

17. Check Global Consistency. Fix any error or warning messages before you proceed.

Page 203: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

Oracle BI Suite EE 10g R3: Build Repositories 197

18. Close the Consistency Check Manager.

19. Save and close the repository.

20. Test your work. a. Start the Oracle BI Server service. b. Return to Answers. c. Reload server metadata. d. Click the Inventory subject area. e. Create the following query and filter.

f. Click Results.

g. Check the query log. The query log should show that the SQL included only a single logical

table source (fragment): INVENTORY_Q1_2005. This is because only this logical table source specified fragmentation content that included QUARTER_ID = 200501.

h. Close the query log. i. Create another query and filter:

j. Click Results.

Page 204: Build Repositories Ag

Lesson 10: Using Partitions and Fragments

198 Oracle BI Suite EE 10g R3: Build Repositories

k. Examine the query log. Note that there are four query blocks now, one for each logical table source with specified fragmentation content that included YEAR_ID = 2005. Also, note that the query combines the results (union all), orders the results by quarter within year, and selects the last row for each year. In this case, it is only one year, 2005. The following screenshot shows a portion of the query log SQL:

l. Close the query log.

Page 205: Build Repositories Ag

Lesson 11: Using Repository Variables

Oracle BI Suite EE 10g R3: Build Repositories 199

Practice 11-1: Creating Dynamic Repository Variables

Goal To create and use dynamic repository variables

Scenario ABC has implemented separate partitions for customer data. However, when the partitions get reloaded, 50% of the data is loaded into the first partition and 50% of the data into the second partition. You create an initialization block and a dynamic repository variable, and then use the variable to determine how the data is split between the partitions.

Outcome A new initialization block called CustomerDataSplit is created with the EndPartOne variable.

In the Business Model and Mapping layer, sources for the Customers logical table are modified.

Time 10–15 minutes

Instructions

1. Open the ABC repository in online mode.

2. In this step, you create an initialization block. Initialization blocks contain SQL statements that initialize variables. The variables are repository variables and their values persist until the initialization block resets them the next time it runs. Repository initialization blocks execute whenever Oracle BI Server starts up and thereafter according to any schedule that is applied. a. Select Manage > Variables. b. Select Action > New > Repository> Initialization Block. c. Name the block CustomerDataSplit. d. Click Edit Data Source. e. Click the Browse button. f. Select the SUPPLIER CP connection pool object. g. Click the Select button. The connection pool is added to the Repository Variable Init Block

Data Source dialog box.

Page 206: Build Repositories Ag

Lesson 11: Using Repository Variables

200 Oracle BI Suite EE 10g R3: Build Repositories

h. Enter the following SQL in the Default Initialization String field to capture the first letter of the maximum customer name in the D1_CUSTATOM table: SELECT SUBSTR(MAX(UPPER(NAME)),1,1) AS EXPR1 FROM SUPPLIER2.D1_CUSTATOM

i. Click OK to close the dialog box.

3. Create the variables. a. Click Edit Data Target. b. Click the New button. c. In the Name field, enter EndPartOne.

Page 207: Build Repositories Ag

Lesson 11: Using Repository Variables

Oracle BI Suite EE 10g R3: Build Repositories 201

d. Enter ‘A’ in the Default Initializer section:

e. Click OK to close the Dynamic Repository Variable dialog box. f. Click OK to close the Repository Variable Init Block Variable Target dialog box. g. Click Edit Data Source. h. Click Test to test the variable and check your results:

i. Click Close. j. Click OK to close the Repository Variable Init Block Variable Target dialog box. k. Click OK to close the Repository Variable Init Block dialog box. The initialization block and

dynamic repository variable are visible in the Variable Manager.

l. Select Action > Close to close the Variable Manager.

4. Use the variable to dynamically determine the content in the customer sources. a. In the SupplierSales business model, expand Customers and then Sources. b. Double-click D1_CUSTOMER2.

Page 208: Build Repositories Ag

Lesson 11: Using Repository Variables

202 Oracle BI Suite EE 10g R3: Build Repositories

c. Click the General tab and ensure that the source is inactive (Active is not selected.). d. Click OK. e. Double-click D1_CUSTATOM. f. Click the General tab. g. In the Name field, enter CustPartOne. h. Ensure that Active is selected. i. Click the Content tab. j. Open the Expression Builder by clicking the ellipsis button next to the Fragmentation content

field. k. Remove < ‘N’ from the expression. l. Click the “<=” button. m. Select Repository Variables in the left pane and double-click EndPartOne in the middle

pane to change the expression to use the variable. n. Click OK. o. Check your result:

p. Ensure that the This source should be combined with other sources at this level check box

is selected. q. Click OK. r. Double-click D1_CUSTNTOZ. s. Click the General tab. t. In the Name field, enter CustPartTwo. u. Ensure that Active is selected. v. Click the Content tab. w. Open the Expression Builder. x. Remove >= ‘N’ from the expression.

Page 209: Build Repositories Ag

Lesson 11: Using Repository Variables

Oracle BI Suite EE 10g R3: Build Repositories 203

y. Click the “>” button. z. Select Repository Variables in the left pane and double-click EndPartOne in the middle

pane to change the expression to use the variable. aa. Click OK. bb. Check your result:

cc. Ensure that the This source should be combined with other sources at this level check box

is selected. dd. Click OK. ee. The two sources with content expressions based on the repository variables are renamed in

the Sources folder:

5. Check in changes.

6. Check consistency. Fix errors or warning messages, if any, before you proceed.

7. Close the Consistency Check Manager.

8. Save and close the repository.

9. Test your results. a. Restart the Oracle BI Server service.

Page 210: Build Repositories Ag

Lesson 11: Using Repository Variables

204 Oracle BI Suite EE 10g R3: Build Repositories

b. Navigate to D:\OracleBI\server\log and open NQQuery.log. c. Scroll to the end of the file to locate the query issued by the initialization block:

d. Close the log file. e. Return to Answers. f. Reload server metadata. g. Use the SupplierSales subject area and create a request with Customers.Customer. h. Add a filter for customer names less than “B”:

i. Run the query and ensure that your results display names starting less than “B”:

j. Select Settings > Administration > Manage Sessions > View Log to open the query log. k. Ensure that the D1_CUSTATOM table is being used:

l. Close the log file.

10. Further test your results. a. Return to Answers and change the filter to provide names greater than “X”.

Page 211: Build Repositories Ag

Lesson 11: Using Repository Variables

Oracle BI Suite EE 10g R3: Build Repositories 205

b. Run the query and check the results:

c. Ensure that the SQL in the log file references the D1_CUSTNTOZ table:

d. Close the log file.

11. In the remaining practices you do not use separate partitions for customer data. In this step, you activate the D1_CUSTOMER2 logical data source for the Customers table and deactivate the two partitioned data sources. a. Open the ABC repository in online mode. b. In the SupplierSales business model, expand the Customers table and the Sources folder. c. Double-click the D1_CUSTOMER2 logical table source. d. Click the General tab, select the Active check box, and click OK. e. Double-click the CustPartOne logical table source. f. Click the General tab, deselect the Active check box, and click OK. g. Double-click the CustPartTwo logical table source. h. Click the General tab, deselect the Active check box, and click OK. i. Check your results:

12. Check in changes.

13. Check consistency. Fix any errors or warnings before continuing.

14. Save the repository.

15. Leave the repository open for the next practice.

Page 212: Build Repositories Ag

Lesson 11: Using Repository Variables

206 Oracle BI Suite EE 10g R3: Build Repositories

Practice 11-2: Using Dynamic Repository Variables as Filters

Goal To create and use dynamic repository variables as filters

Scenario Rather than creating hard-coded column filters like Year = 1999 in Answers requests, ABC wants to use variables that always return the current year, current month, and current day. You create these dynamic repository variables and then use them in column filters in Oracle BI Answers.

Outcome New initialization block, Current Periods, and three new dynamic repository variables—CurrentYear, CurrentMonth, and CurrentDay—are created.

Time 10–15 minutes

Instructions

1. In this step, you create a new initialization block. This initialization block will initialize three variables called CurrentYear, CurrentMonth, and CurrentDay. The variables will get their values from the initialization block SQL according to the schedule you set. In this example, the system determines the value of the current day by finding the maximum value of the period key (YYYMMDD) in the D1_ORDERS2 table and then determining the month code and year that correspond to that value in the D1_CALENDAR2 table. a. Select Manage > Variables. b. Select Action > New > Repository > Initialization Block. c. Name the block CurrentPeriods. d. Click Edit Data Source. e. Click the Browse button. f. Double-click the SUPPLIER CP connection pool object to select it.

Page 213: Build Repositories Ag

Lesson 11: Using Repository Variables

Oracle BI Suite EE 10g R3: Build Repositories 207

g. Enter the following SQL in the block to determine the value of the current day by finding the maximum value of the period key (YYYMMDD): SELECT YYYYMMDD, MONTHCODE, YEAR FROM SUPPLIER2.D1_CALENDAR2 WHERE YYYYMMDD = (SELECT MAX(PERIODKEY) FROM SUPPLIER2.D1_ORDERS2)

h. Click OK to close the Repository Variable Init Block Data Source dialog box.

2. Create the variables. a. Click the Edit Data Target. b. Create three new variables: CurrentDay, CurrentMonth, CurrentYear. The order is

important. The value that comes back from the first column in the initialization block SQL, YYYYMMDD, is assigned to the CurrentDay variable. The value of the second column, MONTHCODE, is assigned to CurrentMonth (the second variable), and the value of the third column, YEAR, is assigned to CurrentYear (the third variable). If necessary, use the Up and Down buttons to arrange the variables.

c. Click OK to close the Repository Variable Init Block Variable Target dialog box. d. Leave the default refresh interval set to every hour. This means that the variables will be

reinitialized every hour. e. Click Edit Data Source.

Page 214: Build Repositories Ag

Lesson 11: Using Repository Variables

208 Oracle BI Suite EE 10g R3: Build Repositories

f. Click the Test button and check the results:

In this example, the results are determined by the data in the SUPPLIER2 database used for this course, which holds data only through the year 1999.

g. Click Close to close the Results window. h. Click OK to close the Repository Variable Init Block Data Source dialog box. i. Click OK to close the Repository Variable Init Block dialog box. j. Check your work in the Variable Manager:

k. Close the Variable Manager. l. Check in changes. m. Save the repository.

3. Test your work. a. Return to Answers. b. Reload server metadata. c. Create the following request:

d. Click the Add Filter button for the Year column. The Create/Edit Filter dialog box opens. e. Select Add > Variable > Repository. f. In the Server Variable field, enter CurrentYear to add a filter for the Year column using

the CurrentYear repository variable.

g. Click OK.

Page 215: Build Repositories Ag

Lesson 11: Using Repository Variables

Oracle BI Suite EE 10g R3: Build Repositories 209

h. Click Results and ensure that only data for the current year (1999 based on this data set) is returned.

i. Check the query log. Note that the logical request filters for the variable (you may need to

scroll to the right):

j. Close the log file.

Page 216: Build Repositories Ag

Lesson 11: Using Repository Variables

210 Oracle BI Suite EE 10g R3: Build Repositories

Page 217: Build Repositories Ag

Lesson 12: Modeling Time Series Data

Oracle BI Suite EE 10g R3: Build Repositories 211

Practice 12-1: Creating Time Series Comparison Measures

Goal To create Month time comparison measures using the Ago and ToDate functions

Scenario You use the Oracle BI Ago and ToDate functions to create new measures and calculations to enable users to compare dollar performance from a month back and calculate the dollar change, the percentage of dollar change, and the to-date dollar change. You then add the new measures to the presentation catalog and test the comparison measures using Answers.

Outcome In the Presentation layer, Month Ago Dollars, Change Month Ago Dollars, Percent Change Month Ago Dollars, Month To Date Dollars columns are added to the SalesFacts table. New time comparison measures are tested using Oracle BI Answers.

Time 15 minutes

Background The ability to compare business performance with previous time periods is fundamental to understanding a business. Yet, as Ralph Kimball states, SQL was not designed to make straightforward comparisons over time:

“The most difficult area of data warehousing is the translation of simple business analyses into SQL. SQL was not designed with business reports in mind. SQL was really an interim language designed to allow relational table semantics to be expressed in a convenient and accessible form, and to enable researchers and early developers to proceed with building the first relational systems in the mid-1970s. How else can you explain the fact that there is no direct way in SQL to compare this year to last year?” – Ralph Kimball

Instructions

1. Return to the ABC repository open in online mode.

2. In the SupplierSales business model, identify the PeriodsDim dimension as a time dimension. a. In the SupplierSales business model, double-click PeriodsDim. b. Select the Time Dimension check box. c. Click OK to close the Dimension dialog box.

Page 218: Build Repositories Ag

Lesson 12: Modeling Time Series Data

212 Oracle BI Suite EE 10g R3: Build Repositories

3. Identify level keys as chronological keys. a. Expand PeriodsDim and double-click the Month level. b. Click the Keys tab. c. Select the Chronological Key check box for MonthCode. d. Click OK to close the dialog box.

4. Create a measure that calculates dollars for the previous month. a. Right-click SalesFact and select New Object > Logical Column. b. Name the column Month Ago Dollars. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder. e. Select Functions > Time Series Functions > Ago. f. Click Insert to add the Ago function to the Expression Builder. g. Click <<Measure>> in the expression. h. Select Logical Tables > Sales Facts and then double-click Dollars to add it to the

expression. i. Click <<Level>> in the expression. j. Select Time Dimensions > PeriodsDim and then double-click Month to add it to the

expression. k. Click <<Number of Periods>> and enter 1. The Ago function calculates the Dollars value

one month before the current month. l. Click OK to close the Expression Builder. m. Check your work:

n. Click OK to close the Logical Column dialog box. o. Drag the Month Ago Dollars logical column to the SalesFacts presentation folder.

5. Create a measure that calculates the difference in dollars between the current month and the previous month. a. Right-click SalesFact and select New Object > Logical Column. b. Name the new logical column Change Month Ago Dollars. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder.

Page 219: Build Repositories Ag

Lesson 12: Modeling Time Series Data

Oracle BI Suite EE 10g R3: Build Repositories 213

e. Select Logical Tables > Sales Facts and then double-click Dollars to add it to the expression.

f. Insert a minus sign. g. Select Logical Tables > Sales Facts and then double-click Month Ago Dollars. h. Click OK to close the Expression Builder. i. Check your work:

j. Click OK to close the Logical Column dialog box. k. Drag the Change Month Ago Dollars logical column to the SalesFacts presentation folder.

6. Create a measure that calculates the percentage change in dollars between the current month and the previous month. a. Right-click SalesFact and select New Object > Logical Column. b. Name the new logical column Percent Change Month Ago Dollars. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder and create the following expression:

100 * (SupplierSales.SalesFacts.Dollars - SupplierSales.SalesFacts."Month Ago Dollars") / "SupplierSales"."SalesFacts"."Month Ago Dollars"

e. Click OK to close the Expression Builder.

Page 220: Build Repositories Ag

Lesson 12: Modeling Time Series Data

214 Oracle BI Suite EE 10g R3: Build Repositories

f. Check your work:

g. Click OK to close the Logical Column dialog box. h. Drag the Percent Change Month Ago Dollars logical column to the SalesFacts presentation

folder.

7. Create a measure that calculates a running sum of dollars over the past year on a monthly basis. a. Right-click SalesFacts and select New Object > Logical Column. b. Name the new logical column Year To Date Dollars. c. Select the Use existing logical columns as the source check box. d. Open the Expression Builder. e. Select Functions > Time Series Functions and double-click ToDate to insert the

expression. f. Click <<Measure>>. g. Select Logical Tables > Sales Facts and then double-click Dollars. h. Click <<Level>>. i. Select Time Dimensions > PeriodsDim and the double-click Year. j. Click OK to close the Expression Builder. k. Check your work:

Page 221: Build Repositories Ag

Lesson 12: Modeling Time Series Data

Oracle BI Suite EE 10g R3: Build Repositories 215

l. Click OK to close the Logical Column dialog box. m. Drag the Year To Date Dollars logical column to the SalesFacts presentation folder.

8. Set the sort order column for the Month logical column. a. Expand the Periods logical table. b. Double-click Month to open the logical column dialog box. c. Click the Set button. d. Select MonthCode and click OK. The Month column is now automatically sorted by

MonthCode whenever it is used in an Answers query. You check this later in this practice. e. Click OK to close the logical column dialog box.

9. Check in changes.

10. Check consistency. Fix errors or warnings, if any, before you proceed.

11. Close the Consistency Check Manager.

12. Save and the repository.

13. Check your work in Answers. a. Return to Answers. b. Reload server metadata. c. Create the following query and filter:

Note: Press and hold [Ctrl] and add the Year filter or remove Year from the query criteria after the filter is set.

d. Click Results.

Page 222: Build Repositories Ag

Lesson 12: Modeling Time Series Data

216 Oracle BI Suite EE 10g R3: Build Repositories

a. Note that Month is sorted automatically based on the MonthCode sort order column you set in the repository.

Page 223: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

Oracle BI Suite EE 10g R3: Build Repositories 217

Practice 13-1: Modeling a Bridge Table

Goals To configure a bridge table for commission data

Scenario An ABC sales representative may participate in many deals that pay commission. Additionally, each deal may include many sales representatives so that each sales representative receives a percentage of the commission. You need to model this many-to-many relationship in the repository.

There is a D1_COMMISSION fact table with commissions paid per invoice. D1_COMMISION_BRIDGE is the bridge table used to create a many-to-many relationship between the D1_COMMISSION fact table and the D1_SALESREP dimension table. D1_COMMISION_BRIDGE includes a weight factor to calculate the weighted distribution of commissions among sales teams. You import the tables and model them in the repository.

Time 15–20 minutes

Instructions

1. Import commission tables into the repository. a. Return to the ABC repository, which should still be open in online mode. b. Select File > Import > from Database. c. Select the OCI 10g/11g connection type. d. In the TNS name field, enter ORCL. e. Enter SUPPLIER2 as username and password, and click OK. f. Expand SUPPLIER2 and select D1_COMMISSION and D1_COMMISSION_BRIDGE. g. Ensure that Tables is selected and click Import. h. When import completes, click Close. i. In the Physical layer, expand ORCL > SUPPLIER2 and ensure that the two tables were

imported. j. Check in changes. k. Save the repository. l. Update row counts on each table to check connectivity. Both tables should return 38 rows. m. View data for D1_COMMISSION. Note that COMM_KEY 1111 has two rows, each with a

commission amount of $22,000 for a total commission amount of $44,000. This is an example of a situation where commissions may be paid in installments; for example, 50% of the commission is paid when the item is ordered, and the other 50% is paid when the item is paid for. Note that CUST_KEY 1118 is associated with these two rows. You use this information to check your work in Answers later in this practice.

n. View data for D1_COMMISSION_BRIDGE. Note that Alan Ziff shares commission with Andrew Taylor for COMM_KEY 1111. Each earns 50% of the commission (0.5 weight factor). Since the total commission for COMM_KEY 1111 is $44,000, each sales

Page 224: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

218 Oracle BI Suite EE 10g R3: Build Repositories

representative earns $22,000 for this deal. You use this information to check your work in Answers later in this practice.

2. Define the physical keys. a. Double-click D1_COMMISSION. b. Click the Keys tab. c. Click New. d. Enter D1_COMMISSION_Key as the key name. e. Select COMM_KEY, CUST_KEY, and PERIOD_KEY. f. Click OK. g. Click OK to close the Physical Table dialog box. h. Repeat the steps to create a key named D1_COMMISSION_BRIDGE_Key for the

D1_COMMISSION_BRIDGE table with the columns COMM_KEY and SALESREP. i. Check in changes and save the repository.

3. Create the physical joins. a. Select the D1_COMMISSION, D1_COMMISSION_BRIDGE, D1_CUSTOMER2, and

D1_SALESREP tables. b. Right-click any one of the highlighted tables and select Physical Diagram > Selected

Object(s) Only. c. Create the following foreign key joins. Click Yes when prompted to create a matching table

key: D1_CUSTOMER2.NEWKEY = D1_COMMISSION.CUST_KEY D1_SALESREPS.SALESREP = D1_COMMISSION_BRIDGE.SALESREP D1_COMMISSION.COMM_KEY = D1_COMMISSION_BRIDGE.COMM_KEY

d. Note the one-to-many relationships between D1_COMMISSION, D1_SALESREPS and the D1_COMMISSION_BRIDGE bridge table.

e. Close the Physical Diagram window. f. Check in changes. g. Save the repository.

4. Create the logical model. a. Right-click the SupplierSales business model and select New Object > Logical Table. b. Name the logical table Commission Fact and click OK. c. From the Physical layer, drag D1_COMMISSION.COMM_AMT to Commission Fact in the

BMM layer. d. Drag D1_SALESREPS from the Physical layer onto the SupplierSales business model in the

Business Model and Mapping layer. e. Rename the D1_SALESREPS logical table to SalesReps. f. Select the Commission Fact, Customers, and SalesRep logical tables. g. Right-click any of the highlighted tables and select Business Model Diagram > Selected

Tables Only. h. Create logical joins from the Customers and SalesRep logical tables to Commission Fact. i. Close the Logical Table Diagram.

Page 225: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

Oracle BI Suite EE 10g R3: Build Repositories 219

j. Check in changes. k. Do not check global consistency. l. Save the repository.

5. Map the bridge table to the fact logical table source. a. Expand Commission Fact > Sources and ensure that there is a D1_COMMISSION logical

table source. b. Double-click the D1_COMMISSION logical table source. c. Click the General tab. d. Click Add and map to the D1_COMMISSION_BRIDGE table.

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

6. Create a calculation measure using commission and weight factor physical columns. a. Rename the COMM_AMT logical column to Commission. b. Double-click the Commission logical column. c. Click the Data Type tab. d. Double-click the D1_COMMISION logical table source. e. Click the Column Mapping tab. f. Click the ellipsis button for the Commission logical column to open Expression Builder. g. Build the following expression:

"ORCL".""."SUPPLIER2"."D1_COMMISSION"."COMM_AMT" * "ORCL".""."SUPPLIER2"."D1_COMMISSION_BRIDGE"."WEIGHT_FACTOR"

h. Close Expression Builder and the Logical Table Source dialog box. i. Click the Aggregation tab and set the aggregation rule to SUM. j. Click OK to close the Logical Column dialog box. k. Check in changes.

Page 226: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

220 Oracle BI Suite EE 10g R3: Build Repositories

l. Check consistency. m. Save the repository.

7. Map objects to the Presentation layer. a. Drag the SalesReps and Commission Fact tables onto SupplierSales in the Presentation

layer. b. For testing purposes, drag Customers.CustomerKey onto the Customers presentation table. c. Check in changes. d. Check consistency. e. Save the repository.

8. Check your work. a. Log in to Answers as Administrator with password Administrator. b. Click SupplierSales. c. Reload server metadata. d. Create a query with Customers.Customer and CommissionFact.Commission. e. Click Results. The results show total commissions by customer.

f. Click Customers.CustomerKey to add it to the results. Note that Mayflower Cuisinier is

the customer associated with customer key 1118. Recall that earlier in the practice you examined the source data to determine that the total commission associated with customer key 1118 is equal to $44,000.

g. Click SalesRep.SALESREP to add it to the results. The results show commission earned by each sales representative calculated by the weight factor in the bridge table.

h. Click the All Pages button and ensure that Alan Ziff shares commission with Andrew Taylor for Mayflower Cuisinier. Each earned $22,000, 50% of the total commission, which matches the source data you examined earlier in this practice.

Page 227: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

Oracle BI Suite EE 10g R3: Build Repositories 221

i. Check the log file to ensure that the D1_COMMISSION fact table and D1_COMMISSION_BRIDGE bridge table were both accessed.

j. Close the Session Monitor, Session Management, and Oracle BI Presentation Services

Administration pages. k. Log out of Oracle BI Presentation Services. l. Leave the Oracle BI Administration Tool open for the next practice.

Page 228: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

222 Oracle BI Suite EE 10g R3: Build Repositories

Practice 13-2: Modeling a Helper Table

Goals To model a helper table in Oracle BI and validate its configuration

Scenario Requirements have been gathered indicating that sales deals are executed and owned at different levels within the organization. The management wants to know which managers are responsible for what sales and product returns per their sales representatives’ efforts. The data warehouse team has created a helper table to support the requirement and you model this table in the Oracle BI repository.

Time 40–50 minutes

Instructions

1. Import the D1_RETURNS, W_POSITION_D, and W_POSITION_H tables into the repository. a. Return to the ABC repository, which should still be open in online mode. b. Select File > Import > from Database. c. Select the OCI 10g/11g connection type. d. In the TNS name field, enter ORCL. e. Enter SUPPLIER2 as the username and password, and click OK. f. Expand the SUPPLIER2 schema and select the D1_RETURNS, W_POSITION_D, and

W_POSITION_H tables. g. Ensure that Tables is selected and click Import. h. When import completes, close the Import dialog box. i. Check in changes. j. Save the repository.

2. Check connectivity and view data. a. To check connectivity, update row counts for the D1_RETURNS, W_POSITION_D, and

W_POSITION_H tables. D1_RETURNS should return 263 rows, W_POSITION_D should return 7 rows, and W_POSITION_H should return 11 rows.

b. View data for the W_POSITION_D table. This table includes the position ID and position name for seven employees.

Page 229: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

Oracle BI Suite EE 10g R3: Build Repositories 223

c. View data for the W_POSITION_H table. This helper table includes the position ID, subposition ID, and position gap for the same seven employees.

d. View data for the D1_RETURNS table. This fact table contains product return data. Note that

return data is associated only with position IDs 4, 5, 6, and 7. You use this information to check your model when you run queries in Answers later in this practice.

e. Check in changes. f. Save the repository.

3. Create physical joins. a. Select the D1_CUSTOMER2, D1_PRODUCTS, D1_RETURNS, and W_POSITION_D

physical tables. b. Right-click any one of the highlighted tables and select Physical Diagram > Selected

Object(s) Only. c. Create the following foreign key joins. Click Yes when asked to create a matching table key.

D1_CUSTOMER2.NEWKEY = D1_RETURNS.CUSTKEY D1_PRODUCTS.PRODUCTKEY = D1_RETURNS.PRODKEY W_POSITION_D.POSTN_ID = D1_RETURNS.POSTN_ID

d. Close the Physical Diagram.

4. Create an alias of the Position dimension table to support the business requirements. The Position table includes records for employees and managers. You need to create an alias of the Position table to report on both at the same time. In this step, you create an alias for W_POSITION_D named W_POSITION_D (Manager). a. Right-click W_POSITION_D and select New Object > Alias. b. Click the General tab, and name the table W_POSITION_D (Manager). Click OK. c. Check in changes and save the repository.

5. Create a foreign key join from the W_POSITION_H helper table to the W_POSITION_D dimension table. This joins the subordinate position ID in the helper table to the position ID in the Position dimension table. a. Select the W_POSITION_H and W_POSITION_D tables. b. Right-click either of the highlighted tables and select Physical Diagram > Selected

Object(s) Only. c. Create the following foreign key join:

W_POSITION_H.SUB_ID = W_POSITION_D.POSTN_ID d. Click OK.

Page 230: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

224 Oracle BI Suite EE 10g R3: Build Repositories

e. Click Yes when asked to create a matching table key.

6. Create a foreign key join from the W_POSITION_D (Manager) alias to the W_POSITION_H helper table. This joins the position ID of the manager in the manager alias table to the position ID in the position dimension table. a. Resize the Physical Diagram window so that the Physical layer is visible. b. Select the D1_RETURNS and W_POSITION_D (Manager) tables. c. Right-click either of the highlighted tables and select Physical Diagram > Selected

Object(s) Only to add the tables to the physical diagram. d. Create the following foreign key join:

"W_POSITION_D (Manager)".POSTN_ID = W_POSITION_H.POSTN_ID e. Click OK. f. Click Yes when asked to create a matching table key. g. Check in changes. Your diagram should resemble the screenshot:

h. Close the Physical Diagram window. i. Check in changes and save the repository.

7. Add objects to the Business Model and Mapping layer and create logical joins. a. Drag D1_RETURNS to the SupplierSales business model in the Business Model and

Mapping layer. b. Rename D1_RETURNS to Returns. c. Drag W_POSITION_D to the SupplierSales business model in the Business Model and

Mapping layer. d. Rename the W_POSITION_D table Position. e. Create logical joins from Customers, Position, and Products to Returns. f. Expand the Position logical table. g. Rename the SALESREP column Employee Name. h. Rename the POSITION column Employee Position. i. Rename the POSTN_ID column Employee ID. j. Drag W_POSITION_D (Manager) to the Position logical table to add a new logical table

source and columns. k. Rename the SALESREP column Manager Name. l. Rename the POSITION column Manager Position. m. Rename the POSTN_ID column Manager ID.

8. Map the W_POSITION_D (Manager) logical table source to the W_POSITION_H table. a. Expand Position > Sources and open the W_POSITION_D (Manager) logical table

source.

Page 231: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

Oracle BI Suite EE 10g R3: Build Repositories 225

b. If necessary, click the General tab. c. Click Add. d. In the Browse window, in the right pane, double-click the W_POSITION_H physical table to

add it to the W_POSITION_D (Manager) logical table source. e. Leave the Logical Table Source dialog box open for the next step.

9. Create column mappings. a. Click the Column Mapping tab. b. Click New Column. c. Enter Positional Hierarchy Gap as the column name. d. Click OK. e. If necessary, select the Show unmapped columns check box. f. Click the ellipsis button to the right of the Positional Hierarchy Gap logical column to open

Expression Builder. g. Select Physical Tables > W_POSITION_H and then double-click the Gap physical column

to add it to the expression. Recall that Gap is a column in the helper table that stores the gap between levels.

h. Click OK to close Expression Builder. i. Map the Manager Name logical column to

"ORCL".."SUPPLIER2"."W_POSITION_H"."SALESREP". Hint: Delete the existing formula in Expression Builder.

j. Map the Manager Position logical column to "ORCL".."SUPPLIER2"."W_POSITION_H"."POSITION".

k. Leave the Manager ID logical column as-is, mapped to "ORCL".""."SUPPLIER2"."W_POSITION_D (Manager)"."POSTN_ID".

l. Click OK to close the Logical Table Source dialog box. m. Check in changes. n. Check consistency. o. Save the repository.

10. Create a position dimension hierarchy. a. Right-click the SupplierSales subject area and select New Object > Dimension. b. Enter PositionDim as the dimension name and click OK. c. Right-click PositionDim and select New Object > Logical Level. d. Enter Position Total as the level name and select the Grand total level check box. e. Click OK. f. Right-click the Position Total level and select New Object > Child Level. g. Enter Position Detail as the level name and set the number of elements to 100. h. Click OK. i. Drag the Employee ID and Positional Hierarchy Gap columns from the Positions logical

table to the Position Detail level of the hierarchy. j. Double-click the Position Detail level and click the Keys tab of the Logical Level dialog

box.

Page 232: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

226 Oracle BI Suite EE 10g R3: Build Repositories

k. Click New to add a new primary key. l. In the Logical Level Key dialog box, select the check boxes for Employee ID and Positional

Hierarchy Gap. m. Deselect the Use for drilldown check box. n. Click OK. o. Click OK.

11. Create a new measure for the Returns fact table. a. Right-click Returns and select New Object > Logical Column. b. Enter # of Returns as the column name. c. Click the Data Type tab. d. Double-click the D1_RETURNS logical table source. If necessary, select Show all logical

sources. e. Make sure that Show unmapped columns is selected. f. Click the ellipsis button next to the # of Returns logical column to open Expression

Builder. g. Select Physical Tables > D1_RETURNS and then double-click the RETURNS physical

column to add it to the expression. h. Click OK to close Expression Builder. i. Click OK to close the Logical Table Source dialog box. j. Click the Aggregation tab. k. Change the default aggregation rule to Count. l. Click OK.

12. Assign the detail level of the dimension hierarchies to the fact logical table source. a. Expand Returns > Sources. b. Double-click the D1_RETURNS logical table source. c. In the Logical Source dialog box, click the Content tab. d. Set the following logical levels:

CustomersDim: Customers Detail PositionDim: Position Detail ProductsDim: Specific Leave PeriodsDim blank.

e. Click OK to close the Logical Table Source dialog box. f. Expand Position > Sources. g. Set the PositionDim logical level to Position Detail for both logical table sources. h. Check in changes. i. Check consistency. j. If the repository is consistent, save the repository.

13. Build the Presentation layer. a. Drag the Position and Returns logical tables to the SupplierSales presentation catalog. b. Delete all presentation columns except # of Returns from the Returns presentation

table.

Page 233: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

Oracle BI Suite EE 10g R3: Build Repositories 227

c. Check in changes and check for consistency. d. Save the repository.

14. Test your work. a. Log in to Oracle BI Presentation Services as Administrator with Administrator as

the password. b. Click Answers. c. Select the SupplierSales subject area. d. Reload server metadata. e. Create and execute the following request:

Position.Employee Name, Position.Employee ID, Returns.# of Returns. f. Note that # of Returns data is associated only with employee position IDs 4, 5, 6, and 7. As

you saw earlier when you examined the source data, only these four employees are directly associated with returns.

g. Check the query log. Note that the W_POSITION_H helper table is not accessed.

h. Click the Criteria tab. i. Add Manager Name and Manager Position to the request and reorder the columns so that

Manager Name and Manager Position appear as follows:

j. Click Results.

Note: The # of Returns data for all four employees roll up to Alan Ziff, VP of Sales. The # of

Page 234: Build Repositories Ag

Lesson 13: Modeling Many-to-Many Relationships

228 Oracle BI Suite EE 10g R3: Build Repositories

Returns data for direct reports roll up to their respective sales managers. Also, data for Anne Williams appears in two positions, as both a sales manager and an employee.

k. Check the query log. Note that the W_POSITION_H helper table is accessed.

l. Click Customers.Customer to add the column to the results and see returns by sales

representative by customer. m. Log out of Answers. n. Leave the Administration Tool open for the next practice.

Page 235: Build Repositories Ag

Lesson 14: Localizing Oracle BI Metadata

Oracle BI Suite EE 10g R3: Build Repositories 229

Practice 14-1: Localizing Repository Metadata

Goal To localize Oracle BI repository metadata

Scenario The Externalize Strings repository utility has been run to export Presentation layer object strings to a table in comma-separated format. The table has been updated to include translated strings. You import the table, create an initialization block to populate translation session variables, modify My Account localization preferences, and check the results in Answers and NQQuery.log.

Time 15–20 minutes

Instructions

1. Create an ODBC data source for an Excel spreadsheet with language translations. The Externalize Strings utility has already been run to export presentation layer object strings to the spreadsheet. Rows with corresponding translations have been added to the spreadsheet. a. Select Start > Programs > Administrative Tools > Data Sources (ODBC). b. Click the System DSN tab. c. Click Add. d. Select Microsoft Excel Driver (*.xls) and click Finish. e. Enter TRANSLATIONS as the data source name. f. Click Select Workbook. g. Navigate to D:\Labs, select the TRANSLATIONS spreadsheet, and click OK. h. Click OK. i. Click OK to close the ODBC Data Source Administrator.

2. Import the TRANSLATIONS table into the Physical layer. a. Return to the ABC repository, which should still be open in online mode. b. Select File > Import > from Database. c. In the Select ODBC Data Source dialog box, ensure that the ODBC 3.5 data source

connection type is selected. d. Select the TRANSLATIONS data source and click OK. e. Ensure that Tables is selected, and click Import. f. When import completes, click Close. g. Check in changes. h. Save the repository. i. Update row counts for the TRANLSATIONS table. You should see 40 rows. 20 rows are the

English objects and 20 rows are the French translations. j. View data for the TRANSLATIONS table. The table contains three required columns.

LANG_ID identifies the language for each row. In this example, there are rows for English

Page 236: Build Repositories Ag

Lesson 14: Localizing Oracle BI Metadata

230 Oracle BI Suite EE 10g R3: Build Repositories

(en) and French (fr). MSG_NUM (message number) identifies the metadata display variable to translate. Each message number corresponds to a metadata object display variable in the repository. MSG_TEXT contains the language-specific text for each row. Note that there is a row for English and another for French.

k. Check in changes. l. Save the repository.

3. Create the external metadata strings initialization block. This initialization block populates the MSG_NUM and MSG_TEXT variables with values from the TRANSLATIONS table, matching the WEBLANGUAGE session variable to the LANG_ID stored in the table. a. Select Manage > Variables. b. Select Action > New > Session > Initialization Block. c. Name the initialization block TRANSLATIONS. d. Click Edit Data Source. e. In the Default Initialization String field, enter the following SELECT statement:

SELECT MSG_NUM, MSG_TEXT FROM TRANSLATIONS WHERE ‘VALUEOF(NQ_SESSION.WEBLANGUAGE)’ = LANG_ID

f. Click Browse to select the connection pool. g. In the left pane, expand TRANSLATIONS and double-click Connection Pool to select it.

“TRANSLATIONS”.”Connection Pool” is displayed in the Connection Pool field in the Session Variable Initialization Block Data Source dialog box.

h. Click Test. You should receive an “Empty result set” message. i. Why are no records returned?

j. Click OK to close the message. k. Click Close. l. Click OK to close the Session Variable Initialization Block Data Source dialog box. m. Click Edit Data Target. n. Select the Row-wise Initialization check box to enable it. o. Click OK. p. Click OK to close the Session Variable Initialization Block dialog box. q. Select Action > Close to close the Variable Manager. r. Check in changes. s. Save the repository.

4. Externalize the metadata names and descriptions for the SupplierSales presentation catalog. This enables repository object names and descriptions to be read from the MSG_NUM and MSG_TEXT session variables that are populated by the initialization block. a. In the Presentation layer, right-click the SupplierSales presentation catalog and select

Externalize Display Names.

Page 237: Build Repositories Ag

Lesson 14: Localizing Oracle BI Metadata

Oracle BI Suite EE 10g R3: Build Repositories 231

Note: Externalize Display Names may already have a gray check mark next to it. This is an effect of the scripted installation process, and does not affect the application. Once you have chosen Externalize Display Names, ensure that the check mark is black.

b. Right-click the SupplierSales Presentation folder and select Externalize Descriptions. Note: Externalize Descriptions may already have a gray check mark next to it. This is an effect of the scripted installation process, and does not affect the application. Once you have chosen Externalize Descriptions, ensure that the check mark is black.

c. Check in the changes. d. Check consistency. e. Save the repository.

5. Log in to Oracle BI Presentation Services as Administrator in the English language and check the effect of your configuration in Oracle BI Answers. a. Select Start > Programs > Oracle Business Intelligence > Presentation Services. b. On the Login screen, enter Administrator with password Administrator. c. Ensure that English is selected in the Select a Language field. d. Click Log In. e. Click Answers. f. Note the description for the SupplierSales subject area:

This is the description for SupplierSales. g. Click SupplierSales. h. Place the cursor over the Customers table to display the description:

Customers: This is the description for Customers. i. Click Settings > My Account at the top of the screen. j. Set Locale (location) to français – France. The User Interface Language field automatically

updates to français. k. Click Finished. l. Click the Refresh button in the Web Browser.

Note: You may be asked to log back in to the application. Click Log In to reenter the application.

m. Note that the SupplierSales object names and descriptions now display the French translations.

n. Select Parametres > Mon compte at the top of the screen and change your account information back to English – United States.

o. Click Fin at the upper right corner. p. Refresh the browser to check the change. q. Navigate to D:\OracleBI\server\log and open the NQQuery.log file.

Page 238: Build Repositories Ag

Lesson 14: Localizing Oracle BI Metadata

232 Oracle BI Suite EE 10g R3: Build Repositories

r. Scroll to the bottom of the file and ensure that the TRANSLATIONS initialization block issued a SQL query:

s. Close NQQuery.log. t. Leave Answers and the Administration Tool open for the next practice.

Page 239: Build Repositories Ag

Lesson 14: Localizing Oracle BI Metadata

Oracle BI Suite EE 10g R3: Build Repositories 233

Solutions 14-1: Localizing Repository Metadata

Answers

3.i. Why are no records returned? No records are returned because we are comparing the transformed LANG_ID to a session variable. Without logging in to Oracle BI Presentation Services there is no session variable for comparison.

Page 240: Build Repositories Ag

Lesson 14: Localizing Oracle BI Metadata

234 Oracle BI Suite EE 10g R3: Build Repositories

Page 241: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

Oracle BI Suite EE 10g R3: Build Repositories 235

Practice 15-1: Localizing Oracle BI Data

Goals To localize product type data from English to French

Scenario To localize product type data from English to French, you import the necessary translation tables, create an initialization block and session variable to establish a user-preferred language, modify the WHERE clause for the column being translated, and check results in Oracle BI Answers.

Time 40–50 minutes

Instructions

1. Import the D1_LOV_D and D1_LANG tables into the repository. a. Return to the ABC repository, which should still be open in online mode. b. Select File > Import > from Database. c. Select the OCI 10g/11g connection type. d. Enter ORCL as the TNS Name. e. Enter SUPPLIER2 as username and password, and click OK. f. Expand SUPPLIER2 and select the D1_LANG and D1_LOV_D tables. g. Ensure that Tables is selected and click Import. h. When import completes, click Close. i. Check in changes. j. Save the repository. k. Update row counts for the D1_LOV_D table. You should see 42 rows. l. View data for the D1_LOV_D table. The table contains four columns needed for language

translation. LANG_ID identifies the language for each row. In this example, there are rows for English (en) and French (fr). TYPE is the categorization for the set of values. LIC (language-independent code) identifies the metadata to translate. Each LIC value corresponds to a data value. VAL contains the language-specific text for each row that is displayed to the user.

m. Update row counts for the D1_LANG table. You should see 2 rows. n. View data for the D1_LOV_D table. The table contains three columns needed for language

translation. LANG_ID identifies the language of the row. LANGUAGE identifies the language name. LANGUAGE_EXTENSION is used for languages with variations that depend on a country or region.

o. Check in changes. p. Save the repository.

2. Create an initialization block and session variable to establish a user-preferred language. This initialization block checks the user’s preferred language against the languages listed in the

Page 242: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

236 Oracle BI Suite EE 10g R3: Build Repositories

D1_LANG table. If the language is in the table, the translation is performed. Otherwise, a default language is selected. a. Select Manage > Variables. b. Select Action > New > Session > Initialization Block. c. Enter LANG_ID as the initialization block name. d. Click Edit Data Source. e. In the Default Initialization String field, enter the following SELECT statement:

SELECT LANG_ID FROM D1_LANG WHERE LANG_ID = 'VALUEOF(NQ_SESSION.WEBLANGUAGE)' This will populate the session variable with the user’s preferred language if it is in the D1_LANG table.

f. Click Browse to select the connection pool. g. In the right pane, double-click SUPPLIER CP to select it. “ORCL”.” SUPPLIER CP” is

displayed in the Connection Pool field in the Session Variable Initialization Block Data Source dialog box.

h. Click Test. You should receive an “Empty result set” message. i. Click OK to close the message. j. Click Close to close the Results window. k. Click OK to close the Session Variable Initialization Block Data Source dialog box. l. Click Edit Data Target. m. Click New. n. Enter WEBLANG as the session variable name. o. For the default initializer, enter ‘fr’, including the single quotes. This makes the language

default to French if the user-preferred language is not found in the D1_LANG table. p. Click OK. q. Click OK to close the Session Variable Initialization Block Variable Target dialog box. r. Click OK to close the Session Variable Initialization Block dialog box. s. Select Action > Close to close the Variable Manager. t. Check in changes. u. Save the repository.

3. Create an alias for the language translation values based on D1_LOV_D. Each alias corresponds to the translation of a single column in a single dimension table. In this case, you create an alias to translate the item type column. a. In the Physical layer, right-click the D1_LOV_D table and select New Object > Alias. b. Enter ItemType (D1_LOV_D) as the alias table name. c. Click OK. d. Check in changes. e. Save the repository.

4. Create a join between the ItemType (D1_LOV_D) alias and the product dimension to provide support for the column translation. a. Select ItemType (D1_LOV_D) and D1_PRODUCT_TYPE.

Page 243: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

Oracle BI Suite EE 10g R3: Build Repositories 237

b. Right-click either of the highlighted tables and select Physical Diagram > Selected Objects Only.

c. Use the New Foreign Key button to create the following join: D1_PRODUCT_TYPE.ITEMTYPE = "ItemType (D1_LOV_D)".LIC

d. Click OK. e. Click Yes to create a matching table key. f. Close the Physical Diagram. g. Check in changes. h. Save the repository.

5. Map an existing logical table source to the LOV alias. a. Expand SupplierSales > Products > Sources in the Business Model and Mapping layer. b. Double-click the Type logical table source. c. Click the General tab. d. Click Add. e. In the right pane, double-click ItemType (D1_LOV_D) to add it to the Type logical table

source.

f. Leave the Logical Table Source dialog box open for the next step.

6. Modify the Type field to map to the VAL column in the D1_LOV_D table alias instead of the ITEMTYPE column in D1_PRODUCT_TYPE. This is how the language translation is performed. The VAL column contains all the language-specific strings for ITEMTYPE, and this mapping, in conjunction with a WHERE filter, finds the appropriate value corresponding to the language and column. a. Click the Column Mapping tab. b. Click the ellipsis button next to Type to open Expression Builder.

Page 244: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

238 Oracle BI Suite EE 10g R3: Build Repositories

c. Delete the existing formula. d. Select Physical Tables > ItemType (D1_LOV_D) and double-click VAL to insert it in the

formula. e. Click OK to close Expression Builder. f. Click the Content tab. g. Click the ellipsis next to the WHERE clause field to open Expression Builder. h. Build the following expression:

"ORCL".."SUPPLIER2"."ItemType (D1_LOV_D)"."LANG_ID" = VALUEOF(NQ_SESSION.WEBLANG) AND "ORCL".."SUPPLIER2"."ItemType (D1_LOV_D)"."TYPE" = 'ABC Product Type' The first clause searches for records on the LOV alias table that have the same language ID as specified in the language initialization block. Recall that this is either the user’s preferred language or a default language if their preferred language does not have provided translations. The second clause identifies the set of records in the LOV table that are of the ABC Product Type category. These two criteria, along with the physical layer join between the ‘ItemType (WC_LOV_D)’ alias and the D1_PRODUCT_TYPE table, filter the appropriate data to bring back a single value for product type that is language-specific to the user.

Page 245: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

Oracle BI Suite EE 10g R3: Build Repositories 239

i. Click OK to close Expression Builder.

j. Click OK to close the Logical Table Source dialog box. k. Double-click the D1_PRODUCTS logical table source. l. Click the Column Mapping tab. m. Click the ellipsis next to the Type logical column.

Page 246: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

240 Oracle BI Suite EE 10g R3: Build Repositories

n. Delete the formula in Expression Builder window. o. Click OK to close Expression Builder. p. Click OK to close the Logical Table Source dialog box.

Note: Product Type in the dimension hierarchy as well as the Presentation Layer has automatically been updated with changes to the source tables.

7. For the purpose of this practice, deactivate the ItemTypes logical table source. a. Double-click the ItemTypes logical table source. This is a logical table source you created in

an earlier practice. b. Click the General tab. c. Deselect Active. You do this so Oracle BI Server does not use this logical source when you

execute a query in the next set of steps. d. Click OK. e. Check in changes. f. Check consistency. For the purpose of this practice you can ignore the warning message for

the SalesFacts logical table. g. Save the repository.

8. Test your work. a. If you are logged in to Oracle BI Presentation Services, log out. If you are not logged in,

select Start > Programs > Oracle Business Intelligence > Oracle BI Presentation Services.

b. Select français as the preferred language and enter Administrator as the username and password.

c. Click Connexion. d. Click Réponses (Answers). e. Click Ventes de fournisseur (SupplierSales). f. Click Recharger les metadonnees du serveur to reload server metadata. g. Create a query for Produits.Type.

Page 247: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

Oracle BI Suite EE 10g R3: Build Repositories 241

h. Click Résultats. Your results should appear as follows:

i. Check the log file and ensure that the VAL column in the D1_LOV_D table is accessed with

the expected WHERE clause.

j. Click Deconnexion to log out of Oracle BI. k. Click ici to log in. l. Change the language to English and log in as Administrator with password

Administrator. m. Rebuild and reexecute the Products.Type request and ensure that the results are now

returned in English. n. Log out and log back in with Deutsch as the language. o. Execute the same request. p. Why are the results in French?

q. Log out and log back in with English as the language.

9. Reactivate the ItemTypes logical table source. a. Return to the ABC repository, which should still be open in online mode.

Page 248: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

242 Oracle BI Suite EE 10g R3: Build Repositories

b. In the Business Model and Mapping layer, navigate to SupplierSales > Products > Sources. c. Double-click the ItemTypes logical table source. d. Click the General tab. e. Select Active and click OK to activate the logical table source. You do this so that you do

not receive warning messages when you run consistency checks. f. Check in changes. g. Check consistency. Ensure that you no longer receive the warning message you received

earlier for the SalesFacts logical table. h. Save the repository. i. Leave Answers and the Administration Tool open for the next practice.

Page 249: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

Oracle BI Suite EE 10g R3: Build Repositories 243

Solutions 15-1: Localizing Oracle BI Data

Answers

8.p. Why are the results in French? The default initializer in the initialization block is set to ‘fr’. This makes the language default to French if the user-preferred language is not found in the D1_LANG table.

Page 250: Build Repositories Ag

Lesson 15: Localizing Oracle BI Data

244 Oracle BI Suite EE 10g R3: Build Repositories

Page 251: Build Repositories Ag

Lesson 16: Setting an Implicit Fact Column

Oracle BI Suite EE 10g R3: Build Repositories 245

Practice 16-1: Setting an Implicit Fact Column

Goals To set an implicit fact column for a presentation catalog

Scenario ABC tracks both product sales and product return information. ABC wants to ensure that dimension-only queries with columns from more than one dimension return the expected results. To ensure the expected results, you test different implicit fact column settings for the SupplierSales presentation catalog.

Time 10–15 minutes

Instructions

1. Set an implicit fact column for the SupplierSales presentation catalog to point to a measure in the Returns fact table. a. Return to the ABC repository, which should still be open in online mode. b. In the Presentation layer, right-click SupplierSales and select Properties. c. Click the General tab. d. In the Implicit Fact Column section, click Set. e. Expand Returns, select the # of Returns column and click OK. f. Click OK to close the Presentation Catalog dialog box. g. Check in changes. h. Check global consistency. i. Save the repository.

2. Test the Returns implicit fact column. a. If necessary, start Answers and log in as Administrator with Administrator

password. b. Select the SupplierSales subject area. c. Reload server metadata. d. Create the following dimension-only query: Customers.Customer, Products.Generic with

Customer filter set to Rib Pit. e. Click Results and verify that 9 rows are returned. f. Select Settings > Administration > Manage Sessions. g. View the log for the request. h. Verify that the RETURNS implicit fact column and D1_RETURNS fact table are included in

the query, although the column is not visible in the query results in Answers. (The screenshot

Page 252: Build Repositories Ag

Lesson 16: Setting an Implicit Fact Column

246 Oracle BI Suite EE 10g R3: Build Repositories

shows only partial results):

i. Close the Session Monitor. j. Click Finished in the Session Management window. k. Click Close Window in the Oracle BI Presentation Services Administration window. l. Log out of Answers.

3. Set an implicit fact column for the SupplierSales presentation catalog to point to a measure in the SalesFacts fact table. a. Return to the ABC repository, which should still be open in online mode. b. In the Presentation layer, right-click SupplierSales and select Properties. c. In the Implicit Fact Column section, click Clear. d. In the Implicit Fact Column section, click Set. e. Expand SalesFacts, select the Dollars column and click OK. f. Click OK to close the Presentation Catalog dialog box. g. Check in changes. h. Check global consistency. i. Save the repository.

4. Test the Dollars implicit fact column. a. Log in to Answers as Administrator with Administrator password. b. Select the SupplierSales subject area. c. Reload server metadata. d. Create the following query: Customers.Customer, Products.Generic with Customer filter

set to Rib Pit. e. Click Results and ensure that 139 rows are returned. Hint: Click the All Pages button to see

the total number of rows returned. f. Select Settings > Administration > Manage Sessions. g. View the log for the request.

Page 253: Build Repositories Ag

Lesson 16: Setting an Implicit Fact Column

Oracle BI Suite EE 10g R3: Build Repositories 247

h. Verify that the Dollars implicit fact column (ACTLEXTND) and the D1_ORDERS2 fact table are included in the query, although the column is not visible in the query results in Answers.

i. Close the Session Monitor. j. Click Finished in the Session Management window. k. Click Close Window in the Oracle BI Presentation Services Administration window. l. Log out of Answers.

5. Clear the implicit fact column for the SupplierSales presentation catalog. a. Return to the ABC repository, which should still be open in online mode. b. In the Presentation layer, right-click SupplierSales and select Properties. c. In the Implicit Fact Column section, click Clear. d. Click OK to close the Presentation Catalog dialog box. e. Check in changes. f. Check global consistency. g. Save the repository.

6. Test with no implicit fact column defined. a. Log in to Answers as Administrator with Administrator password. b. Select the SupplierSales subject area. c. Reload server metadata. d. Create the following query: Customers.Customer, Products.Generic with Customer filter

set to Rib Pit. e. Click Results and ensure that 9 rows are returned. f. Select Settings > Administration > Manage Sessions. g. View the log for the request.

h. Verify that no implicit fact column is included in the SELECT statement. i. Why is the D1_RETURNS table included in the query?

Page 254: Build Repositories Ag

Lesson 16: Setting an Implicit Fact Column

248 Oracle BI Suite EE 10g R3: Build Repositories

j. Close the Session Monitor. k. Click Finished in the Session Management window. l. Click Close Window in the Oracle BI Presentation Services Administration window. m. Log out of Answers.

Page 255: Build Repositories Ag

Lesson 16: Setting an Implicit Fact Column

Oracle BI Suite EE 10g R3: Build Repositories 249

Solutions 16-1: Setting an Implicit Fact Column

Answers

7.i. Why is the D1_RETURNS table included in the query? No implicit fact column is set for the SupplierSales subject area, so for a dimension-only query the Oracle BI Server returns data based on the most economical path, which, in this case, is through the fact table with the least amount of rows.

Page 256: Build Repositories Ag

Lesson 16: Setting an Implicit Fact Column

250 Oracle BI Suite EE 10g R3: Build Repositories

Page 257: Build Repositories Ag

Lesson 17: Integrating Third-Party Reporting Tools

Oracle BI Suite EE 10g R3: Build Repositories 251

Practice 17-1: Integrating a Third-Party Reporting Tool

Goal To use a third-party reporting tool to run queries against Oracle BI Server

Scenario ABC wants to integrate third-party reporting tools with Oracle BI. ABC has a history of using different reporting tools and is concerned that its user population may resist the introduction of a new reporting tool. The long-term goal is to use Oracle BI as the corporate reporting tool and phase out the other reporting tools. In the meantime, you have been asked to demonstrate the ability to run ad hoc queries against Oracle BI Server using a third-party tool.

Time 15–20 minutes

Instructions

1. Modify the Oracle BI ODBC data source. a. Select Start > Programs > Administrative Tools > Data Sources (ODBC). b. Click the System DSN tab. c. Double-click AnalyticsWeb. d. Click Next. e. Enter Administrator as the login ID and password. f. Check Connect to Oracle BI Server to obtain default settings for the additional

configuration. g. Click Next. h. Change the default catalog to SupplierSales. i. Click Finish. j. Click OK to close the ODBC Data Source Administrator dialog box.

2. Add logical keys to the Presentation layer. a. Return to the ABC repository, which should still be open in online mode. b. Drag PRODKEY and CUSTKEY from Returns in the Business Model and Mapping layer

to Returns in the Presentation layer. c. Drag ProductKey from Products in the Business Model and Mapping layer to Products in

the Presentation layer. d. Check in changes e. Check consistency. f. Save the repository.

3. Create a new Access database and link it to tables in the Oracle BI repository using the AnalyticsWeb ODBC DSN. a. Select Start > Programs > Microsoft Office > Microsoft Office Access 2003 to open

Microsoft Access.

Page 258: Build Repositories Ag

Lesson 17: Integrating Third-Party Reporting Tools

252 Oracle BI Suite EE 10g R3: Build Repositories

b. Select File > New. c. In the New File pane on the right, click Blank Database. d. In the File New Database dialog box, click the My Documents shortcut icon in the left pane. e. Enter Test.mdb as the file name. f. Click Create. g. Select File > Get External Data > Link Tables. h. In the Link dialog box, select ODBC Databases from the Files of type drop-down menu. i. In the Select Data Source dialog box, click the Machine Data Source tab. j. Select AnalyticsWeb as the data source and click OK. k. In the Oracle BI Server Login dialog box, enter Administrator as the login ID and

password. l. Click OK. m. In the Link Tables dialog box, select the Customers, Products, and Returns tables. n. Select the Save Password check box.

o. Click OK. p. Click Cancel to close the Unique Identifier dialog box for each table.

4. Define the one-to-many joins between the linked tables to support the star schema. a. Select Tools > Relationships. b. In the Show Table dialog box, select the three tables.

c. Click Add.

Page 259: Build Repositories Ag

Lesson 17: Integrating Third-Party Reporting Tools

Oracle BI Suite EE 10g R3: Build Repositories 253

d. Click Close. e. Drag Customers.CustomerKey to Returns.CUSTKEY. f. Click Create. g. Drag Products.ProductKey to Returns.PRODKEY. h. Click Create. i. Select File > Save to save the database. j. Close the Relationships window.

5. Create and run a query to verify that you can use Access to query the tables through Oracle BI Server. a. In the test: Database window, select Queries. b. Double-click Create query in Design View. c. In the Show Table dialog box, select all three tables and click Add. d. Click the Close button to close the Show Table dialog box. e. In the drop-down list for the first field, select Products.Generic. f. In the drop down list for the second field, select Customers.Customer. g. In the drop-down list for the third field, select Returns.# of Returns.

h. Select Query > Run or click the Run button .

Page 260: Build Repositories Ag

Lesson 17: Integrating Third-Party Reporting Tools

254 Oracle BI Suite EE 10g R3: Build Repositories

i. Click the last record button, check the status bar, and ensure that 258 records are returned.

j. Close the Query window without saving. k. Close Microsoft Access. You have successfully accessed Oracle BI Server via a third-party

tool. l. Navigate to D:\OracleBI\server\Log and open NQQuery.log. m. Scroll to the bottom of the file and then back up to the last SQL Request. You should see a

query similar to the screenshot.

n. Close NQQuery.log. o. Return to Answers, run the same query (Products.Generic, Customers.Customer,

Returns.# of Returns), click the Last Page button, and ensure that you get the same results: 258 records.

Page 261: Build Repositories Ag

Lesson 17: Integrating Third-Party Reporting Tools

Oracle BI Suite EE 10g R3: Build Repositories 255

p. Select Settings > Administration > Manage Sessions, check the log and ensure that the query is similar to the one executed via MS Access.

Page 262: Build Repositories Ag

Lesson 17: Integrating Third-Party Reporting Tools

256 Oracle BI Suite EE 10g R3: Build Repositories

Page 263: Build Repositories Ag

Module 18: Creating Repositories from Multidimensional Data Sources

Oracle BI Suite EE 10g R3: Build Repositories 257

Practice 18-1 Creating a Repository Using a Multidimensional Data Source

Goals To use create a repository using an Essbase multidimensional data source

Scenario In this practice, you use a simulate practice created with Oracle Simbuilder to create a repository using an Essbase multidimensional data source. Please read the instructions to launch and complete the simulated practice.

Time 25 – 30 minutes

Instructions

1. Launch the simulation. a. Navigate to D:\Labs\MDS and double-click index.htm to open Internet Explorer. b. Click To help protect your security, Internet Explorer has restricted this file from

showing active content that could access your computer. Click here for options… c. Click Allow Blocked Content… to open a Security Warning message. d. Click Yes. e. Click To help protect your security, Internet Explorer has restricted this file from

showing active content that could access your computer. Click here for options… f. Click Allow Blocked Content… to open a Security Warning message. g. Click Yes.

Page 264: Build Repositories Ag

Module 18: Creating Repositories from Multidimensional Data Sources

258 Oracle BI Suite EE 10g R3: Build Repositories

h. Click Create a Repository Using a Multidimensional Data Source to view the list of exercises in this simulated practice.

i. Click the mouse icon (start exercise) next to Import a Multidimensional Data Source to start the first exercise.

j. Follow the onscreen instructions to complete the simulated practice.

Page 265: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 259

Practice 19-1: Creating Users and Groups

Goal To set up user access so that Oracle BI Server can authenticate users and assign them appropriate permissions

Scenario You can maintain a list of users, their passwords, and groups in the Oracle BI repository. When using Oracle BI security, which is the default, Oracle BI Server authenticates users against this list. In this practice, you create new users and groups using the Oracle BI Administration Tool. After you have created these users, you assign them to the appropriate group.

Time 10–15 minutes

Instructions

1. Return to the ABC repository open in online mode.

2. Create the user Sara Wright. a. Select Manage > Security to open the Security Manager. b. Select Users in the left pane. c. Right-click in the white space of the right pane and select New User. d. Create the user with the following information:

User name SWRIGHT

Full Name Sara Wright

Password <Blank>

Logging level 2

Note that setting the logging level to 2 ensures that query activity by this user is recorded in the query log.

e. Click OK to close the User window.

3. Repeat this process and create the following users: User Name Full Name Logging Level

PSMITH Paul Smith 0

RMIND Rob Mind 0

JCRAFT Jen Craft 0

MWEST Mary West 2

JMEYER Jacob Meyer 2

Page 266: Build Repositories Ag

Lesson 19: Security

260 Oracle BI Suite EE 10g R3: Build Repositories

4. In the Security Manager window, ensure that your results resemble the following:

5. Create the SalesManagers group and add Sara Wright and Paul Smith to this group. A group is a set of permissions. When a user belongs to a group, the user inherits the permissions of the group. Groups can belong to other groups and, therefore, inherit the permissions of other groups. a. In the left pane of the Security Manager, select Groups. b. Right-click in the right pane and select New Security Group. c. Enter SalesManagers in the Name field and click the Add button. d. Press and hold [Ctrl] and select SWRIGHT and PSMITH. e. Click OK. SWRIGHT and PSMITH are now part of the SalesManagers group. f. Click OK to close the Group dialog box.

6. Repeat this process and create the following groups and assign users to the groups: Group Name Add User

SalesUsers RMIND, JCRAFT

SalesHR JMEYER

7. Assign MWEST to the Administrators group. When a repository is created, an Administrator user and an Administrators group are automatically created. The Administrator user automatically belongs to the Administrators group. The Administrator user cannot be deleted or removed from the Administrators group. Additional users can be added to the Administrators group. All members of the Administrators group can fully administer a repository. a. Double-click Administrators. b. Add MWEST. c. Click OK to close the Group dialog box. d. At this point, the group and the user structure resemble the following:

SalesManagers Group SalesUsers Group SalesHR Group Administrators Group

SWRIGHT RMIND JMEYER Administrator

PSMITH JCRAFT MWEST

8. Select Action > Close to close Security Manager.

Page 267: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 261

9. In this step, you set repository object permissions for a user, Jacob Meyer. Jacob Meyer should not be given access to the SupplierSales presentation catalog. Use the Administration Tool to explicitly prohibit Meyer’s access to this object. a. In the Presentation layer, double-click SupplierSales. b. Click the General tab. c. Click the Permissions button. d. Note that by default Everyone has read permission for this object. e. Click Show all users/groups. f. Select the JMEYER check box twice. The red X indicates that Meyer does not have access

to the SupplierSales presentation catalog.

g. Do the remaining users have read access?

h. Why or why not?

i. Click OK to close the Permissions dialog box. j. Click OK to close the Presentation Catalog dialog box.

10. Check in changes.

11. Check consistency. Fix any errors or warnings before you proceed.

12. Save the repository.

13. With your changes now saved, log in as the new users and examine the impact of the permissions that you set. a. Return to Answers, log out, and then log back in as MWEST; no password is needed.

Page 268: Build Repositories Ag

Lesson 19: Security

262 Oracle BI Suite EE 10g R3: Build Repositories

b. Click the Dashboards link and make sure you can see Welcome, Mary West! to ensure that you are logged in as Mary.

c. Click the Answers link. d. What subject areas are available to Mary?

e. Click the SupplierSales link and note that Mary has access to the same objects as the Administrator user: Customers, Periods, Products, Facts, SalesFacts, and so on.

f. Click Log Out in the upper-right corner. g. Click the here link to log back in. h. Log in as JMEYER; no password is needed. i. Does the SupplierSales subject area display?

j. Why is this?

k. Log out of Oracle BI Presentation Services.

14. In this step, you explore how to change the default permission setting for the Everyone user in the Oracle BI Server NQSConfig.ini file. a. Navigate to D:\OracleBI\server\Config and open the NQSConfig.ini file. b. Scroll to the SECURITY section. c. Note that DEFAULT_PRIVILEGES is set to READ.

d. Close the NQSConfig.ini file without making any changes. This default permission

could be set to READ or NONE. When the default is set to NONE and a new object is created, the permission for Everyone looks like this:

Oracle recommends that the default permission be set to READ, so you retain DEFAULT_PRIVILEGES set to READ. If you change the default for DEFAULT_PRIVILEGES, it only impacts new objects after the NQSConfig.ini file is saved and Oracle BI Server is restarted. The status of permission for Everyone in the existing objects is not affected.

Page 269: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 263

Solutions 19-1: Creating Users and Groups

Answers

9.g. Do the remaining users have read access? Yes

9.h. Why or why not? The check box for Everyone is selected. By default, all users and groups are members of the Everyone group. Because the Everyone group check box is selected, all members inherit this permission, unless the member is explicitly denied access.

13.d. What subject areas are available to Mary? SupplierSales, SupplierSalesDM, Inventory

13.i. Does the SupplierSales subject area display? No

13.j. Why is this? The SupplierSales subject area does not appear because you explicitly denied read access to JMEYER.

Page 270: Build Repositories Ag

Lesson 19: Security

264 Oracle BI Suite EE 10g R3: Build Repositories

Practice 19-2: Setting Permissions for Users and Groups

Goal To set up security access so that Oracle BI Server can authenticate groups and assign appropriate permissions to group members

Scenario You first modify explicit permissions for Jacob Meyer. You then modify the permission of the group that Jacob Meyer is a member of and examine the effect this has on Jacob Meyer. Lastly, you add Jacob Meyer to another group and examine how this affects his access.

Time 10–15 minutes

Instructions

1. In this step, you modify user and group permissions for the SupplierSales presentation catalog. a. Return to the ABC repository open in online mode, double-click the SupplierSales

presentation catalog, and click the Permissions button. b. Select Show all users/groups. c. Define permissions so that JMEYER is deselected and the SalesHR group is explicitly denied

access to the SupplierSales presentation catalog. Your results should resemble the following:

d. Now that you have removed JMEYER’s explicit access restrictions from the SupplierSales

presentation catalog, is he able to execute query requests against it in Answers? Explain.

Page 271: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 265

e. Select the SalesManagers group check box to explicitly give it Read permission for the SupplierSales presentation catalog.

f. Click OK to close the Permissions dialog box. g. Click OK to close the Presentation Catalog dialog box.

2. Add the SalesHR group to the SalesManagers group. a. Open the Security Manager. b. Select Groups and double-click SalesManagers. c. Click the Add button. d. Select the SalesHR group and click OK. The SalesHR group now belongs to the

SalesManagers group. e. Click OK to close the Group dialog box. At this point, the group and user structure is as

follows: SalesManagers Group

SWRIGHT

PSMITH

SalesHR Group

JMEYER

SalesUsers Group

RMIND

JCRAFT

Administrators Group

Administrator

MWEST

f. Close the Security Manager.

3. Check in changes. For the purposes of this practice it is not necessary to run a consistency check.

4. Save the repository.

5. With the changes you have made so far, will JMEYER be able to access the SupplierSales presentation catalog?

6. Check your answer. a. Log in to Oracle BI as Administrator with password Administrator. b. Click Reload Server Metadata. Only users who are assigned this privilege have the ability

to reload server metadata. This link is not visible to other users. c. Click Log Out. d. Log back in as JMEYER with no password.

Page 272: Build Repositories Ag

Lesson 19: Security

266 Oracle BI Suite EE 10g R3: Build Repositories

e. Does JMEYER have access to the SupplierSales subject area now?

f. Why or why not?

g. Log out of Oracle BI.

7. Return to the Administration Tool and modify the permissions so that JMEYER also belongs to the SalesManagers group. a. Open the Security Manager and double-click the SalesManagers group. b. Click the Add button. c. Select JMEYER and click OK. Meyer now belongs to both SalesHR and SalesManagers

groups. The group and user structure resembles the following: SalesManagers Group

SWRIGHT

PSMITH JMEYER

SalesHR Group

JMEYER

SalesUsers Group

RMIND

JCRAFT

Administrators Group

Administrator

MWEST

d. Click OK to close the Group dialog box. e. Close the Security Manager.

8. Check in changes and save the repository.

9. Log in to Oracle BI as Administrator and reload the server metadata.

10. Check Meyer’s access to the SupplierSales subject area. a. Log out and log back in as JMEYER. b. Does JMEYER have access to the SupplierSales subject area now?

c. Why or why not?

11. Log out of Oracle BI.

Page 273: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 267

Solutions 19-2: Setting Permissions for Users and Groups

Answers

1.d. Now that you have removed JMEYER’s explicit access restrictions from the SupplierSales presentation catalog, is he able to execute query requests against it in Answers? Explain. No, JMEYER is a member of the SalesHR group, which was explicitly denied access.

5. With the changes you have made so far, will JMEYER be able to access the SupplierSales data? No

6.e. Does JMEYER have access to the SupplierSales subject area now? No

6.f. Why or why not? JMEYER is a member of the SalesHR group, which was explicitly denied access. If a user is a direct member of a group, the permissions granted or denied to that group take precedence over permissions granted or denied through other groups.

10.b. Does JMEYER have access to the SupplierSales subject area now? Yes

10.c. Why or why not? JMEYER is a member of the SalesHR and SalesManagers groups. Because these groups have conflicting permissions, the user is granted the least restrictive permissions of the two groups.

Page 274: Build Repositories Ag

Lesson 19: Security

268 Oracle BI Suite EE 10g R3: Build Repositories

Practice 19-3: Authenticating Users Using an External Database

Goal To authenticate users using an external database

Scenario You can choose to maintain lists of users and their passwords in an external database rather than in the repository. An external database table consisting of user login information has been provided so that you can import this information into the repository and use it to authenticate users during login. The table contains a list of users, their logins and passwords, and the group they belong to. Optionally, the table can also contain the logging level for each user, Web interface information, and the names of specific database catalogs or schemas to use for each user when querying data. After this information has successfully been imported, you need to create an initialization block that retrieves this data.

Outcome External database of login information used for authenticating users

Time 15–20 minutes

Instructions

1. Attempt to log in to Oracle BI as AJOHNSON, with password aj. Click No if prompted to remember password. You receive a message that an invalid username or password was entered. At the end of this practice, you should be able to log in as AJOHNSON.

2. Return to the ABC repository open in online mode.

3. Import the SECURITYTABLE table into Physical layer. a. Select File > Import > from Database. b. Select the OCI 10g/11g connection type. c. In the TNS name field, enter ORCL. d. In the User name field, enter SUPPLIER2. e. In the Password field, enter SUPPLIER2. f. Click OK. The Import dialog box opens. This may take a few moments. g. Expand the SUPPLIER2 schema and click SECURITYTABLE. h. Click Import. i. When import completes, close the Import dialog box. j. Ensure that SECURITYTABLE is added to SUPPLIER2 in the Physical layer. k. Check in changes.

Page 275: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 269

l. Right-click SECURITYTABLE and select View Data to see the data stored in the table:

Note that each user listed in this table is a member of the SalesRep group, except for Alan Ziff, who belongs to the Sales Admin group, and User Two, who belongs to the users2 group. Using a table of users in an external database allows you to maintain a single list of users for multiple repositories. Although the groups must be entered into the Administration Tool manually, it is easier to set up 100 groups than it is to set up 50,000 separate users.

m. Close the View Data window.

4. Create an initialization block. This initialization block will populate session variables with data values returned by querying the database each time a user logs in. a. Select Manage > Variables. b. In the left pane, select Session > Initialization Blocks. c. In the right pane, right-click and select New Initialization Block. d. In the Name field, enter Security. e. Click Edit Data Source. f. In the Default Initialization string field, create an initialization string that populates group,

username, password, and log level variables. You define the variables in a later step. The values returned by the database are assigned to the variables you define. These variables are used to authenticate a user during login. Enter the following into the Initialization string field: select GRP, SALESREP, USERNAME, 2 from SECURITYTABLE where USERNAME = ‘:USER’ and PWD = ‘:PASSWORD’ The SQL contains two constraints in the WHERE clause. :USER (note the colon) passes the user’s login ID and :PASSWORD (note the colon) passes the password the user enters. The query returns data only if the login ID and password match values found in the table in the FROM clause, SECURITYTABLE in this example. If this query returns data, the user is

Page 276: Build Repositories Ag

Lesson 19: Security

270 Oracle BI Suite EE 10g R3: Build Repositories

authenticated and the session variables are populated.

g. Click Browse. h. Double-click the SUPPLIER CP connection pool to select it. i. Click OK to close the Session Variable Initialization Block Data Source dialog box. j. Ensure that your initialization block looks like this:

5. Create the variables. Because you requested data for four variables in the string, you need to define each variable. The variables are GROUP, DISPLAYNAME, USER, and LOGLEVEL. a. Click Edit Data Target. b. Click New. c. Enter GROUP in the Name field. d. Click OK. e. Click Yes to acknowledge that this variable has a special purpose. f. Repeat the process for the remaining three variables. The order of the variables is important.

You must list variables in the same order as the columns in the SQL statement. In this example, the value in the GRP column is assigned to the GROUP variable, the value in the SALESREP column is assigned to the DISPLAYNAME variable, USERNAME is assigned to the USER variable, and the LOGLEVEL variable is given the value of 2.

g. Check your work:

h. Click OK to close the Session Variable Initialization Block Variable Target dialog box. i. Click OK to close the Session Variable Initialization Block dialog box. j. Close the Security Manager.

6. Check in changes.

7. Save the repository.

8. Check your work. a. Return to Oracle BI and log in as AJOHNSON with password aj. b. Click the Dashboards link.

Page 277: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 271

c. Ensure that the greeting Welcome, ANN JOHNSON! appears to the left of the Dashboards link. This confirms that the external database table was used to authenticate a user during login.

d. Log out of Oracle BI.

Page 278: Build Repositories Ag

Lesson 19: Security

272 Oracle BI Suite EE 10g R3: Build Repositories

Practice 19-4: Authenticating Users with Database Authentication

Goals To authenticate users using database authentication

Scenario As an additional option, Oracle BI Server can authenticate users through database login names. Oracle BI Server trusts a user with Read permission on a specified database. To authenticate users with this method, you have to maintain a list of users in the repository. So for large deployments, this is not a good option.

Time 15–20 minutes

Instructions

1. Return to the ABC repository open in online mode.

2. Create a new database in the Physical layer. a. Right-click inside the Physical layer and select New Database. The Database dialog box

opens. b. Name the database Authenticate. c. Set the Database to Oracle 10gR1. d. Click the Connection Pools tab. e. Click Add. f. Name the Connection Pool Authenticate CP. g. Ensure that the call interface is set to Default (OCI 10g/11g). h. Enter :USER in the User name field. i. Enter :PASSWORD in the Password field.

Page 279: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 273

j. Enter ORCL in the Data Source Name field.

k. Click OK to close the Connection Pool dialog box. l. Enter :PASSWORD to confirm the password and click OK. m. Click OK to close the Database dialog box. n. Ensure that the Authenticate database is added to the Physical layer.

3. Add a database user to the repository. a. Select Manage > Security. b. Click Users in the left pane. c. Right-click in the right pane and select New User. d. Enter SH in the User name field. This is a user in the ORCL database. e. Leave the Password field blank. f. Click OK to close the User dialog box. g. Close the Security Manager.

4. Check in changes.

5. Save the repository. The changes do not require a consistency check.

Page 280: Build Repositories Ag

Lesson 19: Security

274 Oracle BI Suite EE 10g R3: Build Repositories

6. Close the repository.

7. Unlock the user in the ORCL database and enter a password. a. Open Internet Explorer. b. In the Address field, enter http://<machine name>:1158/em to open Enterprise

Manager. c. Log in as SUPPLIER2 with password SUPPLIER2. d. Click the Administration link. e. Scroll down and click the Users link (on the left, under Users and Privileges). f. Click the SH link. The View User: SH window opens. g. Click Edit. h. In the Enter Password field, enter SH. i. In the Confirm Password field, enter SH. j. For Status, select the Unlocked check box. k. Click Apply. l. You should receive an update message that user SH has been modified successfully.

m. Log out of Oracle Enterprise Manager.

8. Edit the security section of the NQSConfig.ini file. a. Navigate to D:\OracleBI\server\Config. b. Open NQSConfig.ini. c. Scroll to the SECURITY section. d. Uncomment the second authentication option, AUTHENTICATION_TYPE = DATABASE,

by deleting the preceding “#” signs. e. Where it says some_data_base, enter Authenticate, the name of the database you

created in the Physical layer.

f. Save and close the file.

9. Test your work. a. Restart the Oracle BI Server service to apply changes to NQSConfig.ini. b. Ensure that you can log in to Oracle BI as user SH with password SH. c. Click the Dashboards link and ensure that there is a Welcome, SH! message. d. Log out of Oracle BI.

10. Reset the security defaults in NQSConfig.ini. a. Stop the Oracle BI Server service. b. Navigate to D:\OracleBI\Server\Config.

Page 281: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 275

c. Open NQSConfig.ini. d. Scroll to the SECURITY section. e. Comment out the second authentication option, AUTHENTICATION_TYPE = DATABASE,

by adding preceding “#” signs. f. Change DATABASE from Authenticate to some_data_base.

g. Save and close the file. Note that external database table authentication (covered in the

previous practice) can coexist with database authentication (covered in this practice). External database authentication precedes database authentication. If the external database table authentication succeeds, then the server does not perform database authentication. If external database table authentication fails, then the server performs database authentication.

Page 282: Build Repositories Ag

Lesson 19: Security

276 Oracle BI Suite EE 10g R3: Build Repositories

Practice 19-5: Setting Query Limits and Timing Restrictions

Goals To disallow queries that may consume too much of the system resources by setting query limits

Scenario You want to prevent queries from consuming too many resources by limiting how long a query can run and how many rows a query can retrieve. You also want to regulate when individual users can query databases to prevent users from querying when system resources are tied up with batch reporting, table updates, or other production tasks.

Outcome You have set the maximum rows of any query to five rows, the maximum time of any query to 1 minute, and restricted access to a database on Sunday from 12:00 AM to 7:00 AM.

Time 10–15 minutes

Instructions

1. Start the Oracle BI Server service and open the ABC repository in online mode. Log in as Administrator with password Administrator.

2. Disallow queries that may consume too many system resources by setting query limits for the SalesManagers group. a. Open the Security Manager. b. Double-click the SalesManagers group. c. Click the Permissions button. d. Click the Query Limits tab. e. Locate the ORCL database and change its Max Rows value to 5. This specifies the

maximum number of rows each query can retrieve from the ORCL database for members of this SalesManagers group.

f. In the Status Max Rows column, select Enable from the drop-down list. g. In the Max Time (Minutes) column, change the value to 1. This specifies the maximum time

a query can run on the ORCL database. h. In the Status Max Time column, select Enable from the drop-down list.

3. Restrict the time period for which users can access specified repository resources from midnight Sunday to 7:00 AM Sunday: a. Click the button in the Restrict column of the ORCL database.

Page 283: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 277

b. Highlight the blocks from Sunday at midnight to 7 AM Sunday. Hint: With the first block selected, press [Shift] and select the 7 AM block, or click the first box and drag to the 7 AM block.

c. Click the Disallow button.

If a time period is not highlighted, the access rights remain unchanged. If access is allowed or disallowed explicitly to one or more groups, the user is granted the least restrictive access for the time periods that are defined.

d. Click OK to close the Restrictions dialog box. e. Click OK to close the User/Group Permissions dialog box. f. Click OK to close the Group dialog box. g. Close Security Manager. h. Check in changes. i. Save the repository.

4. Log in to Oracle BI as Administrator and register your changes on the server by reloading the server metadata.

5. Ensure that the changes you made to the maximum number of rows allowed per query work correctly. a. Log in to Oracle BI as JMEYER with no password. Recall that JMEYER is a member of the

SalesManagers group. b. If necessary, click the Answers link. c. Click the SupplierSales subject area. d. Select Customers.Customer, SalesFacts.Dollars, and click Results. e. Did the results of the query display?

Page 284: Build Repositories Ag

Lesson 19: Security

278 Oracle BI Suite EE 10g R3: Build Repositories

f. Expand Error Details to view message. What does the error message state?

g. Click the Criteria tab. h. Set the filter Customer is in top 5 for the Customer column and click Results.

i. Did the results display?

j. Why is this?

k. Log out of Oracle BI.

6. Return to the Administration Tool and deactivate the query restriction you just created. a. Open the Security Manager. b. Double-click the SalesManagers group. c. Click the Permissions button. d. Click the Query Limits tab. e. In the ORCL row, select Ignore for both Status Max Rows and Status Max Time columns. f. Click OK. g. Close all dialog boxes and the Security Manager.

7. Check in changes and save the repository.

8. Test your results. a. Log in to Oracle BI as JMEYER with no password. b. Click the Answers link. c. Click the SupplierSales subject area. d. Select Customers.Customer, SalesFacts.Dollars, and click Results. e. What are the results now and why are they so?

9. Log out of Oracle BI.

Page 285: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 279

Solutions 19-5: Setting Query Limits and Timing Restrictions

Answers

5.e. Did the results of the query display? No

5.f. Expand Error Details to view message. What does the error message state? A general error has occurred. The user request exceeded the maximum query governing rows from the database.

5.i. Did the results display? Yes

5.j. Why is this? Because the query returned only five rows, which do not exceed the maximum query restricting rows from the database.

8.e. What are the results now and why are they so? The customer rows are returned in the query because there is no longer a restriction on the number of rows that can be returned from the ORCL database.

Page 286: Build Repositories Ag

Lesson 19: Security

280 Oracle BI Suite EE 10g R3: Build Repositories

Practice 19-6: Setting Filters to Personalize Information

Goals To set up filters to personalize the information a user gets when the user enters a query

Scenario ABC decided that its customers would value the ability to analyze their own purchase records using Oracle BI. However, ABC wants each customer to be able to analyze only his or her own information. In this practice, you set a filter so that the management of the Rib Pit restaurant can analyze its purchases from ABC. ABC also wants to set up a filter so that members of the SalesUsers group see only the data that pertains to them.

Outcome The management of the Rib Pit restaurant is able to analyze its own purchase records using Oracle BI. Members of the SalesUsers group see only data that pertains to them.

Time 10–15 minutes

Instructions

1. Return to the ABC repository open in online mode.

2. Create a new user and set a filter. a. Open the Security Manager and create a new user Rib Pit with no password, and with

logging level set to 2. b. Click the Permissions button. c. Click the Filters tab. d. Click Add. e. In the left pane, expand SupplierSales and double-click the Customers presentation folder

to add it to the Filters tab. f. Click the ellipsis button to open the Expression Builder. You may need to scroll to the right. g. Set the following filter: "SupplierSales"."Customers"."Customer" = 'Rib Pit' h. Click OK and the filter is added to the Filters tab.

i. Click OK to close the User/Group Permissions dialog box.

Page 287: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 281

j. Click OK to close the User dialog box. k. Close the Security Manager. l. Check in changes. m. Save the repository.

3. Test your work. a. Log in to Oracle BI as Rib Pit with no password. b. Click Supplier Sales. c. Create the following query:

d. Click Results.

e. Navigate to D:\OracleBI\server\log and open NQQuery.log (Settings >

Administration is not accessible by this user). Scroll to the bottom of the file and then back up to find the entry for the Rib Pit user. Note that the filter is applied in the WHERE clause.

f. Close the log file. g. Run another query:

Page 288: Build Repositories Ag

Lesson 19: Security

282 Oracle BI Suite EE 10g R3: Build Repositories

h. Check the query log. Note that no filter is applied because there are no references to any attributes in the Customers folder.

i. Close the log file.

4. Set a filter on a fact folder. a. Open the Security Manager. b. Double-click the Rib Pit user to open the User dialog box. c. Click the Permissions button. d. Click the Filters tab. e. Click Add. f. In the left pane, expand SupplierSales and double-click the -SalesFacts presentation folder

to add it to the Filters tab. g. Click the ellipsis button to open the Expression Builder. h. Set the following filter: "SupplierSales"."Customers"."Customer" = 'Rib Pit' i. Click OK. The Filters tab for Rib Pit now contains two filters:

j. Click OK to close the User/Group Permissions dialog box. k. Click OK to close the User dialog box. l. Close the Security Manager. m. Check in changes and save the repository.

5. Test your work. a. Log out of Oracle BI and log back in as Rib Pit with no password. b. Run the following query:

Page 289: Build Repositories Ag

Lesson 19: Security

Oracle BI Suite EE 10g R3: Build Repositories 283

c. Check the query log. Note that this time the Name = ‘Rib Pit’ filter is applied to the

results. Only the sales facts data that applies to Rib Pit is returned.

d. Close the log file.

6. Set up a filter using a variable to filter data for the SalesUsers group. a. Open the Security Manager. b. Create a new SalesRep group. Recall that this is the group in SECURITYTABLE. c. Click the Permissions button. d. Click the Filters tab. e. Click Add. f. In the left pane, expand SupplierSales and double-click the Customers presentation folder

to add it to the Filters tab. g. Click the ellipsis button to open the Expression Builder. h. Set the following filter:

"SupplierSales"."Customers"."Sales Rep" = VALUEOF(NQ_SESSION.DISPLAYNAME) You are filtering data using the DISPLAYNAME session variable. You can use DISPLAYNAME because it contains the same characters that appear in the Sales Rep logical column. Add the Sales Rep logical column to the filter first using the Logical Tables folder, then scroll down to the Session Variables folder and double-click the DISPLAYNAME session variable to paste it into the filter as an argument in the VALUEOF() function.

i. Click OK to close the Expression Builder. The filter is added to the Filters tab.

j. Click OK to close the User/Group Permissions dialog box. k. Click OK to close the Group dialog box.

Page 290: Build Repositories Ag

Lesson 19: Security

284 Oracle BI Suite EE 10g R3: Build Repositories

l. Close the Security Manager. m. Check in changes and save the repository.

7. Test your work. a. Log in to Oracle BI as TBELL with password tb. b. Click the Dashboards link and ensure that there is a Welcome, Tracie Bell message. c. Create the following request:

d. Click Results. Note that the results are automatically personalized for Tracie Bell.

e. Check the query log. Recall that you set the system session variable LOGLEVEL to 2 when

you created the initialization block SQL, so the query is logged. Note that the WHERE clause filters for SALESREP = ‘TRACIE BELL’.

f. Close the log file. g. Log out of Oracle BI.

Page 291: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 285

Practice 20-1: Inspecting Cache Files

Goals To create a query request and inspect cache entries using Cache Manager

Scenario You create a request in Answers and ensure that a cache entry was created in the Cache Manager and that a cache file was created. You create the same request again and ensure that the results were fulfilled by the cache, and not the database.

Time 15–20 minutes

Instructions

1. Close the ABC repository.

2. Stop the Oracle BI Server service.

3. Enable the cache parameter in the NQSConfig.ini file. a. Navigate to D:\OracleBI\server\Config. b. Open NQSConfig.ini. c. Locate the CACHE section and set the ENABLE parameter to YES. d. Save and close the file.

4. Start the Oracle BI Server service.

5. Create and run a request. a. Log in to Oracle BI as MWEST, with no password. b. Click in the SupplierSales subject area. c. Create the following request:

Page 292: Build Repositories Ag

Lesson 20: Cache Management

286 Oracle BI Suite EE 10g R3: Build Repositories

d. Click Results.

e. Log out of Oracle BI.

6. Open the ABC repository in online mode. Log in as Administrator with password Administrator.

7. Open the Cache Manager and ensure that the request you made is listed as a cache entry. a. Select Manage > Cache. b. Expand Star > SupplierSales. By selecting the appropriate leaf of the tree in the left pane,

you can limit the cache entries that appear in the right pane. The Cache Manager allows you to view cache entries by repository, subject area, and user.

c. Click MWEST in the left pane. All cache entries associated with this user appear in the right pane.

d. Select the cache entry (there should only be one). e. Select SQL > Show. f. By inspecting the SQL, can you determine if this is the cache that represents the query you

just created?

g. Click OK to close the SQL.

Page 293: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 287

h. With this entry still selected, scroll to the Created and Last used columns. Are the values for these fields the same?

i. Record the values for these two fields.

j. Were the results for the query you created derived from an existing cache entry or returned directly from the database?

k. Close the Cache Manager.

8. Inspect the cache file and ensure that the results of the query were stored as a file in the cache directory. The modified time of the file should coincide with the time you originally created the request (time recorded above). a. Navigate to D:\OracleBIData\cache. The file in this directory is the cache file that

resulted from your query. b. Ensure that the modified time of this file is the same as the time you created the request.

9. Create a new request. a. Log in to Oracle BI as JMEYER, with no password. b. Create the same request you created earlier and inspect the results:

c. Was the request satisfied by the database or by a cache? Explain.

10. Examine the cache hit in the log file. a. Open the query log.

Page 294: Build Repositories Ag

Lesson 20: Cache Management

288 Oracle BI Suite EE 10g R3: Build Repositories

b. Ensure that you see a Cache Hit on query entry for the query initiated by JMEYER.

c. Note that the log identifies who created the cache entry: MWEST. d. Close the log file. e. Log out of Oracle BI.

11. In response to JMEYER’s request, determine if a new cache entry was made in the Cache Manager and filed in the Cache directory. If a new entry was made in the Cache Manager and filed in the directory, then an existing cache was not used to satisfy his request. a. Return to the ABC repository and open the Cache Manager. b. Are there any entries listed with JMEYER as the user?

c. Has the Last used date for MWEST’s cache entry changed? Explain.

d. Close the Cache Manager. e. Navigate to D:\OracleBIData\cache. f. Note that there is no new cache file created as a result of JMEYER’s request. Thus,

JMEYER’s request was satisfied by an existing cache entry.

Page 295: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 289

Page 296: Build Repositories Ag

Lesson 20: Cache Management

290 Oracle BI Suite EE 10g R3: Build Repositories

Solutions 20-1: Inspecting Cache Files

Answers

7.f. By inspecting the SQL, can you determine if this is the cache that represents the query you just created? Yes, the listed objects correspond to the columns selected for the request. These objects were also selected from the SupplierSales subject area as indicated from the SQL.

7.h. With this entry still selected, scroll to the Created and Last used columns. Are the values for these fields the same? No. Created has a time stamp and Last used is set to Never.

7.j. Were the results for the query you created derived from an existing cache entry or returned directly from the database? Results for this query were returned directly from the database. Last used is set to Never, indicating the cached entry has never been used. Thus, no cache entry existed for this query until now.

9.c. Was the request satisfied by the database or by a cache? Explain. JMEYER’s query was fulfilled by the cache that resulted from MWEST’s query earlier. Because JMEYER’s request was identical to the cache, the server used the cache (cache hit) instead of processing against the database.

11.b. Are there any entries listed with JMEYER as the user? No

11.c. Has the Last used date for MWEST’s cache entry changed? Explain. Yes, because JMEYER’s query used this cache to satisfy his request and the last used date was updated to reflect this.

Page 297: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 291

Page 298: Build Repositories Ag

Lesson 20: Cache Management

292 Oracle BI Suite EE 10g R3: Build Repositories

Practice 20-2: Modifying Cache Parameters

Goal To modify cache parameters in the NQSConfig.ini file

Scenario You use the Cache Manager to inspect the cache parameters. Then modify the number of rows per cache, as well as the number of cache entries allowed. In addition to modifying cache parameters, you make certain tables noncacheable.

Outcome A decrease in the number of rows per cache, as well as a decrease in the number of cache entries allowed

Time 10–15 minutes

Instructions

1. What are some advantages of using a caching system for requests?

2. True or false: There is a list of criteria that can qualify a cache hit. If all but one of these conditions are met, a cache hit will not occur.

3. True or false: Cache files are stored in the D:\OracleBIData\cache directory.

4. True or false: Cache files can be stored anywhere.

5. If you wanted to store cache files in a different location, where do you indicate this?

Page 299: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 293

6. Use the Cache Manager to inspect cache parameters. a. Open the Cache Manager. b. Select Action > Show Info. c. Inspect the information and record the following values: d. Number of entries currently in cache:

e. Maximum allowable number of entries in cache:

f. Maximum allowable number of rows per cache entry result set:

g. Click OK. h. Close the Cache Manager. i. Close the repository.

7. Decrease the number of rows per cache, as well as the number of cache entries allowed. a. Stop the Oracle BI Server service. b. Navigate to D:\OracleBI\server\Config. c. Open NQSConfig.ini. d. Locate the CACHE section. e. Modify as follows:

MAX_ROWS_PER_CACHE_ENTRY = 150000 MAX_CACHE_ENTRIES = 9000

f. Save the changes and close the file.

8. Validate your changes in the Administration Tool. a. Start the Oracle BI Server service. b. Open the ABC repository in online mode. c. Select Manage > Cache. d. Select Action > Show Info and ensure that changes are applied. Your results should

resemble the screenshot below:

e. Click OK. f. Close the Cache Manager.

Page 300: Build Repositories Ag

Lesson 20: Cache Management

294 Oracle BI Suite EE 10g R3: Build Repositories

9. Make certain tables noncacheable, that is, if a request is made against them, there are no cache entries. a. In the Physical layer, double-click the ORCL.SUPPLIER2.D1_CUSTOMER2 table. b. Click the General tab. c. Deselect the Cacheable check box. d. Click OK. e. Repeat this process for the D1_ORDERS2 table. f. Check in changes and save the repository. You do not need to check consistency.

10. Test your work. a. Log in to Oracle BI as JMEYER, with no password. b. Create the following request using columns from the SupplierSales subject area:

c. Click Results. d. Log out of Oracle BI. e. Return to the Administration Tool and open the Cache Manager. f. Do you see an entry for the request you just created?

g. Close the Cache Manager.

11. Make the tables cacheable. a. In the Physical layer, double-click the D1_CUSTOMER2 table. b. Select the General tab. c. Select the Cacheable check box. d. Click OK. e. Repeat this process for the D1_ORDERS2 table. f. Check in changes and save the repository. You do not need to check for consistency.

12. Test your work. a. Log in to Oracle BI as JMEYER, with no password. b. Create the following request using columns from the SupplierSales subject area:

c. Click Results. d. Log out of Oracle BI. e. Return to the Administration Tool and open the Cache Manager.

Page 301: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 295

f. Ensure that there is a new entry for the request you just created.

13. Alter how the cache manager displays information. a. Select Edit > Options. b. Deselect Creation elapsed time. c. Use the Up button to move Business Model to the top of the options list. d. Click OK. e. Check the changes in the Cache Manager.

14. Purge cache entries. a. Right-click the cache entry for JMEYER and select Purge, or select Edit > Purge. In this

pane, it is possible to purge a single cache entry, multiple entries, or all entries. b. Click OK to confirm cache purge. c. Click the Physical tab at the bottom of the left pane. d. Expand ORCL > Supplier2. e. Select the D1_PRODUCTS table. A message appears on the right stating that all associated

cache entries will be purged for this table. In this pane, it is possible to delete cache entries for a single table, multiple tables, or the entire schema.

f. Select Edit > Purge. g. Click OK to confirm cache purge. h. Click the Cache tab at the bottom of the left pane. i. Confirm that the MWEST cache entry is deleted. j. Close the Cache Manager.

Page 302: Build Repositories Ag

Lesson 20: Cache Management

296 Oracle BI Suite EE 10g R3: Build Repositories

Page 303: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 297

Solutions 20-2: Modifying Cache Parameters

Answers

1. What are some advantages in using a caching system for requests? Faster response time fulfilling a query from a cache versus searching through the database; minimizing strain on database resulting in reduced database processing; and conservation of network resources

2. True or false: There is a list of criteria that can qualify a cache hit. If all but one of these conditions are met, a cache hit will not occur. True

3. True or false: Cache files are stored in the D:\OracleBIData\cache directory. True

4. True or false: Cache files can be stored anywhere. True, cache files can be stored anywhere, even on a separate machine.

5. If you wanted to store cache files in a different location, where would you need to indicate this? To define the location of where cache files are stored, you would need to indicate this in the NQSConfig.ini file, in the Cache Section.

6.d. Number of entries currently in cache: 1

6.e. Maximum allowable number of entries in cache: 1,000

6.f. Maximum allowable number of rows per cache entry result set: 100,000

10.f. Do you see an entry for the request you just created? No

Page 304: Build Repositories Ag

Lesson 20: Cache Management

298 Oracle BI Suite EE 10g R3: Build Repositories

Page 305: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 299

Practice 20-3: Seeding the Cache

Goal To create a request and an iBot to seed the cache

Scenario You have identified requests that are used frequently by sales representatives. To improve performance, you want to seed the cache with this data. In this practice, you set up and configure the Oracle BI Scheduler; create and save a query to populate the cache; create an iBot to seed the cache. During this process, you use a programmatic ODBC call to purge the cache.

Time 15–20 minutes

Instructions

1. Create the Oracle BI Scheduler tables in the SUPPLIER2 schema. a. Navigate to D:\OracleBI\server\Schema. b. Open SAJOBS.Oracle.sql to view its contents. This script creates the four scheduler tables:

S_NQ_JOB, S_NQ_INSTANCE, S_NQ_ERR_MSG, and S_NQ_JOB_PARAM. c. Close the file. d. Double-click the SQL Plus icon on the desktop to open SQL*Plus. e. Enter SUPPLIER2 as User Name and Password, and ORCL as Host String. f. Click OK. g. At the SQL> prompt, enter:

START D:\OracleBI\server\Schema\SAJOBS.Oracle.sql; h. Press [Enter]. i. Ensure that you receive a series of Table created and Index created messages followed by a

Commit complete message.

2. Set the Oracle BI Scheduler configuration options in the Job Manager. a. Return to the ABC repository, which should still be open in online mode. b. Select Manage > Jobs to open the Job Manager. c. In the Job Manager, select File > Configuration Options. d. If necessary, select the Scheduler tab and the Database subtab. e. Enter the following values:

Database Type Oracle 10g R1

Call Interface Default (OCI 10g R1/R2)

Data Source Name ORCL

User Name SUPPLIER2

Password SUPPLIER2

Confirm Password SUPPLIER2

Page 306: Build Repositories Ag

Lesson 20: Cache Management

300 Oracle BI Suite EE 10g R3: Build Repositories

f. Click the General subtab. g. Enter Administrator as the password and confirm it. h. Click OK. i. Click OK to confirm that you need to restart the Oracle BI Scheduler service. j. Select File > Exit to close the Job Manager.

3. Start the Oracle BI Scheduler service. a. Open the Services window. b. Right-click Oracle BI Scheduler and select Start. c. Minimize the Services window.

4. Create a query to seed the cache. a. Log in to Answers as Administrator. b. Navigate to the SupplierSales subject area and create the following query:

c. Save the request as Cache Seed in My Folders.

5. Use an ODBC procedure to purge the cache before seeding the cache. The Oracle BI Server provides ODBC-extension functions for the Oracle BI Administrator to use for purging cache entries. Some of these functions are particularly useful for embedding in an Extract, Transform, and Load (ETL) task. For example, after a nightly ETL is performed, the entire Oracle BI Server cache can be purged. If only the fact table was modified, only cache related to that table can be purged. In some cases, you may need to purge the cache entries associated with a specific database. Note: Only Oracle BI Administrators have the right to purge the cache. Therefore, scripts that call these ODBC-extension functions must run under an Oracle BI Administrator login ID. Refer to the Oracle BI Server Administration Guide. a. Click Settings > Administration on the top of the screen. b. Click Issue SQL to issue SQL directly to the Oracle BI Server. c. Enter the following command:

Call SAPurgeAllCache()

d. Click Issue SQL.

Page 307: Build Repositories Ag

Lesson 20: Cache Management

Oracle BI Suite EE 10g R3: Build Repositories 301

e. Ensure that the operation succeeded.

f. Click Finished. g. Click Close Window.

6. Create and schedule an iBot to seed the cache with the saved query. It is common to schedule an iBot to run right after a daily load to reseed the cache. For example, the data warehouse is loaded at midnight and the cache is purged during or after the load, then the cache is reseeded by an iBot. In this example, you run the iBot immediately. a. Click the More Products > Delivers link on the top of the screen. b. Click Create New iBot. c. Click the Schedule tab. d. Leave the default settings to start the iBot immediately. e. Click the Delivery Content tab. f. Click Select Content. g. Select the Cache Seed request under My Folders and click OK. The request is added to the

iBot. h. Click the Destinations tab. i. Select the Oracle BI Server Cache check box. j. Deselect all other check boxes. k. Save the iBot as Cache Seed.

7. Check your work. a. Return to the Administration Tool. b. In the Cache Manager, select Action > Refresh. c. Ensure that there is an entry in the cache. You have successfully seeded the cache using an

iBot.

Page 308: Build Repositories Ag

Lesson 20: Cache Management

302 Oracle BI Suite EE 10g R3: Build Repositories

Page 309: Build Repositories Ag

Lesson 21: Enabling Usage Tracking

Oracle BI Suite EE 10g R3: Build Repositories 303

Practice 21-1: Enabling Usage Tracking

Goals To set up and administer usage tracking

Scenario ABC wants to monitor the ad hoc queries generated by users to help identify performance improvement areas. You use the recommended usage tracking approach, which is to track statistics by loading them directly into a database table rather than a flat file. You use a script to create the S_NQ_ACCT database table, build the business model, modify the NQSConfig.ini file to support usage tracking, and test results.

Time 25–30 minutes

Instructions

1. Use a given script to create the S_NQ_ACCT usage-tracking table. This table stores the usage tracking data when queries are run against Oracle BI Server. a. Open Oracle SQL*Plus (Start > Programs > Oracle – OraDb10g_home > Application

Development > SQL Plus). b. Log in to the ORCL host as SUPPLIER2 with password SUPPLIER2. c. At the SQL prompt, enter:

start D:\oraclebi\server\schema\SAACCT.Oracle.sql; d. Press [Enter]. Ensure that the table and three indexes are created. e. At the SQL prompt, enter DESC S_NQ_ACCT; and press [Enter] to view the table

structure. f. Close SQL*Plus.

2. Import the usage-tracking table into the Physical layer. a. Return to the ABC repository, which should still be open in online mode. b. Select File > Import > from Database. c. Select the OCI 10g/11g connection type. d. Enter SUPPLIER2 as username and password, and click OK. e. In the Import dialog box, expand the SUPPLIER2 object. f. Click the S_NQ_ACCT table. g. Ensure that the Tables import option is checked, and click Import. h. When import completes, click Close. i. Check in changes and save the repository. j. In the Physical layer, expand ORCL and ensure that S_NQ_ACCT was imported.

3. Create a usage-tracking database object. a. Right-click inside the Physical layer white space and select New Database to open the

Database properties dialog box.

Page 310: Build Repositories Ag

Lesson 21: Enabling Usage Tracking

304 Oracle BI Suite EE 10g R3: Build Repositories

b. Click the General tab and name the database ABC Usage Tracking. c. In the Database drop-down list, select Oracle 10g R1. d. Click the Connection Pools tab. e. Click Add to open the Connection Pool dialog box. f. Name the connection pool ABC Usage Tracking Connection Pool. g. Enter ORCL for data source name. h. Enter SUPPLIER2 for username and password. i. Click OK. j. Enter SUPPLIER2 to confirm the password, and click OK. k. Click OK to close the Database properties dialog box. l. Right-click the ABC Usage Tracking database object and select New Object > Physical

Schema. m. Name the physical schema ABC Usage Tracking Schema. n. Click OK.

4. Copy the S_NQ_ACCT table to the usage-tracking database object. a. In the Physical layer, expand ORCL > SUPPLIER2. b. Right-click S_NQ_ACCT and select Copy. c. Right-click ABC Usage Tracking Schema and select Paste. d. Check in changes and save the repository.

5. Create a usage-tracking business model. a. Right-click in the Business Model and Mapping layer and select New Business Model. b. Name the business model ABC Usage Tracking and click OK. c. Right-click ABC Usage Tracking and select New Object > Logical Table. d. Name the table Measures and click OK. e. Repeat and add three more tables, Time, Topic, and User to the ABC Usage Tracking

business model. f. Drag the following physical columns from ABC Usage Tracking > ABC Usage Tracking

Schema > S_NQ_ACCT to the Measures logical table in the ABC Usage Tracking business model and rename: Physical Column Rename

QUERY_TEXT Query Count

ROW_COUNT Row Count

TOTAL_TIME_SEC Total Time Seconds

g. Apply the following aggregation rules: Logical Column Aggregation Rule

Query Count Count

Page 311: Build Repositories Ag

Lesson 21: Enabling Usage Tracking

Oracle BI Suite EE 10g R3: Build Repositories 305

Row Count Sum

Total Time in Secs Sum h. Drag the following physical columns from ABC Usage Tracking > ABC Usage Tracking

Schema > S_NQ_ACCT to the Time logical table in the ABC Usage Tracking business model and rename: Physical Column Rename

START_DT Start Date

START_HOUR_MIN Start Hour Minute

END_HOUR_MIN End Hour Minute

i. Set Start Date as the logical key for the Time logical table. j. Drag the following physical columns from ABC Usage Tracking > ABC Usage Tracking

Schema > S_NQ_ACCT to the Topic logical table in the ABC Usage Tracking business model and rename: Physical Column Rename

QUERY_TEXT Logical SQL

REPOSITORY_NAME Repository Name

SUBJECT_AREA_NAME Subject Area Name

k. Set Logical SQL as the logical key for the Topic logical table. l. Drag the USER_NAME physical column from ABC Usage Tracking > ABC Usage

Tracking Schema > S_NQ_ACCT to the User logical table in the ABC Usage Tracking business model and rename User Name.

m. Set User Name as the logical key for the User logical table. n. Use the Business Model Diagram to create complex joins from Time, Topic, and User to

Measures. o. Drag the ABC Usage Tracking business model to the Presentation layer to create the

Presentation layer objects. p. Check in changes. q. Check consistency, and if the repository is consistent, save the repository.

6. Modify the NQSConfig.ini file to support usage tracking. a. Close the ABC repository open in online mode. b. Stop the Oracle BI Server service. c. Navigate to D:\OracleBI\server\Config and open NQSConfig.ini using

Notepad. d. Scroll to the Usage Tracking section. e. Set ENABLE = YES;

This enables usage tracking. Do not delete the semicolon at the end of the line. f. Scroll past the “Parameters used for writing data to a flat file” section and ensure that

DIRECT_INSERT = YES. What is the purpose of this parameter?

Page 312: Build Repositories Ag

Lesson 21: Enabling Usage Tracking

306 Oracle BI Suite EE 10g R3: Build Repositories

g. Scroll to the “Parameters used for inserting data into a table” section. When defining the parameters for PHYSICAL_TABLE_NAME, there are two format options identified. Which should you use, and why?

h. Using your answer to the question given above, update the NQSConfig.ini file and set the PHYSICAL_TABLE_NAME parameter as follows: PHYSICAL_TABLE_NAME = "ABC Usage Tracking"."ABC Usage Tracking Schema"."S_NQ_ACCT" ;

i. Set the CONNECTION_POOL variable in the NQSConfig.ini file to support both reads and writes. The setting is CONNECTION_POOL = “ABC Usage Tracking”.“ABC Usage Tracking Connection Pool”.

j. Leave the default settings for BUFFER_SIZE, BUFFER_TIME_LIMIT_SECONDS, NUM_INSERT_THREADS, and MAX_INSERTS_PER_TRANSACTION. Your screen should look as follows:

k. Save and close the NQSConfig.ini file.

7. Test your work. a. Start the Oracle BI Server service. b. Log in to Oracle BI as Administrator with password Administrator. c. Click Answers. d. Ensure that the ABC Usage Tracking subject area is visible. If not, click Reload Server

Metadata. e. Click SupplierSales. f. Create a query containing Customers.Customer and Fact.SalesFacts.Dollars. g. Click the Results.

Page 313: Build Repositories Ag

Lesson 21: Enabling Usage Tracking

Oracle BI Suite EE 10g R3: Build Repositories 307

h. Click the All Pages button and ensure that 136 records are returned. i. Click the Create a New Request icon . j. Click the ABC Usage Tracking subject area. k. Create a query containing User Name, Start Date, Logical SQL, Row Count, and Total

Time Seconds. l. Click Results. m. Ensure that you get the expected usage-tracking results.

n. Check the log file and ensure that the ABC Usage Tracking database and S_NQ_ACCT

table are accessed in the query.

o. If desired, experiment with other usage-tracking queries.

Page 314: Build Repositories Ag

Lesson 21: Enabling Usage Tracking

308 Oracle BI Suite EE 10g R3: Build Repositories

Solution 21-1: Enabling Usage Tracking

Answers

6.f. Scroll past the “Parameters used for writing data to a flat file” section and ensure that DIRECT_INSERT = YES. What is the purpose of this parameter? If DIRECT_INSERT = YES, usage-tracking information is stored in a database table. If DIRECT_INSERT = NO, usage-tracking information is stored in a file.

6.g. Scroll to the “Parameters used for inserting data into a table” section. When defining the parameters for PHYSICAL_TABLE_NAME, there are two format options identified. Which should you use, and why? Use "<Database>"."<Schema>"."<Table>", which is formatted to support Oracle.

Page 315: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 309

Practice 22-1: Setting Up a Multi-User Environment

Goal To set up a multi-user development environment to support two developers

Scenario ABC uses multi-user development environments for its developers. You prepare the development platform to support multi-user development and then configure two users to act as developers to test the environment.

Time 10–15 minutes

Instructions

1. Modify two users, MWEST and JMEYER, to give them administrative privileges so they can act as developers. As a precaution, reset their passwords. So they need to communicate with you before starting with development. a. Close the ABC repository that is open in online mode. b. Stop the Oracle BI Server service. c. Open the ABC repository in offline mode as Administrator, with Administrator

as password. d. Select Manage > Security. e. Click Groups in the left pane. f. Double-click Administrators. Administrator and MWEST are already members of the

Administrators group. g. Click Add. h. Select JMEYER. i. Click OK. j. Click OK to close the Group – Administrators window. k. Click Users in the left pane. l. Double-click MWEST. m. In the User dialog box, enter MWEST in the Password and Confirm Password fields. n. Click OK. o. Double-click JMEYER. p. In the User dialog box, enter JMEYER in the Password and Confirm Password fields. q. Click OK. r. Select Action > Close to close the Security Manager window. s. Save the repository. It is not necessary to check consistency.

2. Ensure that only one user can modify the repository at a time. a. Select Start > Programs > Oracle Business Intelligence > Administration to open a

second instance of the Oracle BI Administration Tool. b. Select File > Open > Offline.

Page 316: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

310 Oracle BI Suite EE 10g R3: Build Repositories

c. Select the ABC repository. d. Click Open. Note that you can open the file only as read-only. This is because multi-user

development has not been set up, so only one user can edit the repository at a time. e. Click No. f. Select File > Exit to close this instance of the Oracle BI Administration Tool.

3. In this step, you create projects in the master repository. After you have copied the master repository to a shared directory, it is no longer used for development, so it can be used as a backup. Creating the original set of projects in the master repository allows you to see what changes were made after multi-user development is established by comparing the shared repository to the master. Normally, you create projects to contain all the presentation catalogs in the repository, broken down in a reasonable manner. In this practice, you create only two projects. a. Select Manage > Projects. The Project Manager window is displayed. b. Select Action > New Project. c. Enter Inventory Fact Table Project as the name. d. Expand Catalogs in the left pane. e. Expand Inventory. f. Select “Inventory”.”Inventory Facts”. g. Click Add. Note that a Catalogs folder appears in the right pane. h. Expand Catalogs in the right pane. Note that the Inventory presentation catalog is

automatically included in the project. i. Expand Inventory in the right pane. Ensure that “Inventory”.”Inventory Facts” has been

included in this project as well. j. Expand the Users folder in the left pane. k. Press and hold [Ctrl] and select Administrator, MWEST, and JMEYER. l. Click Add. A Users folder is added to the right pane. m. Expand the Users folder in the right pane and ensure that the three users are added to the

project.

Page 317: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 311

n. Check your work:

o. Click OK to save the project and close the Project window.

4. Create a second project to contain the Inventory presentation catalog. Note that this project also contains the Inventory Facts logical fact table. This demonstrates that it is possible for projects to overlap, or for one project to contain another. a. Select Action > New Project. b. Enter Inventory Project as the name. c. Expand Catalogs in the left pane. d. Double-click the Inventory presentation catalog. Note that a Catalogs folder appears in the

right pane. e. Expand Catalogs in the right pane. Note that the Inventory presentation catalog has been

added to the project. f. Expand Inventory in the right pane. Ensure that “Inventory”.”Inventory Facts” has been

included in this project as well. g. Add the Administrator, MWEST, and JMEYER users to the project.

Page 318: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

312 Oracle BI Suite EE 10g R3: Build Repositories

h. Check your work:

i. Click OK to save the project and close the Project window. Your Project Manager should

look as follows:

j. Select Action > Close to close the Project Manager. k. Save your changes to the repository. It is not necessary to perform a global consistency

check.

5. Copy your master repository to a shared directory. This allows all the developers on the development team to access the repository. a. Open Windows Explorer. b. Navigate to <machine name>\Shared Documents. Folders in this Shared

Documents folder are automatically shared with other users on this machine. c. Right-click in the right pane and select New > Folder. d. Name the new folder RPD. e. Copy ABC.rpd from D:\OracleBI\server\Repository to the Shared

Documents\RPD folder. f. In the Shared Documents\RPD folder, rename the repository SharedABC.rpd.

6. Set the multi-user directory in the Oracle BI Administration Tool to point to the shared repository you just created. a. In the Oracle BI Administration Tool, select Tools > Options. b. Click the Multiuser tab. c. Click Browse next to the multi-user development directory field.

Page 319: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 313

d. Browse to select Shared Documents\RPD. e. In the Full Name field, enter Mary West. f. Click OK to close the Options dialog box. g. Select File > Close to close the ABC.rpd repository. You are ready to perform multi-user

development.

Page 320: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

314 Oracle BI Suite EE 10g R3: Build Repositories

Practice 22-2: Using a Multi-User Development Environment

Goals To check out, modify, and check in projects in a multi-user development environment To examine the various files created and modified when working with a multi-user development environment

Scenario Two users, MWEST and JMEYER, work in the multi-user development environment and modify the same project simultaneously.

Time 20–30 minutes

Instructions

1. Connect to the shared repository and check out the Inventory Project as MWEST. a. In the Oracle BI Administration Tool, select File > Multi-User > Checkout. The Extract

from SharedABC.rpd dialog box opens. b. Enter MWEST as the username and password. c. Click OK. d. Note that the two projects you created are listed. e. Select Inventory Project and click OK. The New Repository dialog box opens. f. Change the file name to MWEST.rpd. Note that this repository file is being saved to the

default repository directory and not the shared repository directory you created earlier. Also, note that a copy of the shared master repository, SharedABC.rpd, has been copied to the default repository directory.

g. Click Save. The Inventory Project repository is displayed. Note that it only contains the Inventory presentation catalog and business model. The other presentation catalogs and business models are not shown.

2. Review the files that were created or modified by the checkout process. a. Using Windows Explorer, navigate to Shared Documents\RPD. Which are the new files

that appear?

b. Navigate to D:\OracleBI\server\Repository. Which are the new files that appear? What are they?

Page 321: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 315

3. As JMEYER, check out the same Inventory project using a second instance of the Oracle BI Administration Tool. This demonstrates that multiple users can work with the same repository and the same project simultaneously. a. Select Start > Programs > Oracle Business Intelligence > Administration. b. Select File > Multiuser > Checkout. The Extract from ShareABC.rpd dialog box opens. c. Enter JMEYER as the username and password. d. Click OK. Note that both projects are still shown. There is no indication that MWEST has the

Inventory Project open. This is an intentional feature of the product: multiple developers can work on a single project, and changes are merged during the check-in process.

e. Select Inventory Project. f. Click OK. g. Enter JMEYER.rpd as the file name. h. Click Save. The Inventory Project is now being worked on by two developers

simultaneously. i. Navigate to D:\OracleBI\server\Repository and note that a set of JMEYER files

has been added.

4. Modify the project as MWEST and check it in to understand the check-in process. a. Return to the Administration Tool that has MWEST.rpd open. The repository name is

displayed on the title bar of the application. b. In the Presentation layer, expand Inventory, right-click Regions, and select Delete. This is

an obvious change that will be easy to track. c. Click Yes to confirm the deletion. d. Save the repository. Do not perform a global consistency check. e. Select File > Multiuser > Merge Local Changes. This merges your changes to the shared

repository. A Lock Information window is displayed. The shared repository will be locked until check-in is complete.

f. Accept the default values shown and click OK. The Merge Repositories dialog box appears. Do not click Merge yet. Note that you first merge your modified project repository with the original copy of the project repository in the default repository directory.

5. Switch to the Oracle BI Administration Tool with the JMEYER.rpd open and attempt to merge local changes. a. Select File > Multi-User > Merge Local Changes. An error message appears: You are

already attempting to check in this file. No one else can check in projects while the shared repository is locked. Here, you are trying to check in the same project using the same Windows username, and so the error message warns you about this.

b. Click OK to close the error message.

6. Return to the Oracle BI Administration Tool where the check-in is being performed for the MWEST.rpd and complete the merge. a. Ensure that the original subset is D:\OracleBI\server\Repository\originalMWEST.rpd. b. Ensure that the modified subset is D:\OracleBI\server\Repository\MWEST.rpd. c. Because no changes were made to the shared repository while you had your project checked

out, your only options are to merge your changes or examine the merge statistics.

Page 322: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

316 Oracle BI Suite EE 10g R3: Build Repositories

d. Click Stats. A summary of the number of changes is shown. One object was deleted from the modified subset.

e. Click Close. f. Click Merge. g. Click No when prompted to check global consistency. At this point, the changes are merged

to the local copy of the SharedABC repository and the local copy is opened. The changes have not yet been published to the shared master repository.

h. Navigate to D:\OracleBI\server\Repository. Note that there is a new file named SharedABC.merge_log.csv. This is a comma-separated values file listing the changes made to the repository in the merge.

i. Double-click SharedABC.merge_log.csv to open it using Microsoft Excel and check the changes.

j. Close SharedABC.merge_log.csv without saving any changes and close MS Excel. k. Return to the Administration Tool with SharedABC.rpd open and ensure that the Regions

presentation table no longer appears in the Inventory presentation catalog.

l. Save the modified SharedABC repository. Do not check for global consistency. m. Select File > Close to close the repository. A warning appears indicating that you are closing

an MUD repository without publishing or discarding your local changes, so the lock on the repository has not been released. At this point, you have the option to publish the repository (copy the local copy of the shared repository to the server), discard the local changes, or

Page 323: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 317

close the repository and keep the lock.

n. Click Cancel. o. Select File > Multiuser > Publish to Network. The local copy of the shared repository is

merged with the shared repository and then closed and deleted. p. Select File > Multiuser > History. q. Log in as Administrator with the password Administrator. r. The Version 1 of SharedABC repository is opened and the history of changes is displayed.

s. Right-click the entry and select View > Details. The event details for the project are

displayed:

t. Close the details window. u. Select Action > Close. The History window and Version 1 of SharedABC are closed. v. In the Administration Tool, select File > Open > Offline. w. Navigate to Shared Documents\RPD and select SharedABC.rpd to open the shared

master repository. x. Click Open. y. Click Yes to acknowledge that it can only be opened as read-only. z. Log in as Administrator. aa. Expand the Inventory presentation catalog and ensure that the Regions presentation table no

longer appears.

bb. Close the repository. cc. Select File > Exit to close this instance of the Administration Tool.

Page 324: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

318 Oracle BI Suite EE 10g R3: Build Repositories

7. Return to the instance of the Administration Tool with JMEYER.rpd open and ensure that JMEYER sees the changes, even though he checked out his project before those changes were applied. a. Return to the remaining instance of the Administration Tool with the JMEYER repository

open. b. Expand the Inventory presentation catalog and ensure that Regions still appears. This is

because JMEYER checked out this project before MWEST deleted the Regions table. c. Select File > Multiuser > Merge Local Changes. d. Click OK to accept the default lock information. The Merge Repositories dialog box opens. e. Note: The fact that Regions was deleted is listed in the merge log indicates that another

developer did this. This is why the application copies the latest version of the shared repository when performing a check-in.

f. Select the listing to highlight it and then click the ellipsis button to view the objects

deleted from the Current repository.

g. Click Cancel. h. In the bottom panels of the original JMEYER project, the modified JMEYER project and the

current SharedABC repository are shown. The differences between the projects are displayed. In this case, the original and modified repositories have a Regions presentation table that is not in the current shared repository. At this point, a decision must be made about how to proceed with the merge.

Page 325: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 319

i. In the Decision column for the highlighted listing, choose Modified (A) from the drop-down list (it may be necessary to scroll to the right). This chooses the modified repository over the current repository, thereby rejecting the changes of the other developer, and restoring the repository to the state before MWEST deleted Regions.

j. Click Merge. k. Click No when prompted to check global consistency. l. Ensure that Regions now appears in the Inventory presentation catalog. m. Select File > Multiuser > Publish to Network to publish the repository. n. Click No when prompted to check global consistency. The local shared repository is merged

with the master shared repository. o. Open Shared Documents\RPD\SharedABC.rpd in read-only mode and ensure that

the changes were applied to the shared repository and that Regions now appears in the Inventory presentation catalog.

Page 326: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

320 Oracle BI Suite EE 10g R3: Build Repositories

p. Close the repository.

Page 327: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

Oracle BI Suite EE 10g R3: Build Repositories 321

Solutions 22-2: Using a Multi-User Development Environment

Answers

2.a. Using Windows Explorer, navigate to Shared Documents\RPD. Which are the new files that appear? SharedABC.000 and SharedABC.mhl

2.b. Navigate to D:\OracleBI\server\Repository. Which are the new files that appear? What are they? originalMWESTt.rpd, MWEST.rpd, and MWEST.rpd.Log. The MWEST.rpd file is the subset of the repository containing the Inventory Project metadata, which is the file that you modify. The original MWESTt.rpd is the original file so you can track your changes or revert to the original. The MWEST.rpd.Log file is your local log file.

Page 328: Build Repositories Ag

Lesson 22: Using the Multi-User Development Environment

322 Oracle BI Suite EE 10g R3: Build Repositories

Page 329: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

Oracle BI Suite EE 10g R3: Build Repositories 323

Practice 23-1: Exploring Administration Tool Features

Goal To provide orientation to additional Administration Tool features that are useful for maintaining and enhancing repositories

Scenario In building the SupplierSales and Inventory business models, you interacted with a number of features of the Administration Tool. In this practice, you are introduced to some additional features, which can aid in the development, maintenance, and administration of repositories.

Time 15–20 minutes

Instructions

1. Start the Oracle BI Server service and open the ABC repository in online mode.

2. Explore the Joins Manager, which allows you to examine, edit, and delete all the joins, both physical and logical, in a repository. a. Select Manage > Joins. The Joins Manager opens. The joins displayed in the right pane vary

depending on the leaf you select in the left pane. You can view all joins in the repository, in a particular business model, in the Business Model and Mapping layer, in the Physical layer, in the Business Model and Mapping layer for a particular business model, and in the Physical layer for a particular business model. Joins are further divided into logical foreign key, logical, physical foreign key, and physical complex.

b. In the left pane, select SupplierSales > Physical > Physical Foreign Key Joins to see all physical foreign key joins in the Physical layer for the SupplierSales business model. The Joins Manager displays the join name, the tables in the join, and the join expression.

c. Click any column heading to sort the joins by that column. d. Right-click any join in the list and select Properties to open the Join Properties dialog box.

You can edit the join properties using this dialog box. e. Click Cancel to close the dialog box. f. Select SupplierSales > Business Model and Mapping > Logical Join to display the logical

joins in SupplierSales business model. g. Select Action > New. Note that you can create new joins using the Joins Manager. This

feature is not used widely because most users tend to create joins with the physical or logical diagrams, as you have done in this course.

h. Close the Joins Manager.

3. Explore the Sessions Manager, which shows all users logged into the session, all current query requests for each user, and variables and their values for a selected session. a. Select Manage > Sessions to open the Session Manager. Assuming that you have logged out

of all prior sessions of Oracle BI, you should see only your Administrator user session, which is the ABC repository open in online mode. Note that the Session Manager displays a session ID, user, client type, repository logical name, logon time, and last active time.

Page 330: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

324 Oracle BI Suite EE 10g R3: Build Repositories

b. Log in to Answers as MWEST with password MWEST, and create and run a request. c. Return to the Session Manager. Note the new entry for MWEST.

d. Write down the session ID for MWEST:

e. Select the MWEST session in the Session Manager. f. Note that details about the request are displayed in the lower pane. Your screen should

resemble the following screenshot:

g. Write down the request ID:

h. Open the query log. Note that the query log identifies the user, the session ID and request ID, and the date and time of the request.

i. Close the query log. j. Click the Variables tab in the lower pane. This displays the session and repository variables

in effect for this session, including the values of the variables. This is useful for knowing the values of variables when debugging.

k. Click the Requests tab in the lower panel. l. Select the request.

Page 331: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

Oracle BI Suite EE 10g R3: Build Repositories 325

m. Click Kill Request to terminate the highlighted request. You can use this feature to terminate long-running requests that might be tying up resources.

n. Select the MWEST session in the upper panel. o. Click Disconnect. The session is closed. p. Return to the open MWEST session in Answers. q. Create a new query and click Results. Note that you receive an error message. MWEST has

to log out and log back in to create a new session. r. Close the Session Manager. s. Log out of Oracle BI.

4. Explore the Query Repository utility, which allows you to search a repository to locate objects by type or name. a. Select Tools > Query Repository to open the Query Repository dialog box. b. In the Type field, select Presentation Column from the drop-down list. c. Click the Filter button to filter the results of this query. d. In the Item column, select Related to from the list. e. Ensure that the column next to Item displays the “=” sign. f. Next to the Value column, click the ellipsis (…) button. g. Choose Select Object from the list to open the Select dialog box. h. In the left pane of the Select dialog box, select the Business Model tab at the bottom of the

pane. i. Expand SupplierSales and double-click Periods to select it. This allows you to use the

Query Repository utility to find columns in the Presentation layer that map to the Periods table in the Business Model and Mapping layer.

j. Click OK to close the Query Repository Filter dialog box and check your results:

Page 332: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

326 Oracle BI Suite EE 10g R3: Build Repositories

k. Click the Query button to execute the query.

l. Click the Name column heading to sort the results.

Page 333: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

Oracle BI Suite EE 10g R3: Build Repositories 327

m. Double-click one of the Day columns, or select Day and click the Edit button, to view or edit the object properties.

n. Click Cancel to close the Object Properties dialog box. o. Click Date and then click Parent to view the object hierarchy.

p. Close the Parent Hierarchy dialog box. q. In the Name field, enter Month* to search for objects in the repository that begin with the

word Month. r. In the Type field, select All Types from the list. s. Click the Filter button. t. Click Clear All. u. Click OK.

Page 334: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

328 Oracle BI Suite EE 10g R3: Build Repositories

v. Click the Query button to execute the query. Click Yes to proceed.

w. Select the Show Qualified Name check box to display the fully qualified names of the

objects. Note that the icons help in identifying if the objects are tables, keys, aggregated columns, dimension levels, and so on.

x. Click Save Query As and save the query as Month. y. In the Name field, enter Date* and click Query. z. Click Saved Queries. aa. Click the Month query you saved in a prior step. bb. Click Query to view the results. cc. Click any object and click Go To to jump to the object in the repository. dd. Expand the SupplierSales business model, right-click the Periods logical table and select

Display Related > Presentation Column to see another method for opening the Query Repository utility and displaying results.

ee. Close the Query Repository utility. ff. Check in changes and save the repository.

5. Explore the Replace Column or Table in Logical Table Sources utility. As its name suggests, this utility is for changing the column or table references in logical table sources. For example, you have created a repository with several logical table sources, with logical columns that have formulas mapped to physical table and column names. If you want to substitute a different

Page 335: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

Oracle BI Suite EE 10g R3: Build Repositories 329

column or table in the source, this utility provides a way to change all the references to the source tables quickly. It is often used after duplicating an existing logical table source to add a new physical source (for example, a fragment) efficiently with the objective of reusing all the formulas in the logical table source. a. In the Business Model and Mapping layer, expand Inventory > Inventory Facts > Sources. b. Double-click the INVENTORY_Q1_2004 logical table source. c. Click the Column Mapping tab. d. Note that the logical columns map to the INVENTORY_Q1_2004 physical table. e. Click Cancel to close the Logical Table Source dialog box. f. Select Tools > Utilities. g. Click Replace Column or Table in Logical Table Sources and click Execute. h. In the drop-down, select Replace whole table. i. In the left panel, select ORCL > SUPPLIER2 > INVENTORY_Q1_2004. j. In the right panel, select ORCL > SUPPLIER2 > INVENTORY_Q1_2005. k. Click Next. The wizard identifies which columns will be replaced. At this point you can add

or remove columns.

l. Click Next. The wizard identifies which tables and columns will be replaced.

m. Click Finish. n. Double-click the INVENTORY_Q1_2004 logical table source. o. Click the Column Mapping tab.

Page 336: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

330 Oracle BI Suite EE 10g R3: Build Repositories

p. Ensure that the logical columns now map to the INVENTORY_Q1_2005 physical table.

q. Click OK to close the Logical Table Source dialog box. r. Check in changes. Do not check consistency. s. Save the repository.

6. Explore the Externalize Strings utility. You use this utility to export the names of presentation layer objects to a file in comma-separated value (CSV), tab-delimited (TXT), or XML format. You externalize presentation layer strings when setting up local language translations for them. To externalize strings, the presentation layer tables must have their Externalize Display Names property set to On. a. In the Presentation layer, select Inventory > Inventory Facts. b. Right-click Inventory Facts and select Externalize Display Names. c. Select Tools > Utilities > Externalize Strings. d. Click Execute. e. In the left pane, click Inventory. The strings appear in the right pane.

f. Click Save. g. Enter Inventory for the file name and save in D:\OracleBI\server\Repository. h. Click Close. i. Navigate to D:\OracleBI\server\Repository and open the Inventory.csv file

j. Close the file and Excel.

7. Explore the Rename Wizard. You use this utility for renaming Business Model or Presentation layer objects. You can use it to replace text strings, change all letters to lowercase, use uppercase for the first letter of words, and so on. You can preview the new names before committing the changes. It is primarily used on Business Model logical columns after importing physical objects into the middle layer.

Page 337: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

Oracle BI Suite EE 10g R3: Build Repositories 331

a. Select Tools > Utilities > Rename Wizard and click Execute. b. At the bottom of the left pane, click Business Model and Mapping. c. In the left pane, expand Inventory > Regions. d. Select all three columns and click Add to add the columns to the right pane. e. Click Next. f. Click Next again. g. Select All text lowercase and click Add. h. Select Change specified text. i. In the Find field, enter an underscore. j. In the Replace with field, enter a space. k. Click Add. l. Select First letter of each word capital and click Add. m. Click Next. n. In the Check Out Objects, click Next. o. Click Next. The wizard allows you to preview the changes before committing.

p. Click Finish. q. Examine the changes in the repository.

r. Check in changes. Do not check consistency. s. Save the repository.

8. Explore the Repository Documentation utility. This utility documents the mapping from the presentation columns to the corresponding logical and physical columns. The documentation also includes conditional expressions associated with the columns. The documentation can be saved in comma-separated, tab-delimited, or XML format. If a presentation column derives from several physical columns, there is one row in the document for each physical column. a. Select Tools > Utilities> Repository Documentation and click Execute. b. Accept the default location (Repository), name the file RpdDoc, and select Comma-

separated values (*.csv) from the Save as type list. c. Click Save. d. Navigate to the Repository directory and examine the file. e. Close the file and Excel.

9. Explore the Generate Metadata Dictionary utility. This utility provides a set of static XML documents. Each document describes a metadata object, including its properties and its relationships to other metadata objects. The utility provides a user-friendly interface for navigating a repository to help users understand metadata object relationships better.

Page 338: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

332 Oracle BI Suite EE 10g R3: Build Repositories

a. Close the ABC repository.

b. Stop the Oracle BI Server service. c. Open the ABC repository in offline mode. You cannot generate the metadata dictionary in

Online mode. d. Select Tools > Utilities > Generate Metadata Dictionary and click Execute. e. In the Choose Directory dialog box, browse to D:\Inetpub\wwwroot and click OK. f. Wait for a message that says Metadata dictionary has been successfully created under

D:\Inetpub\wwwroot\ABC, and click OK. g. Navigate to D:\Inetpub\wwwroot\ABC and ensure that there is an ABC folder with the

following subfolders and files:

h. Open Internet Explorer and use the following URL to start the Name Index page:

http://<machine name>/ABC/NameIndex.xml. i. The Name Index link organizes metadata objects by name. j. Click the Tree Index link. k. Click the SupplierSales presentation catalog link. l. Click the Customers presentation table link. The Customers presentation table page displays

the object hierarchy and description, presentation columns, logical columns, and permissions associated with this object.

Page 339: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

Oracle BI Suite EE 10g R3: Build Repositories 333

m. Click the Region presentation column link. The Region presentation column page displays

the object hierarchy, the logical column mapping, and permissions associated with this object.

n. Click the Logical Column Mapping link to view column mappings for the Region presentation column.

o. Continue to click links and explore the metadata dictionary. p. Close the browser when you finish.

10. Explore Administration Tool options. a. Return to the Administration Tool and select Tools > Options. b. Click the General tab. c. Tile when resizing automatically tiles the layer windows when you resize the Administration

Tool application. If you deselect this, the windows for the three layers can be resized independently and have standard Windows controls, such as buttons to minimize, maximize, restore, and close the window.

d. Display qualified names in diagrams displays fully qualified names in the physical and logical diagrams, making it easier to identify sources.

Page 340: Build Repositories Ag

Lesson 23: Using Administration Tool Utilities

334 Oracle BI Suite EE 10g R3: Build Repositories

e. Display original name for alias in diagrams displays the original name in physical and logical diagrams for any objects that have been modified.

f. Check out objects automatically checks out objects automatically in online mode whenever the object properties are displayed.

g. Show row count in physical view displays row counts for objects in the physical diagram and Physical layer.

h. The other options in the General tab are self-explanatory. i. Click the Repository tab. The options here determine where objects are displayed in the

Administration Tool interface. You can have tables and dimensions appear only in display folders. A display folder is a user-interface feature for organizing metadata objects. It is not a metadata object itself. You can also choose to hide level-based measures in dimension hierarchies.

j. Click the Sort Objects tab. This determines what classes of metadata objects the tool will present in alphabetical order, as opposed to time-created order.

k. Click the Cache Manager tab. These are the same preferences you saw earlier in the lesson on caching.

l. Click the More tab. This allows you to control the scrolling speed of the tool and set the default diagram zoom.

m. Click the Multiuser tab. You use this tab to identify the directory holding the master repository for multi-user development.

n. Click OK to close the Options dialog box. o. Close the repository. p. Close the Administration Tool.

Page 341: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

Oracle BI Suite EE 10g R3: Build Repositories 335

Practice 25-1 Exploring Repository Design Principles

Goals To explore Oracle BI repository design principles in the Oracle BI Applications repository

Scenario Oracle BI Applications include a prebuilt repository. In this lesson you explore how repository design principles and best practices are applied in the Oracle BI Applications repository.

Time 15 – 25 minutes

Instructions

1. Open the Oracle BI Applications repository in offline mode. a. Navigate to D:\Labs. b. Double-click EnterpriseBusinessAnalytics.rpd. c. Enter Administrator as the user name and SADMIN as the password. d. Click OK. The repository is large so it may take a moment to open.

2. Explore physical models and connection pools in the Physical layer. a. Notice that there are multiple physical models for multiple physical sources: Oracle,

Peoplesoft, Siebel, and so forth. You can create separate physical models to point to different data sources or separate physical models to point to the same data source to allow for different uses of the same schema.

b. Expand the Oracle Data Warehouse object and notice that there are two connection pools. You can create multiple connection pools to control things like security and access to the write-back function.

3. Explore aliases in the Physical layer. a. Expand Oracle Data Warehouse > Catalog > dbo. b. Scroll through the physical tables and notice the physical table aliases. Physical table aliases

have an icon with a green arrow. There are dimension aliases that begin with the prefix Dim, fact aliases that begin with the prefix Fact, aggregate aliases that begin with the prefix Fact_Agg, and so forth. There are several advantages to working with aliases: i. You can import key relationships in the physical tables and keep them in the physical

layer for reference, while changing the join relationships in the aliases to meet the needs of the business model you are creating.

ii. Naming conventions can be constructed for all the physical table aliases used as sources in the repository, making the function and content of tables easier to understand. Good naming conventions can also help order the tables in a meaningful way. Prefixing alias table names allows you to easily identify table types, such as dimension, fact, aggregate, and so forth.

Page 342: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

336 Oracle BI Suite EE 10g R3: Build Repositories

iii. Alias names show up in the SQL, making the SQL easier to understand. You can even use aliases to track which LTS was used by the Oracle BI Server. Naming conventions also help to identify table usage and helps other repository developers in multi-user development environments.

iv. Aliases also help in cases where one table can act as both a fact and a dimension. c. Continue to scroll through the physical tables and notice that the original physical tables are

also listed in the physical layer along with their aliases. This allows you to modify alias tables by editing the source table. Recall that any changes to the source table are automatically synched to the alias table.

d. Double-click the Fact_W_ORDER_F alias to open the Alias Physical Table properties dialog box.

e. Click the General tab. Notice the source table is W_ORDER_F. f. Click Cancel to close the dialog box. g. Right-click the Fact_W_ORDER_F alias and select Physical Diagram > Object(s) and

Direct Joins to open the Physical Diagram. Notice that the fact alias joins only to dimension aliases, not the original physical dimension tables.

h. Close the Physical Diagram. i. Right-click the W_ORDER_F table, which is the source table for the Fact_W_ORDER_F

alias, and select Physical Diagram > Object(s) and Direct Joins to open the Physical Diagram. Notice that the fact table does not join to any other tables. Only aliases are used to build the Physical layer joins.

j. Close the Physical Diagram. k. Double-click the Dim_W_EMPLOYEE_D_Sales_Rep alias to open the Alias Physical

Table properties dialog box. l. Click the General tab and notice that the source table is W_EMPLOYEE_D. m. Click Cancel to close the dialog box. n. Double-click the Dim_W_EMPLOYEE_D_Service_Requester alias to open the Alias

Physical Table properties dialog box. o. Click the General tab and notice that the source table for this alias is also W_EMPLOYEE_D.

You can use aliases to provide a clean join strategy with no ambiguity and to avoid circular joins for dimension tables that are joined to more than one other table.

p. Click Cancel to close the dialog box.

4. Explore “primary” canonical time relationships in the Physical layer. a. Right-click Dim_W_DAY_D_Common and select Physical Diagram > Object(s) and Direct

Joins to open the Physical Diagram. b. If necessary, move the diagram objects so that Dim_W_DAY_D_Common is visible.

Dim_W_DAY_D_Common is a common time dimension alias table that joins to all fact alias tables. This enables time reporting across multiple facts.

c. Close the physical diagram. d. Use Ctrl+click to select the following three tables:

Dim_W_DAY_D_Common Fact_W_SRVREQ_F_Close_Date Fact_W_SRVREQ_F_Open_Date

Page 343: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

Oracle BI Suite EE 10g R3: Build Repositories 337

e. Right-click any one of the three highlighted tables and select Physical Diagram > Selected Object(s) Only to open the Physical Diagram.

f. Double-click Fact_W_SRVREQ_F_Close_Date in the physical diagram to open the Alias Physical Table dialog box.

g. If necessary, click the General tab. Notice that the source table for this alias is W_SRVREQ_F.

h. Click Cancel to close the dialog box. i. Double-click Fact_W_SRVREQ_F_Open_Date in the physical diagram to open the Alias

Physical Table dialog box. j. If necessary, click the General tab. Notice that the source table for this alias is also

W_SRVREQ_F. In this example, to create canonical time, you create two aliases of the service request fact table, W_SRVREQ_F, and then join the foreign key column in each alias to the key column in the common time dimension.

k. Click Cancel to close the dialog box. l. To verify the joins, double-click the link between Dim_W_DAY_D_Common and

Fact_W_SRVREQ_F_Close_Date to open the Physical Foreign Key dialog box. Notice that the CLOSE_DT_WID foreign key column in Fact_W_SRVREQ_F_Close_Date joins to the ROW_WID primary key column in Dim_W_DAY_D_Common, which is the common time dimension.

m. Click Cancel to close the Physical Foreign Key dialog box. n. Repeat the steps to examine the join between Dim_W_DAY_D_Common and

Fact_W_SRVREQ_F_Open_Date. Notice that the OPEN_DT_WID foreign key column in Fact_W_SRVREQ_F_Open_Date joins to the ROW_WID primary key column in Dim_W_DAY_D_Common, which is the common time dimension.

o. Click Cancel to close the Physical Foreign Key dialog box. p. Close the Physical Diagram.

5. Explore “secondary” canonical time relationships in the Physical layer. a. Use Ctrl+click to select the following four tables:

Fact_W_ORDER_F Dim_W_DAY_D_Order_Date Dim_W_DAY_D_Campaign_Start_Date Dim_W_DAY_D_Campaign_End_Date

b. Right-click any one of the four highlighted tables and select Physical Layer > Selected Object(s) Only to open the Physical Diagram.

c. Double-click one at a time Dim_W_DAY_D_Order_Date, Dim_W_DAY_D_Campaign_Start_Date, and Dim_W_DAY_D_Campaign_End_Date to open the Alias Physical Table dialog box for each table. On the General tab, notice that the source table for each alias is the same table, W_DAY_D, which is also the source table for Dim_W_DAY_D_Common, which is the common time dimension alias table.

d. Click the join links to examine the joins between Fact_W_ORDER_F and the three time dimension alias tables. Notice that each of these “secondary” canonical time dimensions joins to a different foreign key column in the fact alias: Dim_W_DAY_D_Campaign_Start_Date.ROW_WID =

Page 344: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

338 Oracle BI Suite EE 10g R3: Build Repositories

Fact_W_ORDER_F.CAMP_ST_DT_WID Dim_W_DAY_D_Campaign_End_Date.ROW_WID = Fact_W_ORDER_F.CAMP_END_DT_WID Dim_W_DAY_D_Order_Date.ROW_WID = Fact_W_ORDER_F.ORDER_DT_WID These secondary time dimension relationships provide the ability to drill down, filter, aggregate, and so forth, on time dimension columns within the same fact table.

e. Close all open dialog boxes and the Physical Diagram.

6. Explore the physical table caching property. a. Double-click W_ORDER_F to open the Physical Table dialog box. Notice that the Cacheable

property is checked. b. Click Cancel to close the Physical Table dialog box. c. Double-click the Fact_W_ORDER_F alias table to open the Alias Physical Table dialog

box. Notice that the Cacheable property is grayed out and cannot be edited. It is best practice to set this property on the source physical table, not the alias table. However, notice that the option does exist to override the source table caching properties. This provides more control over the caching properties of the alias tables.

d. Click Cancel to close the Alias Physical Table dialog box.

7. Explore business models in the Business Model and Mapping layer. a. In the Business Model and Mapping layer, notice that there are separate business models for

independent areas of functionality: Consumer Sector, Core, Forecasting, Pharma, and so forth. Even if you have only a single data source or schema in the physical layer, or only have one physical data source for the repository, it is still good practice to break out the physical layer objects into multiple business models in the BMM layer to represent the independent areas of functionality.

8. Explore dimension hierarchies in the Business Model and Mapping layer. a. Expand the Core business model. Notice there are dimension hierarchies for every logical

dimension table in the business model. The main reason you want all dimension tables to have a hierarchy is so that you can accurately specify the aggregation content of sources using dimension levels.

b. Right-click the first dimension hierarchy, Account Geography, and select Expand All. Notice that there is a Total Account Geography level and a Postal Code Detail level. All dimensions must have at least two levels: the Total level and the Detail level.

c. Double-click Total Account Geography and click the General tab. Notice that Grand total level is checked and the number of elements is set to one.

d. Click Cancel to close the Logical Level dialog box.

9. Explore logical tables and columns in the Business Model and Mapping layer. a. Scroll through the Core business model and notice that dimensions and facts are grouped

into logical tables according to functional areas. When building logical tables, do not merge multiple dimension tables into a single logical dimension table, and do not merge multiple fact tables into a single logical fact table. You do not want to have one fact table that contains

Page 345: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

Oracle BI Suite EE 10g R3: Build Repositories 339

all of the facts across the entire enterprise. Group facts and dimensions according to functional areas, or according to how business users build their queries. Having multiple logical fact tables also makes it easier to create well-defined projects for multi-user development. It is good practice to prefix logical table names with Dim, Fact, or Fact Compound. This allows you to easily see how the tables are being used. It also groups the tables together in the business model, so that facts are groups with facts, dimensions with dimensions, and so forth. You can further refine naming conventions by adding abbreviations for the business area or function. For example, Fact - CRM, Fact - Fins, Fact – HR and so forth. All logical tables and columns in the Business Model and Mapping layer should be renamed in a way that is meaningful to end-users.

10. Explore the logical structure of time dimensions. a. Expand Dim – Sales Order Close Date. b. Expand Dim – Sales Order Date. Notice that these two time logical dimension tables

contain the same columns and general structure. For consistency, if there are multiple time dimensions within the business model, make sure all time dimension logical tables contain the same columns and general structure. This is good for reporting purposes. If the same columns are available in all time dimensions, end users will get consistent query results.

11. Explore the use of “dummy” measures. a. Expand Fact – CRM – Revenue. Scroll down and notice how the “dummy” measures

derived metrics and vertical metrics help to group and organize facts within the logical fact table.

12. Explore logical joins. a. Right-click Fact – CRM – Revenue and select Business Model Diagram > Selected

Table(s) and Direct Joins to open the Logical Table Diagram. b. Double-click any of the logical joins and observe that only you use only logical (complex)

joins in the Business Model and Mapping layer. When defining logical joins in the BMM layer, leave the default properties for the join. The defaults are: no driving table, join type is set to inner, and the cardinality is “0,1” to “N’.

c. Close the Logical Table Diagram.

13. Explore logical levels. a. Expand Fact – CRM – Service Request > Sources. Notice that there are multiple logical

table sources, including both fact and aggregate sources. b. Double-click each logical table source to open the Logical Table Source dialog box and then

click the Content tab. Notice that logical levels are explicitly set for each logical table source. As far as the Oracle BI Server is concerned, you only need to define aggregate content (logical levels) for fact table sources that are at an aggregate level. However, it is best practice to explicitly define logical levels for all logical table sources for all logical fact and dimension tables in the business model. This is true even if the logical table source is at the base or detail level. The only time you should leave the logical level blank is if no logical relationship exists in the business model. Also, you should always assign aggregation content at the logical level, not the column level.

Page 346: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

340 Oracle BI Suite EE 10g R3: Build Repositories

14. Explore WHERE clause filters. a. Expand Fact – CRM – Employee > Sources. b. Double-click the Dim_W_EMPLOYEE_D logical table source to open the Logical Table

Source dialog box. c. Click the Content tab. Notice the WHERE clause filter. One reason to use WHERE filters in

the logical layer is to avoid the need for opaque views or complex joins in the physical layer. In this example, there is a WHERE clause filter to restrict the employee fact table so that it only returns records where the employee flag is set to yes.

d. Close the Logical Table Source dialog box.

15. Explore snowflaking in the Business Model and Mapping layer. a. Expand Dim – Product > Sources. b. Double-click the Dim_W_PRODUCT_Dcccccccc logical table source. c. If necessary, click the General tab. Notice that this logical table source maps to multiple

physical tables. When possible, you should try to avoid snowflaking in the Business Model and Mapping layer and build models that use only star schemas. Sometimes you can accomplish this by adding extra tables into a logical table source. In this example, three tables are added to one logical table source in the Business Model and Mapping layer, which avoids the need to join the logical tables in a snowflaked schema.

16. Explore presentation catalogs in the Presentation layer. a. In the Presentation layer, notice that there are multiple presentation catalogs. While it is

possible to model the Presentation layer to include all objects in one presentation catalog, this is not the recommended approach. It is better to have multiple catalogs, with each catalog specifically designed for a particular reporting purpose.

b. Double-click the Sales – Sales Overview presentation catalog to open the Presentation Catalog dialog box.

c. Click the General tab and then the Permissions button. Notice the users and groups that have access to this presentation catalog.

d. Close the Permissions and Presentation Catalog dialog boxes. e. Double-click the Service - Contact Center Sales Overview presentation catalog to open the

Presentation Catalog dialog box. f. Click the General tab and then the Permissions button. Notice that the users and groups that

have access to this presentation catalog are different from the Sales – Sales Overview presentation catalog. One advantage to using multiple presentation catalogs is the ability to set up security where each presentation catalog is specific to a type of user or reporting purpose.

17. Explore presentation tables. a. Expand the Service – Contact Center Sales presentation catalog. Notice how the

presentation tables are listed. The Time dimension is listed first, followed by the dimension tables and then the fact table. Presentation tables should be consistent across presentation catalogs. Consistent ordering and display of presentation tables across catalogs helps to create a presentation layer that is usable and intuitive.

Page 347: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

Oracle BI Suite EE 10g R3: Build Repositories 341

b. Expand a variety of presentation catalogs and observe the number of tables in each catalog. It is good practice to keep presentation catalogs small and easy to understand by limiting the number of tables. It is also good practice to limit the presentation catalogs so there are no more than a couple of fact presentation tables in each catalog. This is not just to keep the catalog small. It is also important to avoid situations where there are multiple join paths existing within one presentation catalog.

c. Expand the Activities presentation catalog. Notice that the three tables under the Time presentation table are preceded by a hyphen. This ensures that these tables are nested under the Time presentation table when they are displayed in Answers.

18. Explore implicit fact columns. a. Double-click Sales – Sales Overview to open the Presentation Catalog dialog box. b. If necessary, click the General tab. c. Notice that the implicit fact column is set. It is good practice to set the implicit fact column

for a presentation catalog to reduce join ambiguity during dimension only queries. This is especially true if the presentation catalog contains multiple fact presentation tables.

19. Explore canonical time. a. Expand a few of the Sales* presentation catalogs and observe that the Time dimension is

listed first for each catalog. b. Expand the Time dimension in the Sales* presentation catalogs and observe that the Time

dimension columns are consistent across the catalogs.

20. Explore presentation columns. a. Expand a variety of presentation tables and observe the number of columns in each table. It is

good practice to keep presentation tables small and easy to understand by limiting the number of columns.

21. If you have time, continue to explore the repository. When you are done, close the repository without saving changes.

Page 348: Build Repositories Ag

Module 25: Oracle BI Repository Design Principles

342 Oracle BI Suite EE 10g R3: Build Repositories

Page 349: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

Oracle BI Suite EE 10g R3: Build Repositories 343

(Optional) Practice: Exploring Level Keys

Goal To explore different options for constructing level keys

Scenario One topic that often needs more clarification is level keys. Which attributes should be level keys? How many level keys can a level have? What is a primary level key? What does it mean to be a level key but not used for drilldown? How do the choices you make affect SQL generation? You have constructed the product dimension for Supplier Sales and added an aggregate fact table, D1_ORDER_AGG1, which was at the product Type level of aggregation. Both Type, a description, and Typecode, a number, are potential level keys, because they both define unique product types. Which should be the level key? Which should be the primary key of the level? Should Type, which maps to a column in D1_PRODUCT_TYPE, be in its own logical table source or should it be included in the existing logical table source for the Products logical table? In this practice, you examine some options to help answer these questions.

Time 20–30 minutes

Instructions

1. Copy the LevelKeys repository to the Repository directory. a. Stop the Oracle BI Server service. b. Navigate to D:\Labs. c. Copy LevelKeys.rpd and paste it into D:\OracleBI\server\Repository. d. Open the LevelKeys repository in offline mode. e. Log in as Administrator with no password.

2. Case 1: In this step, you modify the repository to create conditions that reveal the behavior of level keys. You then run a query in Answers, examine the log file, and draw conclusions about this behavior. a. In the SupplierSales business model, verify that D1_ORDER_AGG1 is added as a logical

source to the SalesFacts fact table. b. Double-click D1_ORDER_AGG1, click the Content tab, and very that it is aggregated at the

SalesRep, Month, and Type levels. c. Double-click D1_ORDERS2, click the Content tab, and very that it is aggregated at the

Customers Detail, Day, and Specific levels. d. Double-click the D1_PRODUCTS logical table source for the Products logical table. e. Click the Content tab. f. Click the X next to the Logical Level to delete the level. g. Click OK to close the Logical Table Source dialog box. h. Delete the Type logical table source for the Products logical table. i. Double-click the Type level in ProductsDim.

Page 350: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

344 Oracle BI Suite EE 10g R3: Build Repositories

j. Set the primary key to Type Code. k. Click OK to close the Logical Level dialog box. l. The conditions are now as follows: D1_ORDER_AGG1 aggregate fact table is the logical table source for the SalesFacts

logical fact table at the SalesRep, Month, and Type levels of aggregation. Aggregation content is specified on the fact logical table sources using levels. Aggregation content level is not specified on the Products dimension source. There is no separate Type logical table source for the D1_PRODUCTS logical table. Type Code is set as the primary key of level Type, but is not used for drilldown.

m. Check consistency. Fix any errors or warnings before continuing. n. Save and close the LevelKeys repository. o. Modify the NQSConfig.ini file to point to the LevelKeys repository. Turn off caching. p. Start the Oracle BI Server service.

3. Test your work. a. Log in to Oracle BI as Administrator, no password, use the SupplierSales subject area

and run this query in Answers:

b. Examine the query log and note that the SQL used the aggregate fact table; there are

unnecessary tables in the FROM clause (a subset of tables in the D1_PRODUCTS logical table source); the SQL group by clause includes Type Code (TYPECODE), the primary key of the level.

c. Close the log file. d. Recall the joins in the tables involving the dimension table and fact table source. The joins

that lead from D1_PRODUCT_TYPE to D1_PRODUCTS, a chain of 1:N cardinality joins,

Page 351: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

Oracle BI Suite EE 10g R3: Build Repositories 345

identify the tables that are included in the SQL:

e. Return to Answers, drill down on Type, and note that Type drills down to Subtype. f. Create the following query and click Results:

g. Drill down on Typecode and note that Typecode also drills down to Subtype. h. You can draw the following conclusions from these results: The primary key of the level is automatically included in the SQL GROUP BY clause if

the dimensional grain of the query is at the same level. If the level of the query is above the level of the source, then the primary key of the level is not included in the SQL GROUP BY clause.

Drilling down from a level key, even the alternate key, drills down to the key marked for drilldown in the next level, not to the primary key of the same level.

Extraneous tables connected by 1:N joins are included in the SQL if they exist in the dimension table source.

The aggregation content does not need to be set in the aggregate dimension sources for aggregate navigation to work.

4. Case 2: In this step, you modify the repository again to create different conditions that reveal the behavior of level keys. You then run a query in Answers, examine the log file, and draw conclusions about this behavior. a. Open the LevelKeys repository in online mode. b. Log in as Administrator, no password. c. For the ProductsDim hierarchy, change the Type level primary key from Typecode to Type. d. Check in Changes. e. Click Yes to check consistency. f. Save the repository.

Page 352: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

346 Oracle BI Suite EE 10g R3: Build Repositories

g. Return to Answers, reload server metadata, and run the same query:

h. Open the query log and note that TYPECODE drops out of the GROUP BY clause, because

Type (ITEMTYPE) is now set as the primary key for the Type level:

i. Close the query log. j. Drill down on Type and note that the drilldown behavior is the same as in the previous steps.

Drill down is to Subtype.

5. Case 3: In this step, you further modify the repository to create different conditions that reveal the behavior of level keys. You then run a query in Answers, examine the log file, and draw conclusions about this behavior. a. Return to the LevelKeys repository in online mode.

Page 353: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

Oracle BI Suite EE 10g R3: Build Repositories 347

b. Add D1_PRODUCT_TYPE as a logical table source for the Products logical table. Recall that D1_PRODUCT_TYPE is an aggregate dimension logical table source at the Type level.

c. Double-click the D1_PRODUCT_TYPE logical table source. d. Click the Column Mapping tab. e. Map the Type logical column to D1_PRODUCT_TYPE.ITEMTYPE. f. Click OK to close the Logical Table Source dialog box. g. Double-click the D1_PRODUCTS logical table source. h. Click the General tab. i. Select D1_PRODUCT_TYPE from the list of mapped tables and click Remove to remove

D1_PRODUCT_TYPE from the detail source. j. Click OK to close the Logical Table Source dialog box. k. Leave Type as the primary level key and Type Code as the alternate key in ProductsDim

(same as case 2). l. Check in changes. m. Check consistency and verify the repository is consistent. n. Save the repository. o. Reload server metadata and run the same query:

p. Check the query log:

q. Note that the resulting SQL is an improvement over Case 2. As in Case 2, TYPECODE is not

in the GROUP BY clause and the extraneous tables drop out of the SQL. In this case, you have a separate logical table source for ITEMTYPE.

r. Close the query log.

6. Case 4: This case is like case 3, except you add back D1_PRODUCT_TYPE to the detail source and map Type Code and Type in this logical table source. You keep the aggregate dimension source, D1_PRODUCT_TYPE, as well. a. Return to the LevelKeys repository in online mode. b. Double-click the D1_PRODUCTS logical table source for the Products logical table. c. Click the Add button.

Page 354: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

348 Oracle BI Suite EE 10g R3: Build Repositories

d. Double-click D1_PRODUCT_TYPE in the select panel to add it as a logical table source to the Products table.

e. Click the Column Mapping tab. f. Map both Type Code and Type to the corresponding columns TYPECODE and ITEMTYPE

in D1_PRODUCT_TYPE in the D1_PRODUCTS logical table source.

g. Click OK to close the Logical Table Source dialog box. h. Leave the D1_PRODUCT_TYPE aggregation source as well.

i. Check in changes. j. Check consistency and verify that the repository is consistent. k. Save the repository. l. Return to Answers, reload server metadata, and run the same query:

m. Examine the query log. The result is that the SQL is unchanged from Case 3. TYPECODE is

not in the GROUP BY clause and the extraneous tables drop out of the SQL. In this case, you have a separate logical table source, D1_PRODUCT_TYPE, for both Type (ITEMTYPE) and Type Code (TYPECODE), but Type and Type Code are also mapped in the detail logical table source, D1_PRODUCTS.

n. Close the log file.

7. Case 5: This is the same as Case 1, except you delete Type Code as a level key, so it does not even exist as an alternate key. a. Return to the LevelKeys repository open in online mode. b. Expand the ProductsDim dimension to the Type level.

Page 355: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

Oracle BI Suite EE 10g R3: Build Repositories 349

c. Double-click the Type level. d. Click the Keys tab. e. Delete the Type Code key. f. Click OK to close the Logical Level dialog box. g. Delete the D1_PRODUCT_TYPE logical table source for the Products logical table. h. Double-click the D1_PRODUCTS logical table source. i. Click the Column Mapping tab. j. Map the Type Code logical column to D1_PRODUCTS.TYPECODE. k. Click OK to close the Logical Table Source dialog box. l. Check in changes. m. Check consistency and verify that the repository is consistent. n. Save the repository. o. Reload server metadata and run the same query:

p. Examine the query log and notice that the physical SQL is the same as Case 2:

q. The difference is in the drilldown behavior. Create and run the following request:

r. Drill down on Type Code. The drilldown from Type Code now goes to Type, that is, from a

non-key attribute to the level key used for drilldown at the same level, instead of the key marked for drilldown in the next level next level (Subtype in Case 1).

drills down to

8. Case 6: This illustrates drilldown behavior when drilling down to a level that has two level keys and both have use for drilldown checked.

Page 356: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

350 Oracle BI Suite EE 10g R3: Build Repositories

a. Return to the LevelKeys repository open in online mode. b. Expand the ProductsDim dimension to the Subtype level. c. Double-click the Subtype level. d. Click the Keys tab. e. Verify that Subtype is set as the primary level key. f. Double-click the Subtype level key and confirm that use for drilldown is selected. g. Double-click the Subtype Code level key and select use for drilldown. h. Check in changes. i. Check consistency. j. Save the repository. k. Reload server metadata and run the same query:

l. Drill down on Type. Note that the drilldown now goes from Type to the primary level key of

the next level, in this case, to Subtype. This is the case even though both level keys Subtype and Subtype Code are marked for drilldown.

9. Case 7: This is the same as Case 6, except the primary level key of the Subtype level is changed from Subtype to Subtype Code. a. Return to the LevelKeys repository open in online mode. b. Expand the ProductsDim dimension to the Subtype level. c. Double-click the Subtype level. d. Click the Keys tab. e. Set Subtype Code as the primary level key.

Page 357: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

Oracle BI Suite EE 10g R3: Build Repositories 351

f. Check in changes. g. Check consistency. h. Save the repository. i. Reload server metadata and run the same query:

j. Drill down on Type. Note that the drilldown now goes from Type to the primary level key of

the next level. In this case, to Subtype Code.

10. Case 8: This is the same as Case 7, except that aggregation content is set for the dimension table aggregate sources and aggregation content is deleted for the fact table aggregate source. a. Return to the LevelKeys repository open in online mode. b. Double-click the D1_ORDER_AGG1 fact table aggregate source. c. Click the Content tab. d. Delete the logical levels. e. Add back D1_PRODUCT_TYPE as an aggregate logical table source for the Products table. f. Use the Column Mapping tab to map the Type and Type Code logical columns to the

corresponding physical columns for the D1_PRODUCT_TYPE logical table source.

Page 358: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

352 Oracle BI Suite EE 10g R3: Build Repositories

g. Set the logical level to Type for the D1_PRODUCT_TYPE logical table source.

h. Check in changes. i. Check consistency. j. Save the repository. k. Reload server metadata and run the same query:

l. Check the query log and note that the query does not use the aggregate fact table source, but

uses the detail table, D1_ORDERS2.

m. Close the log file.

11. Case 9: This is the same as Case 8, except the fact aggregation content is set. One advantage of setting the dimension source tables is that it can help you to set or check the content levels for the fact table sources. a. Return to the LevelKeys repository open in online mode. b. Double-click the D1_ORDER_AGG1 logical table source for the SaleFacts table. c. Click the Content tab and reset the logical levels:

d. Check in changes.

Page 359: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

Oracle BI Suite EE 10g R3: Build Repositories 353

e. Check consistency. f. Save the repository. g. Reload server metadata and run the same query:

h. Check the query log. Because you reset the fact source aggregation content to the correct

level of aggregation, the physical aggregate table, D1_ORDER_AGG1, is used in the query:

Page 360: Build Repositories Ag

(Optional) Practice: Exploring Level Keys

354 Oracle BI Suite EE 10g R3: Build Repositories