You are on page 1of 294

Oracle BI Server Administrator 10g: Build Repositories

Activity Guide

D46077GC10 Edition 1.0 February 2007 D49384

Author
Jim Sarokin

Copyright 2007, 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

Technical Contributors and Reviewers


Matt Bedin Gerry Langton M. Lea Shaw Kasturi Shekhar Krishnan Viswanathan Kurt Wolff

Editors
Daniel Milne Atanu Raychaudhuri Richard Wallis

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 RIGHTS The U.S. Governments 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, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Graphic Designer
Satish Bettegowda

Validation Testing
Anirban Banerjee

Publishers
Srividya Rameshkumar Veena Narasimhan

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 Gather Information to Build an Initial Business Model............................22 Solutions 2-2 Gather Information to Build an Initial Business Model..........................24 Practice 2-3 Creating a Repository and Importing a Data Source..............................25 Solutions 2-3 Creating a Repository and Importing a Data Source ............................34 Practice 2-4 Defining Keys and Joins .........................................................................35 Solutions 2-4 Defining Keys and Joins .......................................................................38 Practice 2-5 Creating Alias and Select Tables............................................................39 Practice 3-1 Creating the Business Model..................................................................45 Solutions 3-1 Creating the Business Model ................................................................52 Practice 3-2 Creating Simple Measures .....................................................................53 Solutions 3-2 Creating Simple Measures....................................................................57 Practice 4-1 Creating the Presentation Layer .............................................................59 Solutions 4-1 Creating the Presentation Layer ...........................................................66 Practice 5-1 Testing the Repository............................................................................67 Solutions 5-1 Testing the Repository ..........................................................................77 Practice 5-2 Checking Consistency ............................................................................79 Solutions 5-2 Checking Consistency ..........................................................................84 Practice 6-1 Enhancing the Product Dimension .........................................................85 Practice 6-2 Creating Multiple Sources for a Logical Table Source (Manual) ............88 Solutions 6-2 Creating Multiple Sources for a Logical Table Source (Manual) ..........92 Practice 6-3 Creating Multiple Sources for a Logical Table Source (Automated) ......93 Solutions 6-3 Creating Multiple Sources for a Logical Table Source (Automated).....97 Practice 6-4 Adding a New Logical Table Source ......................................................98 Solutions 6-4 Adding a New Logical Table Source.................................................. 101 Practice 7-1 Creating Calculation Measures by Using Logical Columns................. 103 Solutions 7-1 Creating Calculation Measures by Using Logical Columns............... 109 Practice 7-2 Creating Calculation Measures by Using Physical Columns............... 110 Solutions 7-2 Creating Calculation Measures Using Physical Columns.................. 114 Practice 7-3 Creating Calculation Measures by Using the Calculation Wizard ....... 115 Solutions 7-3 Creating Calculation Measures by Using the Calculation Wizard ..... 121 Practice 8-1 Creating Dimension Hierarchies .......................................................... 123 Practice 8-2 Creating Level-Based Measures ......................................................... 134 iii

Practice 8-3 Defining Share and Rank Measures .................................................... 138 Practice 8-4 Creating Dimension-Specific Aggregation Rules ................................. 142 Practice 9-1 Using Aggregate Tables....................................................................... 145 Solutions 9-1 Using Aggregate Tables ..................................................................... 155 Practice 9-2 Using the Aggregate Persistence Wizard ............................................ 156 Practice 10-1 Modeling a Value-Based Partition...................................................... 165 Solutions 10-1 Modeling a Value-Based Partition .................................................... 172 Practice 10-2 Modeling a Fact-Based Partition ........................................................ 173 Practice 10-3 Using the Calculation Wizard to Create Derived Measures............... 178 Practice 10-4 Modeling Fragmented Inventory Data................................................ 181 Practice 11-1 Creating Dynamic Repository Variables ............................................ 193 Practice 11-2 Using Dynamic Repository Variables As Filters................................. 201 Practice 12-1 Creating Time Series Comparison Measures .................................... 205 Practice 13-1 Creating Users and Groups ............................................................... 211 Solutions 13-1 Creating Users and Groups.............................................................. 216 Practice 13-2 Assigning Permissions to Users and Groups..................................... 217 Solutions 13-2 Assigning Permissions to Users....................................................... 220 Practice 13-3 Authenticating Using an External Database....................................... 221 Practice 13-4 Authenticating Users with Database Authentication .......................... 225 Practice 13-5 Setting Query Limits and Timing Restrictions .................................... 229 Solutions 13-5 Setting Query Limits and Timing Restrictions .................................. 232 Practice 13-6 Setting Filters to Personalize Information .......................................... 233 Practice 14-1 Inspecting Cache Files ....................................................................... 239 Solutions 14-1 Inspecting Cache Files ..................................................................... 243 Practice 14-2 Modifying Cache Parameters............................................................. 244 Solutions 14-2 Modifying Cache Parameters ........................................................... 249 Practice 15-1 Setting Up a Multi-User Environment................................................. 251 Practice 15-2 Using a Multi-user Development Environment................................... 255 Solutions 15-2 Using a Multi-user Development Environment................................. 263 Practice 16-1 Exploring Administration Tool Features ............................................. 265 (Optional) Practice: Exploring Level Keys ................................................................ 279

iv

Lesson 1: Repository Basics

Practice 1-1 Exploring an Oracle BI Repository


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

Time

Instructions:
1. Stop the Oracle BI Server service. a. Double-click the Services icon on your desktop. b. Right-click the Oracle BI Server service and select Stop. c. Verify that the status is blank, meaning the service is stopped. d. Minimize the Services window. 2. Copy the repository for this practice to the appropriate directory. a. Navigate to E:\Labs. b. Copy the ClassStart.rpd file. c. Paste the file in E:\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 window, double-click ClassStart.rpd. d. Log in as Administrator, no password. 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 E:\OracleBI\server\Config
Oracle BI Server Administrator 10g: Build Repositories 1

Lesson 1: Repository Basics

directory. A check mark in the Default check box identifies the default SQL features. 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 of 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 program interface (API) used to access the data source. Some databases may be accessed using native APIs, some use 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 later in this course 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.

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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?

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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.
4 Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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. Select the General tab. Notice that the logical columns and their corresponding properties are listed. On this tab you could 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 you explored in the Physical layer. In a more complex business model, there might 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.

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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. Notice that there is no join expression in the Expression field and that there is a oneto-many relationship between the Customers logical dimension table and the SalesFacts logical fact table. You learn more about complex logical joins later in this course 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. 9. Examine the logical table source for the SalesFacts logical table.
6 Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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 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. The D1_ORDERS2 logical table source maps to which physical table?

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. The Dollars logical column maps to which physical column?

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 in 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. Dollars maps to which physical table and physical column?

e. Dollars belongs to which logical table source?

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. What aggregation rule is applied to the Dollars logical column?

i. Click the Aggregation tab. Note that the default aggregation rule is set to Sum. It is common for measures in business models to have aggregation rules applied. Open the aggregation rule
Oracle BI Server Administrator 10g: Build Repositories 7

Lesson 1: Repository Basics

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 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 later in this course 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 and alias for a presentation folder. g. Click Cancel to close the Presentation Catalog dialog box. 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 could 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. Select 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. The Dollars presentation column maps to which logical table and logical column in the Business Model and Mapping layer?

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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. Notice 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 E:\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. 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 E:\OracleBI\server\Log. f. Open NQServer.log. This log file contains information about Oracle BI Server. It is useful for diagnosing and troubleshooting Oracle BI Server startup and shutdown issues. g. Verify 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.

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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. e. Select Start > Programs > Oracle Business Intelligence > Presentation Services. f. Log in as Administrator, no password. 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. Notice 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. Notice 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 notice 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. b. Expand Facts > SalesFacts and select the Dollars column to add it to the request.

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

10

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

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.

Oracle BI Server Administrator 10g: Build Repositories

11

Lesson 1: Repository Basics

Solutions 1-1 Exploring an Oracle BI Repository


Answers
4.c. 5.c. 5.d. 6.h. 7.c. 8.b. 9.d. 9.f. What is the database platform type for this database? Oracle 10gR1 What is the call interface type for this connection pool? Default (OCI 10g) What is the data source name for this connection pool? ORCL Which tables have join relationships with D1_ORDERS2? D1_CUSTOMER2, D1_PRODUCTS, D1_CALENDAR2 Can this column object have null values? Yes What are the logical table objects in the SupplierSales business model? Customers, Periods, Products, SalesFacts The D1_ORDERS2 logical table source maps to which physical table? D1_ORDERS2 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 The Dollars logical column maps to which physical column? ACTLEXTND 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 Dollars maps to which physical table and physical column? D1_ORDERS2.ACTLEXTND Dollars belongs to which logical table source? D1_ORDERS2 What aggregation rule is applied to the Dollars logical column? Sum

9.g. 9.h.

10.d. 10.e. 10.h.

12

Oracle BI Server Administrator 10g: Build Repositories

Lesson 1: Repository Basics

12.e.

The Dollars presentation column maps to which logical table and logical column in the Business Model and Mapping layer? SalesFacts.Dollars What are the names of the subject areas listed on the Answers start page? SupplierSales, SupplierSalesDM Which object in the repository corresponds to the SupplierSales subject area in Answers? SupplierSales presentation catalog

16.h. 16.i.

Oracle BI Server Administrator 10g: Build Repositories

13

Lesson 2: Building the Physical Layer of a Repository

Practice 2-1 ABC Business Scenario


Goal To read the ABC document to become familiar with the business scenario for the fictitious company used throughout the course 1015 minutes

Time

Background
ABC sells food and non-food items to restaurant chain customers throughout the United States. ABCs 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 that it needs 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. In order to achieve these goals, ABC has decided to implement an Oracle Business Intelligence solution. The solution will enable its sales executives and operations managers to answer pertinent 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 focus its customer service efforts. ABC also has the vision of making this data directly available to customers, so they can better analyze their purchase history and compare it with what is being purchased nationally or regionally. This initiative is consistent with ABCs commitment to deliver a high quality business intelligence solution that will set it apart from its competitors and result in additional sales and revenue.

Oracle BI Server Administrator 10g: Build Repositories

15

Lesson 2: Building the Physical Layer of a Repository

Business Requirements You are a consultant, hired by ABC to implement this business intelligence solution. From your initial interviews with ABC managers, 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 they do not expect to hire any data analysts in the future. They 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 consistent with the way employees think about the business. From further interviews and an examination of 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. From the top level to the bottom (most detailed) level, the product levels are: 1. Total 2. Type 3. Sub-type 4. Generic Product 5. Specific Product ABC employees measure sales organization data at five levels. These levels mirror organizational management responsibilities. From the top level to the bottom, they are: 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 is: o Total Product sales o Product Type sales = Cheese o Product Sub-Type sales = American Cheese o Generic Product sales = American Cheese Slices o Specific Product sales = 2 Pack American Cheese Slices 16 Slices
Oracle BI Server Administrator 10g: Build Repositories

16

Lesson 2: Building the Physical Layer of a Repository

In addition to these hierarchies, ABC would like to group and analyze customers using geographical attributes like Zip Code, City, and State. They also would like 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, the difference between the units ordered and 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.

Oracle BI Server Administrator 10g: Build Repositories

17

Lesson 2: Building the Physical Layer of a Repository

Source Data By interviewing ABCs database administrators and examining 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 that provide information on customers, the product lines, the time periods, and the relationship between customers and the companys 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

18

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

D1_PRODUCT_TYPE

D1_PRODUCT_SUBTYPE

D1_CUSTOMER2

Oracle BI Server Administrator 10g: Build Repositories

19

Lesson 2: Building the Physical Layer of a Repository

D1_ORDERS2

20

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

Training Objective This primary objective of this training is to build the metadata and administer Oracle BI Server to support the business requirements of the ABC Company. The metadata will allow ABC employees to build interactive reports and Interactive Dashboards they can use to better analyze, monitor, and manage their business, 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 verify 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 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, percent change in a measure compared to same period in previous year). Add security information. Add aggregate table data sources to improve performance.

In the lessons that follow, you follow this strategy to build the metadata that presents the business model to support the business requirements of the ABC Company. 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.

Oracle BI Server Administrator 10g: Build Repositories

21

Lesson 2: Building the Physical Layer of a Repository

Practice 2-2 Gather Information to Build an Initial Business Model


Goal Scenario To analyze the business requirements in order to begin building the metadata Before you can begin to build 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. You have identified the structure of the initial business model 1015 minutes

Outcome Time

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 wish to report on?

2. What hierarchies can you identify?

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

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

22

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

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

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

(Dimension)

(Dimension)

(Facts)

(Dimension)

Oracle BI Server Administrator 10g: Build Repositories

23

Lesson 2: Building the Physical Layer of a Repository

Solutions 2-2 Gather Information to Build an Initial Business Model


Answers
1. 2. 3. 4. 5. 6. What measures (facts) does ABC wish to report on? Dollar sales, Units Ordered, Units Shipped, Net Weight Shipped, Cuts What hierarchies can you identify? Product, Time (Period), Customer/Sales Rep Against which attributes (dimensions) does ABC want to analyze their facts? Product, Time (Period), Customer By which additional attributes does ABC want to analyze products? Supplier, Diet Type By which geographical attributes does ABC want to analyze data? Zip Code, City, State Complete the following diagram with your identified facts and dimensions: Time Period

Product

Sales

Customer

24

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

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 First, you verify 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. At the end of this lesson 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. 1015 minutes

Scenario

Outcome

Time

Instructions:
1. An ODBC data source is needed to import schema information about a data source into an Oracle BI Server repository. In this step, you explore an existing ODBC data source for an Oracle database. The database has already been installed on your machine. a. On your desktop, double-click the Data Sources (ODBC) icon to open the ODBC Data Source Administrator. b. Click the System DSN tab. c. Double-click the ORCL system data source. The Oracle ODBC Driver Configuration dialog box opens. d. Click Test Connection. e. In the User Name field, verify the name is SUPPLIER2. f. In the Password field, type SUPPLIER2. g. Click OK. You should see a Connection successful message. h. Click OK. i. Click OK to close the Oracle ODBC Driver Configuration window. j. Click OK to close the ODBC Data Source Administrator window. 2. 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. 3. Examine the SUPPLIER2 schema.
Oracle BI Server Administrator 10g: Build Repositories 25

Lesson 2: Building the Physical Layer of a Repository

a. b. c. d.

Click the Administration link. In the Schema section, under Database Objects, click Tables. In the Schema field, enter SUPPLIER2 if not entered automatically. Click Go.

4. 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 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. f. When you are done, log out of Oracle Enterprise Manager and close the browser. 5. 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 on physical data sources is stored. The Business Model and Mapping layer is where measurements and terms used in business are mapped to the physical data sources. The Presentation layer is where the business model is customized for presentation to the user. You can work on each layer at any stage in creating a repository, but the typical order is to create the Physical layer first, then the Business Model and Mapping layer, and then the Presentation layer. 6. Import tables from the SUPPLIER2 schema into the Physical layer of the repository. a. Select File > Import > from Database. b. Select the ORCL ODBC data source. c. In the User Name field, type SUPPLIER 2. d. In the Password field, type SUPPLIER2. e. Click OK. The Import dialog box opens. This may take a moment. f. Scroll to the SUPPLIER2 schema folder and expand it. g. Scroll to view all of the tables in the SUPPLIER2 schema. h. In the Table name mask field, enter D%. i. Contract and then re-expand the SUPPLIER2 schema. Note that by entering something in the Table name mask field, you can filter the tables that appear for selection. The percent sign is the wildcard character (as it is 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

26

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

so that only tables that begin with D are visible. The filter is case sensitive.

j. Select the D1_CALENDAR2 table. This automatically deselects any higher-level container objects in the tree. k. Use Ctrl + click to select the remaining three tables to import into the Physical layer to build ABCs initial business model: D1_CUSTOMER2, D1_ORDERS2, and D1_PRODUCTS. l. Verify that only 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. In other words, only import objects needed to support your business model. However, do not worry if you import extra objects at this point. You can always delete objects later if they do not support your business model.

Oracle BI Server Administrator 10g: Build Repositories

27

Lesson 2: Building the Physical Layer of a Repository

m. Scroll to verify that no higher-level container objects are selected, and that only the four tables for import are selected:

n. o. p. q.

Click Import. The Connection Pool dialog box opens. Change the Connection Pool name to SUPPLIER CP. Verify that the call interface is set to Default (OCI 10g). Verify that the data source name is ORCL. The user name and password fields are automatically populated with SUPPLIER2. You provided this information when you created the ORCL ODBC data source. The data source is accessed by Oracle Call Interface (OCI). The data source name, ORCL, is the same as the tnsnames.ora entry for this Oracle database

28

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

instance.

r. Click OK. The import process begins. s. When the import is complete, click Close to close the Import dialog box. t. Notice that the metadata is imported into the Physical layer of the repository and the ORCL database object appears in the Physical layer. u. To display the tables, expand the ORCL database object and then expand the SUPPLIER2 schema folder. v. Verify that the four tables imported successfully and that the connection pool name is changed to SUPPLIER CP.

D1_CALENDAR2 is the table containing period information. It contains columns that are
Oracle BI Server Administrator 10g: Build Repositories 29

Lesson 2: Building the Physical Layer of a Repository

useful in queries using time periods as criteria for selecting and grouping data. D1_CUSTOMER2 contains customer information and D1_PRODUCTS contains product information for the business model. D1_ORDERS2 contains the invoice-level information needed to create the measures in the business model. 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. 7. 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 1MB of memory. e. Data source name is configured to access the database to which you want to connect. This value was set automatically when you imported the tables into the physical layer. f. User name 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 the 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, please consult the Oracle BI Server Administrator Guide or click the Help button. i. Click OK to close the Connection Pool dialog box. 8. 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 forth. c. Set the database type to Oracle 10gR1.
30 Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

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 databases default values during the schema import process. You can turn off any of these features if you determine there is a reason to do so. Oracle BI Server will adjust the SQL that it sends to that database accordingly and will compensate for the unchecked features with its own functionality. Please note that turning a feature on when the default is off may or may not cause that feature to be used in 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, type 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 this 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.
Oracle BI Server Administrator 10g: Build Repositories 31

Lesson 2: Building the Physical Layer of a Repository

l. Click OK to close the Database properties dialog box. 9. 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. Notice that it is possible to rename the object using the Name field. Do not rename the object at this time. d. Notice that the Cacheable check box is checked by default. This determines that queries that hit this table will be cached. You could also check 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. Leave the default, Cache never expires, selected. You learn more about caching in the lesson titled Cache Management. e. Notice 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. Notice that the Hint box is editable. This box is only editable when the database is Oracle. A hint specified here is included in all SQL that references this table. g. Notice that it is possible to add a description of the physical object. h. Click the Columns tab. i. Notice that all columns and corresponding column properties are listed on this tab. It is also possible to add new columns. j. Select the Keys and Foreign Keys tabs. Notice 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. 10. 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 supported data types based on the data types of the source database. c. Click Cancel to close the Physical Column properties dialog box. 11. 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. Please 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. Be aware that updating row counts for all tables can take a long time if you have imported many large
32 Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

b. c. d. e. f.

tables. It is also possible to update row count for a single physical layer object by rightclicking the object and selecting Update Row Count. 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. Expand any table. Move the cursor over the columns for the table and observe that row count information is now visible. Right-click any table and select View Data to view the data for the table. Close the View Data dialog box.

12. 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. 13. Leave the repository open and remain logged in to the Administration Tool for the next practice.

Oracle BI Server Administrator 10g: Build Repositories

33

Lesson 2: Building the Physical Layer of a Repository

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


Answers
4.b. 4.c. 7.b. Is there a primary key constraint defined on this table? No How many rows are in this table? 474 Why would you create more than one connection pool for a single data source? To give certain users more immediate access to data over other users. You can affect the immediacy of access to the database by creating multiple connection pools. Is the INTERSECT_SUPPORTED feature implemented on this database platform? Yes Is the INTERSECT_ALL_SUPPORTED feature implemented on this database platform? No

8.g. 8.i.

34

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

Practice 2-4 Defining Keys and Joins


Goals Scenario To define the primary keys, foreign keys, and joins in the Physical layer You have just created a new repository and imported the initial tables from the SUPPLIER2 schema into the Physical layer of the repository. Now, you must define keys and joins that exist on the physical database in the Physical Layer of the repository. If the imported database joined over primary key-foreign key relationships and the primary keys and foreign keys were imported into the repository, 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 SQL). In this database, primary keys, foreign keys, and joins have not been defined in the database. Therefore, you need to define the keys and join conditions manually using an objects Properties dialog box and the Physical Diagram feature of the Administration Tool. Keys and joins defined on the physical tables 1520 minutes

Outcome Time

Instructions:
1. In this step, you define joins and keys using the 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 is creating a one-to-many (1:N) relationship that joins the key column in the first table to a foreign key column in the second table. e. Select the columns that join the tables. Select the D1_CALENDAR2.YYYYMMDD column, and then select D1_ORDERS2.PERIODKEY. Verify that the Expression edit box (at the bottom) contains the following expression: D1_CALENDAR2.YYYYMMDD = D1_ORDERS2.PERIODKEY f. Click OK.

Oracle BI Server Administrator 10g: Build Repositories

35

Lesson 2: Building the Physical Layer of a Repository

g. A prompt appears with the message: A matching table key doesnt 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 will notice that the tool will guess at which columns to join on the basis of common names. Override the tool when necessary and verify 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 verify 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 and 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 some additional options for viewing the physical table diagram. a. Right-click 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 D1_ORDERS2 table. Why are ALL of the tables visible in the diagram with D1_ORDERS2?

36

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

e. Close the Physical Diagram window. 4. Observe 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. Notice 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 notice 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.

Oracle BI Server Administrator 10g: Build Repositories

37

Lesson 2: Building the Physical Layer of a Repository

Solutions 2-4 Defining Keys and Joins


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

38

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

Practice 2-5 Creating Alias and Select Tables


Goals Scenario To create alias and select table types, and deploy a view 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 verifying the results. A new alias table called ORDER_DATE and a select table called RegionEast 1520 minutes

Outcome Time

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. Notice that alias tables inherit all of the column definitions from the source table. d. Double-click any of the columns listed to open the Physical Column properties dialog box. Notice 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.

Oracle BI Server Administrator 10g: Build Repositories

39

Lesson 2: Building the Physical Layer of a Repository

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 verify that the column was automatically added. Creation of 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. Verify 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. Verify 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.
40 Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

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 verify that ALIAS_COLUMN is deleted. Deletion of a source column automatically deletes 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 becomes enabled. e. In the Default Initialization String pane, enter the following SQL: Select * From D1_CUSTOMER2 Where REGION = 'East'

f. g. h. i.

Click OK. Right-click the RegionEast table and select Update Row Count. Mouse over the table and verify that there are 56 rows. View the data and verify that the correct rows are returned (Region column has the expected value East). j. Close the View Data dialog box. 4. Before deploying the select table as a view, verify 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, type CREATE_VIEW_SUPPORTED and click OK.

Oracle BI Server Administrator 10g: Build Repositories

41

Lesson 2: Building the Physical Layer of a Repository

e. Confirm that the Value field 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. b. Right-click the RegionEast table and select Deploy View(s). The View Deployment dialog box opens and identifies which views will be deployed.

42

Oracle BI Server Administrator 10g: Build Repositories

Lesson 2: Building the Physical Layer of a Repository

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

d. Click OK to close the dialog box. 6. Verify 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. Verify that the REGIONEAST view appears.

i. Leave Oracle Enterprise Manager open. 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.

Oracle BI Server Administrator 10g: Build Repositories

43

Lesson 2: Building the Physical Layer of a Repository

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

c. Click OK. 8. Verify 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. Verify 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. 10. Save the repository without checking global consistency. 11. Close the repository. 12. Close the Administration Tool.

44

Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

Practice 3-1 Creating the Business Model


Goal To create a business model in the Business Model and Mapping layer of the repository 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 business 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 hence 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 begin 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. 1520 minutes

Scenario

Time

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.
Oracle BI Server Administrator 10g: Build Repositories 45

Lesson 3: Building the Business Model Layer of a Repository

b. Select File > Open > Offline. c. Double-click ABC.rpd to open the repository file. d. Log in as Administrator, no password. 2. Use your understanding of ABCs business requirements to identify the mappings to the physical tables. Refer to prior practices if necessary. a. Customer, sales rep, district, and region data map to which physical source table?

b. Main product information data maps to which physical source table?

c. Invoice sales data maps to which physical source table?

d. Month codes, month names, and year data map to which physical source table?

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 it is not yet enabled for querying. You enable the business model for querying later 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 notice that a Sources folder is created for each logical table. In each Sources folder is a named source. For example, the named source for the D1_CALENDAR2 logical table is the D1_CALENDAR2 physical table.

46

Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

d. Notice 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, because the keys and join relationships were already created in the Physical layer. However, you typically do not drag and drop 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 make it editable. Please note that logical table names are purely a business model artifact. They are not necessarily exposed to users.
Table D1_CUSTOMER2 D1_PRODUCTS D1_ORDERS2 Rename to: Customers Products SalesFacts

6. Delete columns that are not needed for analysis. a. Expand the SalesFacts table and then click on the first column below. Then use CTRL+click to select the remaining columns to be deleted.
Columns PRODKEY PERIODKEY INVNBR

Oracle BI Server Administrator 10g: Build Repositories

47

Lesson 3: Building the Business Model Layer of a Repository

CUSTKEY DWACOSTEXTND REPCOSTEXTND CMDOLRS NULL_FIELD

b. Verify 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 then click the first column below. Then use CTRL+click to select the remaining columns to be deleted.
Columns TRUE_JULIAN_DAY_NM DAY_SINCE_JAN_11990 WEEK_NUM_IN_YEAR WEEKSINCE_JAN11990 NULL_DATE CHINESE_YEAR through DAGO (including DAGO)

f. g. h. i. j. k.

Verify that the Periods table is not selected and then click the Delete key. Click Yes to confirm the delete. Expand the Products table. Right-click the PGCODE column and select Delete. Click Yes to confirm the delete. Expand the Customers table and delete the REPNO and FACTOR columns.

7. Rename logical columns to names that can be better understood by end users. The names you give to 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 YYYYMMDD FULL_GREGORIAN_DTE MONTH_IN_YEAR DAY_IN_MONTH DAY_NAME DAY_IN_YEAR MONTH MONTHCODE YEAR Rename to: Day Date Month in Year Day in Month Day Name Day in Year Month Month Code Year

48

Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

SalesFacts Table ACTLEXTND UNITSHPD UNITORDD NETWGHTSHPD Customers Table NEWKEY NAME ADDRESS PHONE CITY STATE ZIP_CODE SALESREP ROUTECODE DISTRICT REGION Products Table GENERICDESCRIPTION SPECIFICDESCRIPTIN SUPPLIERCODE SUBTYPECODE TYPECODE PACKAGE_WEIGHT PACKAGECODE DIETCODE PRODUCTKEY

Rename to: Dollars Units Shipped Units Ordered Net Weight Shipped Rename to: Customer Key Customer Address Phone City State Zip Code Sales Rep Route Code District Region Rename to: Generic Specific Supplier Code Subtype Code Type Code Package Weight Package Code Diet Code ProductKey

8. In this step, you verify 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. Verify that the Customer Key column is defined as the key for this table.
Oracle BI Server Administrator 10g: Build Repositories 49

Lesson 3: Building the Business Model Layer of a Repository

e. Click OK. f. Click OK. g. Repeat these steps and verify 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 Administrator 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 simply 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. Notice 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 logical fact table, SalesFacts, and three logical dimension tables: Periods, Products, and Customers.
50 Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

10. Save the repository. 11. Click No when prompted to check Global Consistency. 12. Leave the repository open for the next practice.

Oracle BI Server Administrator 10g: Build Repositories

51

Lesson 3: Building the Business Model Layer of a Repository

Solutions 3-1 Creating the Business Model


Answers
2.a. 2.b. 2.c. 2.d. Customer, sales rep, district, and region data map to which physical source table? D1_CUSTOMER2 Main product information data maps to which physical source table? D1_PRODUCTS Invoice sales data maps to which physical source table? D1_ORDERS2 Month codes, month names, and year data map to which physical source table? D1_CALENDAR2

52

Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

Practice 3-2 Creating Simple Measures


Goals To examine the logical-to-physical column mappings and create simple measures 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 verify the physical tables referenced by the business model. Measures defined in the SalesFacts logical table 1520 minutes

Scenario

Outcome Time

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 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 it is. Notice 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.

Oracle BI Server Administrator 10g: Build Repositories

53

Lesson 3: Building the Business Model Layer of a Repository

f. The Dollars logical column is mapped to which physical column?

g. The Dollars logical column is mapped to which physical table?

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 our 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, and then use CTRL+click to 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.
54 Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

i. What happens to the logical column icons after you change the default aggregation rule to Sum?

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 that are not included 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 of the physical tables currently referenced by the SupplierSales business model. It also displays the row count for any 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.
Oracle BI Server Administrator 10g: Build Repositories 55

Lesson 3: Building the Business Model Layer of a Repository

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.

56

Oracle BI Server Administrator 10g: Build Repositories

Lesson 3: Building the Business Model Layer of a Repository

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 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. The Dollars logical column is mapped to what physical column? ACTLEXTND The Dollars logical column is mapped to what physical table? D1_ORDERS2 What aggregation rules are available? None, Sum, Avg, Count, Count Distinct, Max, Min, First, Last, and Median, and two standard deviation measures: StdDev, and StdDevPop. What happens to the logical column icons after you change the aggregation rule to Sum? It changes to a summation symbol. Which join is displayed, the physical or logical? Physical How did you determine which join is displayed? There are foreign key joins.

1.b.

1.f. 1.g. 2.d.

2.k. 3.i. 3.j.

Oracle BI Server Administrator 10g: Build Repositories

57

Lesson 4: Building the Presentation Layer of a Repository

Practice 4-1 Creating the Presentation Layer


Goal Scenario To create the Presentation layer of a repository You have created the initial SupplierSales business model in the repository. You now create the Presentation layer of the repository, which allows you to expose the business model to users in Oracle BI Answers so that users can build requests to analyze their data. In the Presentation layer of the repository, there is a SupplierSales presentation catalog and a SupplierSalesDM presentation catalog. 1015 minutes

Outcome

Time

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 still be open in the Administration Tool from the previous practice. a. Verify that the Presentation layer is visible. If it is not visible, 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. Please 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.
Oracle BI Server Administrator 10g: Build Repositories 59

Lesson 4: Building the Presentation Layer of a Repository

b. Click the General tab. You use this tab to create or edit a presentation catalog. c. Notice 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. Short catalog names are therefore desirable. The tool prevents you from giving a presentation catalog and presentation table the same name, and it is 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 later in this course. 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. Notice 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. Notice 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, any 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. Notice 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 like 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.

60

Oracle BI Server Administrator 10g: Build Repositories

Lesson 4: Building the Presentation Layer of a Repository

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 and alias for a presentation folder. n. Click OK to close the Presentation Catalog properties dialog box. o. Expand the SupplierSales presentation catalog and notice 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. Notice 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. Similar to a presentation catalog, changing a presentation table
Oracle BI Server Administrator 10g: Build Repositories 61

Lesson 4: Building the Presentation Layer of a Repository

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. The reverse is not true. 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. Verify 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 typing Sales District in the Name field. g. Select 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.
62 Oracle BI Server Administrator 10g: Build Repositories

Lesson 4: Building the Presentation Layer of a Repository

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 and make it more understandable to users 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 are typically not useful and 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.

Oracle BI Server Administrator 10g: Build Repositories

63

Lesson 4: Building the Presentation Layer of a Repository

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

g. Double-click SalesFacts to open the Presentation Table dialog box. h. 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 verify this in the next set of practices.

i. Click OK to close the Presentation Table dialog box. j. Click OK to close the Presentation Catalog dialog box. k. 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 ABCs District Managers. District Managers analyze

64

Oracle BI Server Administrator 10g: Build Repositories

Lesson 4: Building the Presentation Layer of a Repository

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 ABCs 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 notice that it contains all of the same objects as the SupplierSales presentation catalog. c. Rename the SupplierSales#1 presentation catalog to SupplierSalesDM. d. Since ABCs 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.

Oracle BI Server Administrator 10g: Build Repositories

65

Lesson 4: Building the Presentation Layer of a Repository

Solutions 4-1 Creating the Presentation Layer


Answers
4.g. Select the Aliases tab. What is the logical column name (or alias) for this presentation column? District Which logical column does this presentation column map to? District Which business model does this presentation column map to? SupplierSales Which logical table does this presentation column map to? Customers Which physical table and column does this presentation column map to? D1_CUSTOMER2.DISTRICT

4.k. 4.l. 4.m. 4.o.

66

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

Practice 5-1 Testing the Repository


Goal To test the repository by generating some queries, retrieving the results, and examining the query log You have finished building the initial business model and now need to test the repository before continuing your development. 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. A tested and verified repository file 2535 minutes

Scenario

Outcome Time

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 asking 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.

Oracle BI Server Administrator 10g: Build Repositories

67

Lesson 5: Testing and Validating a Repository

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. 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 Messages tab.

68

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

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

h. Close the Consistency Check Manager. The SupplierSales business model folder has changed to available for queries . from unavailable for queries i. Save the repository. j. 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. Verify that the User tab is selected. 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 initialization file, NQSConfig.ini. An entry in the Repository section of the initialization file instructs Oracle BI 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
Oracle BI Server Administrator 10g: Build Repositories 69

Lesson 5: Testing and Validating a Repository

(E:\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 E:\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 verify 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. Verify 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 verify that startup is successful. a. Navigate to E:\OracleBI\server\Log. b. Double-click NQServer.log to open it. c. Locate the message Loading repository E:\OracleBI\server\Repository\ABC.rpd. d. Verify that SupplierSales is the Subject Area that was loaded and note the Oracle BI Server started message. The log should look similar to the picture.

70

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

The log file can contain messages indicating why the server startup failed. For example, if there were 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. Verify 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, no password. d. Click the Answers link. e. Verify 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. Move the mouse over the Customers folder and verify that the description you entered in an earlier practice appears as a tool tip. c. Expand the Facts folder and verify that SalesFacts is nested under the Facts folder.

Oracle BI Server Administrator 10g: Build Repositories

71

Lesson 5: Testing and Validating a Repository

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. On the Dollars column, click the Column Properties button.

g. h. i. j. k. l. m.

In the Column Properties dialog box, click the Data Format tab. Click Override Default Data Format. In the Treat Number As field, select Currency. In the Currency Symbol field, select $. In the Decimal Places field, select 2. Check Use 1000s Separator. Check your work:

n. Select Save > as the system-wide default for -SalesFacts.Dollars.

72

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

o. On the Dollars column, click the Order by button once to select the Order Ascending icon. p. Expand the Periods table and use Ctrl+click to 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. Verify 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. Verify 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. On the Dollars column, click the Order by icon.

icon once, to select Order Ascending

Oracle BI Server Administrator 10g: Build Repositories

73

Lesson 5: Testing and Validating a Repository

d. Use Ctrl+click to 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 down 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 this picture:

d. Locate the SQL Request section. This section contains the logical SQL issued from Answers. e. Which presentation table is Sales District information coming from?

f. Which presentation table is Dollars information coming from?

74

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

g. The FROM clause identifies which presentation catalog (subject area)?

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 is connecting. 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. The query results are ordered by which physical column?

t. Did this query complete successfully?

u. How many rows were retrieved from the database?


Oracle BI Server Administrator 10g: Build Repositories 75

Lesson 5: Testing and Validating a Repository

v. w. x. y.

Close the log file. Click Finished to close the Session Management window. Click Close Window to close the Oracle BI Presentation Services Administration window. 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 verify the repository.

76

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

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 Which sales district in the East region had the highest revenue (dollars) in 1999? Yankee Which presentation table is Sales District information coming from? Customers Which presentation table is Dollars information coming from? SalesFacts The FROM clause identifies which catalog name? SupplierSales What filters were applied to this request? year = 1999 and region = east Which repository (logical name) was accessed for this query? Star Which subject area was accessed for this query? SupplierSales Which presentation catalog was accessed for this query? SupplierSales Which physical tables are accessed for this query? D1_CUSTOMER2, D1_CALENDAR2, and D1_ORDERS2 Which physical columns were accessed for this query? DISTRICT and ACTLEXTND For which physical column was an aggregation rule applied? ACTLEXTND Which logical column maps to the physical column with the aggregation rule? SalesFact.Dollars

9.f. 10.e. 10.f. 10.g. 10.h. 10.i. 10.k. 10.l. 10.n. 10.o. 10.p. 10.q.

Oracle BI Server Administrator 10g: Build Repositories

77

Lesson 5: Testing and Validating a Repository

10.r.

Which physical join specifications are used in this query? D1_CALENDAR2.YYYYMMDD = D1_ORDERS2.PERIODKEY D1_CUSTOMER2.NEWKEY = D1_ORDERS2.CUSTKEY The query results are ordered by which physical column? ACTLEXTND (Dollars) Did this query complete successfully? Yes How many rows were retrieved from the database? 4

10.s. 10.t. 10.u.

78

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

Practice 5-2 Checking Consistency


Goal Scenario To understand the requirements for a consistent business model You have successfully tested the business model and made it available for querying by end users. In this practice, you modify your business model to generate an inconsistent business model, to further understand the requirements for troubleshooting and correcting an inconsistent business model. 1015 minutes

Time

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. Verify 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 E:\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 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, no password. c. In the title bar, verify 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.
Oracle BI Server Administrator 10g: Build Repositories 79

Lesson 5: Testing and Validating a Repository

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 to 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 verify 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. Verify 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. Notice 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 logical column Customer in the

80

Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

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 verify 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. b. Click the Keys tab. c. Double-click D1_CUSTOMER2_key. d. Which column(s) is part of the logical key?

e. f. g. h. i.

Click OK to close the Logical Key dialog box. Click Delete to delete the D1_CUSTOMER2_Key. Click Yes to confirm delete. Click OK to close the Logical Table dialog box. 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

Oracle BI Server Administrator 10g: Build Repositories

81

Lesson 5: Testing and Validating a Repository

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 verify 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. Verify that the General tab is selected. 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.
82 Oracle BI Server Administrator 10g: Build Repositories

Lesson 5: Testing and Validating a Repository

i. Why dont you 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. Be sure to 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.

Oracle BI Server Administrator 10g: Build Repositories

83

Lesson 5: Testing and Validating a Repository

Solutions 5-2 Checking Consistency


Answers
5.f. 6.d. 7.i. To which physical table and physical column is the Customer logical column mapped? table = D1_CUSTOMER2, column = NAME Which column(s) is part of the logical key? CustomerKey Why dont you 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.

84

Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

Practice 6-1 Enhancing the Product Dimension


Goal To import normalized tables that contain additional product information into the Physical layer of the repository There are product tables that store detail information about ABCs 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. 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 510 minutes

Scenario

Outcome

Time

Instructions
1. Verify that Oracle BI Server is stopped. a. Open the Services window. b. Locate Oracle BI Server and verify 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. Verify 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 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. Thus 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 ORCL data source. c. Verify that SUPPLIER2 is the user name and enter SUPPLIER2 as the password. d. Click OK. The Import dialog box opens. This may take a few moments.
Oracle BI Server Administrator 10g: Build Repositories 85

Lesson 6: Adding Multiple Logical Table Sources

e. Scroll to the SUPPLIER2 folder and expand it. f. Select the following tables (use CTRL+click) to import:
Table Name D1_PRICELIST D1_PRODUCT_SUBTYPE D1_PRODUCT_TYPE D1_PROD_DIET_TYPES D1_SUPPLIERS

g. h. i. j.

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

k. 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

86

Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

d. Check your results:

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

Oracle BI Server Administrator 10g: Build Repositories

87

Lesson 6: Adding Multiple Logical Table Sources

Practice 6-2 Creating Multiple Sources for a Logical Table Source (Manual)
Goal Scenario To add the information from the price list table to the Product dimension You have imported the product tables that store detail information about ABCs products into the Physical layer of the repository and configured keys and joins for the tables. Thus far, the Product dimension in the Business Model and Mapping layer includes 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). 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. 5 minutes

Outcome

Time

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. Said another way, 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.

88

Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

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. g. h. i.

Select the join in the Joins section. The View Details button becomes active. Click View Details to open the join dialog box and view the read-only details of the join. Click Cancel to close the join dialog box. 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
Oracle BI Server Administrator 10g: Build Repositories 89

Lesson 6: Adding Multiple Logical Table Sources

(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 does not automatically add logical columns to the logical table, nor does it change the logical to physical mapping of any existing columns. Now that the physical table that stores the pricing information 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. Notice 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. Select Insert and examine the expression. k. Click OK to close the Expression Builder.

90

Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

l. Verify 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.

Oracle BI Server Administrator 10g: Build Repositories

91

Lesson 6: Adding Multiple Logical Table Sources

Solutions 6-2 Creating Multiple Sources for a Logical Table Source (Manual)
Answers
1.c. 1.d. Which product table is not visible in the browse list? D1_PRODUCT_TYPE 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.

92

Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

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 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. 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 510 minutes

Scenario

Outcome

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. Verify 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.

Oracle BI Server Administrator 10g: Build Repositories

93

Lesson 6: Adding Multiple Logical Table Sources

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 D1_PRODUCT_TYPE D1_SUPPLIERS Physical Column ITEMTYPE ITEMSUPPLIER D1_PRODUCT_SUBTYPE ITEMSUBTYPE

b. Open the D1_PRODUCTS logical table source properties dialog box and click the Column Mapping tab to verify 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 ITEMSUBTYPE ITEMTYPE ITEMSUPPLIER To Subtype Type 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.
94 Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

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, no password. c. Click the Answers link. 11. Create a request to verify 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.
Oracle BI Server Administrator 10g: Build Repositories 95

Lesson 6: Adding Multiple Logical Table Sources

b. Click View Log for the last entry in the Cursor Cache section. c. Verify 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 picture.

d. Why are all 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.

96

Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

Solutions 6-3 Creating Multiple Sources for a Logical Table Source (Automated)
Answers
1.f. 2.c. To which physical column and physical table is the DIET_TYPE logical column mapped? D1_PROD_DIET_TYPES.DIET_TYPE 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 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.

12.c.

Oracle BI Server Administrator 10g: Build Repositories

97

Lesson 6: Adding Multiple Logical Table Sources

Practice 6-4 Adding a New Logical Table Source


Goal Scenario To add a second logical table source to the Product dimension In examining the physical sources and the Products dimension table, you discover that the columns, Type Code and Type, 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. 5 minutes

Time

Instructions:
1. Open the ABC repository file in offline mode. a. Stop the Oracle BI Server service. b. Navigate to E:\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. 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.
98 Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

b. Verify 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. Verify 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. Notice 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

Oracle BI Server Administrator 10g: Build Repositories

99

Lesson 6: Adding Multiple Logical Table Sources

table source.

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.
100 Oracle BI Server Administrator 10g: Build Repositories

Lesson 6: Adding Multiple Logical Tables Sources

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. 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.

2.d.

Oracle BI Server Administrator 10g: Build Repositories

101

Lesson 7: Adding Calculations to a Fact

Practice 7-1 Creating Calculation Measures by Using Logical Columns


Goal Scenario To derive a new calculation based on existing business measures You want users to be able to track the difference between the units ordered and units shipped by selecting a single fact column called Cuts. This important 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. 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 1015 minutes

Outcome

Instructions:
1. Because you modify the ABC repository in online mode in this practice, verify 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. So far, 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 like 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).
Oracle BI Server Administrator 10g: Build Repositories 103

Lesson 7: Adding Calculations to a Fact

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. d. Verify 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. At that point the changes you made become active. When you are 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. Verify 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, type 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.

104

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

m. Check your results:

n. Click OK to close the Expression Builder. Notice 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 were 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. Notice also that the formula is expressed in terms of the physical column data types and that is also includes the aggregation functions (sum).

p. Click OK. Notice 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, verify that the SupplierSales presentation catalog is expanded.
Oracle BI Server Administrator 10g: Build Repositories 105

Lesson 7: Adding Calculations to a Fact

b. Select Cuts from the SalesFacts logical table and drag it onto the SalesFacts presentation table. 6. Select File > Check In Changes or click the Check In Changes button on the toolbar. 7. Click Yes to check global consistency. Fix any errors before proceeding. 8. If the repository passes the consistency check, close the Consistency Check Manager 9. Save the repository. 10. Verify your work. a. Log in to Oracle BI Presentation Services as Administrator, no password. 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. Verify that the Cuts calculation is accurate for the Frozen food type by manually subtracting Units Shipped from Units Ordered.
106 Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

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

h. Verify 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. You should see something 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 in the example pictured here). Because you defined
Oracle BI Server Administrator 10g: Build Repositories 107

Lesson 7: Adding Calculations to a Fact

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, the tool would display an icon that warns you about this condition. Dont do this! This is just for informational purposes.

108

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

Solutions 7-1 Creating Calculation Measures by Using Logical Columns


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

Oracle BI Server Administrator 10g: Build Repositories

109

Lesson 7: Adding Calculations to a Fact

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 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. 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 1015 minutes

Scenario

Outcome

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. Type 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. f. In the middle pane, select the table, D1_ORDERS2.
110 Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

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. Notice 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. Notice 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 any errors 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. Verify that CutsP appears in the SalesFact presentation table.

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

Oracle BI Server Administrator 10g: Build Repositories

111

Lesson 7: Adding Calculations to a Fact

b. Click the Results tab to view the results.

c. Verify 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. Verify 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:

112

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

a. Open the query log. You should see results similar to the following:

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 pictured here). Compare these results to 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 only have to define it 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.

Oracle BI Server Administrator 10g: Build Repositories

113

Lesson 7: Adding Calculations to a Fact

Solutions 7-2 Creating Calculation Measures Using Physical Columns


Answers
7.c. Verify 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. Verify 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.

7.d.

114

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

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 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 shipped. The calculation measures that are created by the wizard are based on existing logical columns. You rename these columns to CutsW and Percent Not Shipped in the Presentation layer. 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 1015 minutes

Scenario

Outcome

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, verify that the Change and Percent Change check boxes are both selected. h. In the Generate Calculations section, verify that Change is highlighted.

Oracle BI Server Administrator 10g: Build Repositories

115

Lesson 7: Adding Calculations to a Fact

i. In the Calculation Name field, enter CutsW. j. Notice 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. Notice the results that are returned when Units Shipped is not available (NULL) or is zero using the following parameters. The picture shows only partial results:

Click Next to open the Check Out Objects window. Review the objects that must be checked out. Click Next. Review the two calculations measures that will be created by the Wizard: CutsW and Percent Not Shipped. r. Click Finish. s. In the Business Model and Mapping layer, verify that there are two new columns created by the Calculation Wizard in the SalesFacts table.

n. o. p. q.

116

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

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. Select 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.

Oracle BI Server Administrator 10g: Build Repositories

117

Lesson 7: Adding Calculations to a Fact

g. Verify your changes:

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

118

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

12. Verify 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. Verify 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 verify that the Percent Not Shipped value is accurate, you would divide CutsW by Units Shipped. For example, for the Lamb food type, you would divide 39 by 961 to get 4.06. This tells you that 4.06% of the units ordered have not shipped. 15. Examine the query log to see what query was sent to the database. Your query results should look similar to the following:

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

Oracle BI Server Administrator 10g: Build Repositories

119

Lesson 7: Adding Calculations to a Fact

b. Notice also 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.

120

Oracle BI Server Administrator 10g: Build Repositories

Lesson 7: Adding Calculations to a Fact

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


Answers
12. Verify 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. Verify 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.

13.

Oracle BI Server Administrator 10g: Build Repositories

121

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Practice 8-1 Creating Dimension Hierarchies


Goal Scenario To create dimensions to introduce hierarchies into the business model 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 drilldown on charts and tables in Answers and dashboards, and to describe the content of aggregate sources. In the Business Model and Mapping layer, there are ProductsDim, CustomersDim, and PeriodsDim dimension objects. 2025 minutes

Outcome

Time

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 (top to bottom): Type, Subtype, Generic, and Specific. b. Typically, a database administrator provides you the columns that define each level. In ABCs case, the columns are:
Level Type Subtype Generic Specific Column on D1_PRODUCTS table that defines the level TYPECODE SUBTYPECODE GENERICDESCRIPTION SPECIFICDESCRIPTIN

c. In the Physical layer, navigate to D1_PRODUCTS.TYPECODE. Notice that there are 21 rows for the Type Code 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.
Oracle BI Server Administrator 10g: Build Repositories 123

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Level Subtype Generic Specific

Column on D1_PRODUCTS table that defines the level Row Count SUBTYPECODE GENERICDESCRIPTION SPECIFICDESCRIPTIN (this spelling is correct) 158 185 191

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. Notice 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, type TotalProduct. c. Because this level represents the grand total for products, select the Grand total level check box. Notice that when you do this, the field Supports rollup to higher level of aggregation is grayed out and protected. d. Notice that the field Number of elements at this level 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. Name the child level Type. c. In the Number of elements at this level field, enter 21. Recall that this is the value you determined above. 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. Verify 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 Subtype Generic Specific Number of elements at this level 158 185 191

g. Verify that your results appear as follows:

124

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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 arent 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 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 onto 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 Subtype SubtypeCode Generic Specific ProductKey Level Subtype Subtype Generic Specific Specific

Oracle BI Server Administrator 10g: Build Repositories

125

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

d. Check your results:

e. f.

g.

h.

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. Double-click the Type column in the Products logical table. The Logical Column properties dialog box opens. 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 into the ProductsDim dimension hierarchy. 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. 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. Select the Keys tab. c. Click the New button. The Logical Level Key dialog box opens. d. Select the check box for Type. e. Verify that the check box Use for drilldown 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.
126 Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

k. Click OK. 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. Verify that the Subtype check box is selected. c. Verify 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. Verify 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 Generic Specific Specific Key Generic Specific ProductKey Use for drilldown Yes Yes 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

Oracle BI Server Administrator 10g: Build Repositories

127

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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, verify 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:

128

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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.
Column Region District Sales Rep Level Region District SalesRep Level Region District SalesRep Key Region District Sales Rep Use for drilldown Yes Yes Yes Yes

k. Create the following keys for each level.

Customers Detail Customer

l. In the Customers Detail level, deselect Use for drilldown for Customer Key (Customers Detail_Key). m. Verify 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 to the next step. 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. However, do not manually enter the number of elements for each level. In a later step, you use the Estimate Levels feature to automatically populate the number of elements at each level of this dimension. You used a manual method to populate the number of elements at each level when you built the ProductsDim and CustomersDim dimensions. The manual method
Oracle BI Server Administrator 10g: Build Repositories 129

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

is sufficient if the number of dimensions and levels is small. However, as the number of dimensions increases, it can be very time consuming to use row counts to determine the values and then enter the values manually for every level. The Estimate Levels feature automates the population of counts for levels in a dimension hierarchy and provides consistency checks for columns in levels and the counts generated for levels. a. Create a dimension hierarchy called PeriodsDim based on the Periods logical dimension table. b. Create the levels within PeriodsDim:
Name Grand Total Level Yes No No No No Supports rollup to higher level of aggregation Protected Yes Yes Yes Yes

TotalPeriod Year Quarter Month Day

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 E:\Labs.
CASE WHEN WHEN ELSE WHEN "ORCL".""."SUPPLIER2"."D1_CALENDAR2"."MONTH_IN_YEAR" < 4 THEN 1 "ORCL".""."SUPPLIER2"."D1_CALENDAR2"."MONTH_IN_YEAR" < 7 THEN 2 "ORCL".""."SUPPLIER2"."D1_CALENDAR2"."MONTH_IN_YEAR" < 10 THEN 3 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 properties dialog box. 14. Add columns to the hierarchy by dragging columns to the PeriodsDim hierarchy levels:
Logical Column Year Quarter Month MonthCode Month in Year Level Year Quarter Month Month Month

130

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Day Date

Day Day

15. Create the keys for each child level in the PeriodsDim dimension. Please note that the key for the Quarter level is set in a subsequent step.
Level Year Month Month Quarter Day Key Year Month MonthCode Quarter Day Use for drilldown Yes Yes No Yes Yes

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.

Oracle BI Server Administrator 10g: Build Repositories

131

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

j. Verify your work. It should look similar to the picture. 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. Use the Estimate Levels feature to populate the level counts in the PeriodsDim dimension. (Please note: The Administration Tool must be in online mode to run Estimate Levels). a. Right-click the PeriodsDim dimension and select Expand All. b. Double-click each of the dimension levels, select the General tab, and verify that the number of elements at each level is set to 1. This is not a required step. You are doing this to compare the changes to the levels after you run Estimate Levels. Some levels may not be set to 1, depending on which method you used to build the hierarchy. If necessary, change the number of elements to 1, check in changes, check consistency, and save the repository. c. Right-click the PeriodsDim dimension and select Estimate Levels. The Estimate Levels process begins.

132

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

d. When Estimate Levels completes, the Estimate Levels dialog box opens and displays the results:

e. Click OK. f. Open each of the levels in PeriodsDim and verify that the number of elements is populated with the correct results. g. Check in changes. h. Check consistency. Fix any errors or warnings before proceeding. i. Close the Consistency Check Manager. j. Save the repository. 23. Open Answers and verify your work: a. Return to Answers. b. Reload server metadata. c. Create the following request:

d. e. f. g.

Click Results. Drill down on 1998 and verify that you can see dollars data by quarter. Drill down on any quarter and verify that you can see dollars data by month. Drill down on any month and verify that you can see dollars data by day.

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

Oracle BI Server Administrator 10g: Build Repositories

133

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Practice 8-2 Creating Level-Based Measures


Goal Scenario To create level-based measures 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. 2025 minutes

Time

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, type 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. Notice that setting the level causes the measure automatically to appear in the ProductsDim dimension.

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


Name ProductTypeDollars Dimension ProductsDim Level Type

134

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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 Format Column button, then click the Data Format tab, override the default data format, and set to Currency, $, Decimal Places = 2, Use 1000s Separator.

Oracle BI Server Administrator 10g: Build Repositories

135

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

e. Click Save > as the system-wide default for SalesFacts.ProductTypeDollars.

f. Click Results. Notice that ProductTypeDollars returns dollars grouped by Type when the query is at a different level than Type; Generic in this example.

136

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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 to the Specific column by default.

9. Leave Answers open.

Oracle BI Server Administrator 10g: Build Repositories

137

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Practice 8-3 Defining Share and Rank Measures


Goals Scenario To define share and rank measures Now that you have created level-based measures, you use them to create a share measure for products and a rank measure. 1530 minutes

Time

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 numExpr.

j. Enter 100* followed by a space. k. Select Logical Tables > SalesFacts > Dollars.

138

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

l. Click Insert.

m. Using the toolbar, click the Division button. Another set of 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 brackets, <<integer>>, and enter 1. This represents the number of digits of precision with which to round. 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. 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.

Oracle BI Server Administrator 10g: Build Repositories

139

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

i. Click Insert.

j. Click OK to close the Expression Builder. k. Verify 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. 6. Check consistency. If there are errors or warnings, correct them before continuing on to the next step. 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.

140

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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 Format Column 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.

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.

Oracle BI Server Administrator 10g: Build Repositories

141

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

Practice 8-4 Creating Dimension-Specific Aggregation Rules


Goal Scenario To create a measure with dimension-specific aggregation rules 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. A new measure called AvgDailyDollars with dimension-specific aggregation rules 510 minutes

Outcome

Time

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 ACTLEXTEND (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.

142

Oracle BI Server Administrator 10g: Build Repositories

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

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 continuing. 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.

Oracle BI Server Administrator 10g: Build Repositories

143

Lesson 8: Creating Dimension Hierarchies and Level-Based Measures

b. Check your results:

c. Considering that there are 25 order days in the first month of 1999, use the Windows calculator to verify that the results of the query are correct for average daily dollars.

144

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

Practice 9-1 Using Aggregate Tables


Goal Scenario To use aggregate tables to speed processing ABC wants to add sources that contain pre-computed 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. 3035 minutes

Time

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 are returning to offline mode in this practice to import tables. 3. Import the physical aggregate tables from the ORCL database into 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 ORCL ODBC data source. c. Enter SUPPLIER2 as the username and password and click OK. The Import dialog box opens. This may take a few moments. d. Scroll to the SUPPLIER2 schema and expand it.
Oracle BI Server Administrator 10g: Build Repositories 145

Lesson 9: Using Aggregates

e. Select the following tables for import: D1_ORDER_AGG1 D1_SALESREPS MONTHS f. Verify that only Tables and Keys are selected and click Import to start the import process. g. When the import process is complete, close the Import dialog box. h. Verify that the aggregate tables are added to the Physical layer of the repository.

4. Update row counts to verify 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

146

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

(PERKEY) levels.

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.
Oracle BI Server Administrator 10g: Build Repositories 147

Lesson 9: Using Aggregates

a. In the Physical layer, use CTRL+click to select the three tables you just imported plus the D1_PRODUCT_TYPE table, and click the Physical Diagram icon in the toolbar. b. Rearrange the tables so they are all 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. Verify 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. Notice that there are now 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 verify 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.

148

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

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. a. Select the Content tab. b. In the Aggregation content, group by field, verify 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 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.

Please note that the name of the detail level for CustomersDim may be different from the
Oracle BI Server Administrator 10g: Build Repositories 149

Lesson 9: Using Aggregates

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 click 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). Use 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, verify that the value is Logical Level.

150

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

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 levels 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 look similar to the 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 look like 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.

Oracle BI Server Administrator 10g: Build Repositories

151

Lesson 9: Using Aggregates

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 continuing. 16. If there are no errors or warnings, close the Consistency Check Manager. 17. Close the repository. Leave the Administration Tool open.

152

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

18. Why dont 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. Verify 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.

Oracle BI Server Administrator 10g: Build Repositories

153

Lesson 9: Using Aggregates

b. Open the log file and inspect the query.

c. Notice 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. Notice that the detail fact table, D1_ORDERS2, and the detail dimension table, D1_CUSTOMER2, are accessed instead of the aggregate tables. Why is this?

154

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

Solutions 9-1 Using Aggregate Tables


Answers
18. Why dont you need to change the Presentation layer? You made changes in the business model that impact how the queries are processed and which sources will be accessed. The user interface remains the same, so there is no need to change the Presentation layer. It will automatically use the new sources. Notice 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. Notice 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.

22.c.

23.c.

Oracle BI Server Administrator 10g: Build Repositories

155

Lesson 9: Using Aggregates

Practice 9-2 Using the Aggregate Persistence Wizard


Goal Scenario To use the Aggregate Persistence Wizard to automate the creation of aggregate tables and their corresponding objects in the repository 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. 2030 minutes

Time

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 verify 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.

156

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

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 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.

Oracle BI Server Administrator 10g: Build Repositories

157

Lesson 9: Using Aggregates

o. In the Aggregate table name field, accept the default name ag_SalesFacts for the aggregate table name.

p. Click Next.

158

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

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. Click 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 E:\OracleBI\server\Repository and verify that the CREATE_AGG.sql script file was generated. 2. Examine the aggregate parameters in the NQSConfig.ini file. a. Navigate to E:\OracleBI\server\Config and open NQSConfig.ini. b. In the General section, notice 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.
Oracle BI Server Administrator 10g: Build Repositories 159

Lesson 9: Using Aggregates

c. d. e. f. g. h. i.

Double-click Administrator in the right pane to open the User dialog box. Type Administrator in the Password and Confirm Password fields. Click OK. Select Action > Close to close the Security Manager. Check in changes. Save the repository. 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:

b. c. d. e. f. g. h.

The file has the following format: nqcmd Oracle BI Server command utility -d Oracle BI Server data source name -u repository user name -p repository password -s path to the create aggregate SQL script Save the file as E:\OracleBI\server\Repository\create_agg.bat. Close the file. Verify that the Oracle BI Server service is started. Oracle BI Server must be running to create the aggregates. Open the command prompt. In the command prompt window, navigate to E:\OracleBI\server\Repository and run create_agg.bat. Verify that you receive the message Statement execute succeeded. Close the command prompt window.

5. Verify that the aggregates are created in the Physical layer of the repository. a. Open the ABC repository in online mode as Administrator with password Administrator. b. In the Physical layer, verify that the aggregates were created in the SUPPLIER2 schema. There should be one new ag_SalesFacts aggregate and three new dimension aggregates in

160

Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

the Physical layer. Your results should look similar to the picture.

c. Update row counts for the new aggregates to verify 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, select the Foreign Keys tab, and verify 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. Verify 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 verify 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 verify that the ag_SalesFacts logical table source maps to the ag_SalesFacts physical table. d. Click the Column Mapping tab and verify 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.

Oracle BI Server Administrator 10g: Build Repositories

161

Lesson 9: Using Aggregates

e. Click the Content tab and verify that the logical levels are set correctly.

f. g. h. i. j.

Click Cancel to close the ag_SalesFacts Logical Table Source dialog box. Check in changes. Check global consistency. Fix any errors or warnings before continuing. If there are no errors or warnings, close the Consistency Check Manager. Save the repository.

7. Verify 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. Verify that SUPPLIER2 is entered as the schema name, and click Go. f. Verify 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. Select 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 verify 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 proceeding. 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 password Administrator. c. Reload server metadata.
162 Oracle BI Server Administrator 10g: Build Repositories

Lesson 9: Using Aggregates

d. Create and run the following query:

10. Inspect the query log and verify that the query used the ag_SalesFacts aggregate table and the related SalesRep dimension aggregate. Your file should look similar to the screenshot.

11. Reverse some of your changes to the repository for the remaining lessons. The purpose of this practice was to illustrate how to use the Aggregate Persistence Wizard as a method for creating 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. Select 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. Select 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.
Oracle BI Server Administrator 10g: Build Repositories 163

Lesson 9: Using Aggregates

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 picture.

k. l. m. n. o.

Check in changes. Check global consistency. Fix any errors or warnings before proceeding. Close the Consistency Check Manager. Save the repository. Leave the Administration Tool open.

164

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

Practice 10-1 Modeling a Value-Based Partition


Goal Scenario To model a value-based partition ABC wants to implement separate partitions for customer data. One partition will store data for customers AM, the other will store data for customers NZ. 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 1520 minutes

Outcome

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 password Administrator. 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. Notice 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. Notice 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.
Oracle BI Server Administrator 10g: Build Repositories 165

Lesson 10: Using Partitions and Fragments

f. Click Add next to Presentation Server Administrators to give this group explicit access to this privilege.

g. Click Finished to close the Change Privilege Permissions screen. Notice 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 screen. 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. z. Enter the following SQL in the SQL Statement field: SELECT COUNT(*) FROM D1_custNtoZ
166 Oracle BI Server Administrator 10g: Build Repositories
.

Lesson 10: Using Partitions and Fragments

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 ORCL data source. c. Enter SUPPLIER2 as User Name and Password and click OK. d. In the Import dialog box, expand the SUPPLIER2 schema. e. Use Ctrl+click to select the D1_CUSTATOM and the D1_CUSTNTOZ tables. f. Click Import. g. When the import process completes, close the Import dialog box. h. Verify the two new tables are visible in the Physical layer. i. Check in changes. j. Update row counts for the two new tables to verify 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. In 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 select 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.

Oracle BI Server Administrator 10g: Build Repositories

167

Lesson 10: Using Partitions and Fragments

f. Click the less than sign < 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.
168 Oracle BI Server Administrator 10g: Build Repositories
.

Lesson 10: Using Partitions and Fragments

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 select the Content tab. 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 type 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, selecting the General tab, and deselecting the Active flag. v. Click OK. w. Notice that you did not have to change the Presentation layer. 7. Check in changes. 8. Check consistency. Fix any errors or warnings before continuing. 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 select the Results tab. d. Click the All Pages button to see all records.
Oracle BI Server Administrator 10g: Build Repositories 169

Lesson 10: Using Partitions and Fragments

e. Compare your results to those in step 1. There should not be any difference. The query returns 134 customer records. 12. Verify that the query being issued is accessing your new tables. a. Open the query log. b. Verify 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 >= 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. Verify that your result displays only names starting with N and above.

d. Open the query log and verify that the query being issued is accessing the correct partition, D1_CUSTNTOZ, for the Customer data.

170

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

e. Close the log file. 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. Verify that your result displays only names less than N.

d. Open the query log and verify that the query being issued is accessing the correct partition, D1_CUSTATOM, for the Customer data.

e. Close the log file.

Oracle BI Server Administrator 10g: Build Repositories

171

Lesson 10: Using Partitions and Fragments

Solutions 10-1 Modeling a Value-Based Partition


Answers
1.d. 1.f. Record the name of the first customer in the list: 2nd & Goal Sports Cafe Record the total number of customers in the list: 134

172

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

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 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. 1015 minutes

Scenario

Time

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. Type xls_quota for the data source name. f. Click Select Workbook. g. Navigate to E:\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 the Administrator user name, no password. d. Click OK. The Import dialog box opens. e. Expand E:\Labs\quota. f. Select and import the following tables: Item Types Quarters Regions regiontypequota g. Close the Import dialog box.
Oracle BI Server Administrator 10g: Build Repositories 173

Lesson 10: Using Partitions and Fragments

3. Because Excel has limited data types, verify 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: Use CTRL+click to create the multicolumn join for the Quarters columns or enter the

174

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

join expression in the Expression edit field:

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 just created. This automatically creates a new regiontypequota logical table source.
Oracle BI Server Administrator 10g: Build Repositories 175

Lesson 10: Using Partitions and Fragments

7. Specify the content for the new regiontypequota logical table source in 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 into 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.

176

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

It is good 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 continuing. 13. Close the Consistency Check Manager. 14. Save the repository and leave it open for the next practice.

Oracle BI Server Administrator 10g: Build Repositories

177

Lesson 10: Using Partitions and Fragments

Practice 10-3 Using the Calculation Wizard to Create Derived Measures

Goals

To utilize the Administration Tool Calculation Wizard to create derived measures Use the Calculation Wizard to create two derived measures: Variance from Quota and Percent of Quota. 510 minutes

Scenario

Time

Instructions:
15. 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. Verify 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 to Percent of Quota. The calculation wizard will write the correct formula for each measure, handling the cases of NULL and zero

178

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

values according to the default.

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. 16. Check in changes. 17. Check consistency. Fix any errors or warnings before continuing. 18. Close the Consistency Check Manager. 19. Save and close the repository. 20. Return to Answers, reload server metadata, and run the following query and filter:

Oracle BI Server Administrator 10g: Build Repositories

179

Lesson 10: Using Partitions and Fragments

21. Check your results. In the screenshot, the columns have been formatted.

22. 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.

23. Close the query log.

180

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

Practice 10-4 Modeling Fragmented Inventory Data


Goal Scenario To create a business model for fragmented inventory data ABCs inventory data is fragmented, meaning that 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. 1520 minutes

Time

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 ORCL data source. c. Enter SUPPLIER2 as the username and password and click OK. The Import dialog box opens. This may take a few moments. d. Scroll to and expand the SUPPLIER2 schema. e. Select the following tables for import:

f. Verify that Tables and Keys are selected. g. Select Foreign Keys. Note that this is different from earlier practices where only Tables and Keys were selected.
Oracle BI Server Administrator 10g: Build Repositories 181

Lesson 10: Using Partitions and Fragments

h. Click Yes to proceed when warned about importing foreign keys with Oracle databases. i. Click Import. The import process starts. Because you are importing foreign keys, this may take a while. j. When importing is complete, close the Import dialog box. k. Verify that the new tables are added to the Physical layer. on the l. Select all of the newly imported tables and click the Physical Diagram button 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 look similar to this:

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. m. Close the Physical Diagram. n. Update row counts to verify connectivity. o. 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 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.
182 Oracle BI Server Administrator 10g: Build Repositories
.

Lesson 10: Using Partitions and Fragments

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, 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, instead of one at a time. 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 you are done:

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 BOH_DLL EOH_DLL New Name Beginning Inventory Dollars Ending Inventory Dollars

Oracle BI Server Administrator 10g: Build Repositories

183

Lesson 10: Using Partitions and Fragments

BOH_QTY EOH_QTY

Beginning Inventory Quantity Ending Inventory Quantity

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 continuing. 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.
184 Oracle BI Server Administrator 10g: Build Repositories
.

Lesson 10: Using Partitions and Fragments

11. Save the repository. Do not check consistency again. 12. Create three dimensions in the Inventory business model. You need the dimensions because the inventory measures are semi-additive, 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 screenshots as a guide.

Oracle BI Server Administrator 10g: Build Repositories

185

Lesson 10: Using Partitions and Fragments

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 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. Note also that the fragmentation content is specified in terms of the logical columns from the dimension table. That is, it uses the values

186

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

that a user is likely to include in a query filter.

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 verify fragmentation content. a. Select Tools > Query Repository. b. In the Type field, select Logical Table Source.
Oracle BI Server Administrator 10g: Build Repositories 187

Lesson 10: Using Partitions and Fragments

c. Click the Filter button. d. In the Item field, select Has fragmentation. Verify 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.

188

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

16. Modify the Presentation layer to look like this:

17. Check Global Consistency. Fix any error or warning messages before continuing. 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

Oracle BI Server Administrator 10g: Build Repositories

189

Lesson 10: Using Partitions and Fragments

source specified fragmentation content that included QUARTER_ID = 200501.

h. Close the query log. i. Create another query and filter:

j. Click Results.

190

Oracle BI Server Administrator 10g: Build Repositories

Lesson 10: Using Partitions and Fragments

k. Examine the query log. Note that there are now four query blocks, one for each logical table source that specified fragmentation content that included YEAR_ID = 2005. Note also 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 picture shows a portion of the query log SQL.

l. Close the query log.

Oracle BI Server Administrator 10g: Build Repositories

191

Lesson 11: Using Repository Variables

Practice 11-1 Creating Dynamic Repository Variables


Goal Scenario To create and use a dynamic repository variables ABC has implemented separate partitions for customer data. However, when the partitions get reloaded, 50% of the data will be loaded into the first partition and 50% of the data will be loaded 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. New initialization block, CustomerDataSplit, is created with EndPartOne variable. In the Business Model and Mapping layer, sources for the Customers logical table are modified. Time 1015 minutes

Outcome

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.

Oracle BI Server Administrator 10g: Build Repositories

193

Lesson 11: Using Repository Variables

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.

194

Oracle BI Server Administrator 10g: Build Repositories

Lesson 11: Using Repository Variables

d. Enter A in the Default initializer section:

e. f. g. h.

Click OK to close the Dynamic Repository Variable dialog box. Click OK to close the Repository Variable Init Block Variable Target dialog box. Click Edit Data Source. Click Test to test the variable and verify your results:

i. Click Close. j. Click OK to close the Repository Variable Init Block Variable Target dialog box.

Oracle BI Server Administrator 10g: Build Repositories

195

Lesson 11: Using Repository Variables

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. c. Select the General tab and verify that the source is inactive (Active is not checked). d. Click OK. e. Double-click D1_CUSTATOM. f. Click the General tab. g. In the Name field, enter CustPartOne. h. Verify that Active is selected. i. Select 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.

196

Oracle BI Server Administrator 10g: Build Repositories

Lesson 11: Using Repository Variables

o. Check your result:

p. Verify 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. Verify that Active is selected. v. Select the Content tab. w. Open the Expression Builder. x. Remove >= N from the expression. 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.

Oracle BI Server Administrator 10g: Build Repositories

197

Lesson 11: Using Repository Variables

bb. Check your result:

cc. Verify that the This source should be combined with other sources at this level check box is checked. 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 any error or warning messages before proceeding. 7. Close the Consistency Check Manager. 8. Save and close the repository. 9. Test your results. a. Restart the Oracle BI Server service. b. Navigate to E:\OracleBI\server\log and open NQQuery.log.

198

Oracle BI Server Administrator 10g: Build Repositories

Lesson 11: Using Repository Variables

c. Scroll to the end of the file to locate the query issued by the initialization block:

d. e. f. g. h.

Close the log file. Return to Answers. Reload server metadata. Use the SupplierSales subject area and create a request with Customers.Customer. Add a filter for customer names less than B:

i. Run the query and verify that your results display names starting less than B:

j. Select Settings > Administration > Manage Sessions > View Log to open the query log. k. Verify that the D1_CUSTATOM table is being used:

l. Close the log file.


Oracle BI Server Administrator 10g: Build Repositories 199

Lesson 11: Using Repository Variables

10. Further test your results. a. Return to Answers and change the filter to provide names greater than X. b. Run the query and verify the results:

c. Verify 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. Select the General tab, select the Active check box, and click OK. e. Double-click the CustPartOne logical table source. f. Select the General tab, deselect the Active check box, and click OK. g. Double-click the CustPartTwo logical table source. h. Select 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.

200

Oracle BI Server Administrator 10g: Build Repositories

Lesson 11: Using Repository Variables

Practice 11-2 Using Dynamic Repository Variables As Filters


Goal Scenario To create and use dynamic repository variables as filters Rather than creating hard-coded column filters like Year = 1999 in Answers requests, ABC would like 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. New initialization block, Current Periods, and three new dynamic repository variables, CurrentYear, CurrentMonth, and CurrentDay are created. 1015 minutes

Outcome

Time

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.

Oracle BI Server Administrator 10g: Build Repositories

201

Lesson 11: Using Repository Variables

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 variable CurrentDay. The value of the second column, MONTHCODE, is assigned to the second variable, CurrentMonth, and the value of the third column, YEAR, is assigned to the third variable, CurrentYear. 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.

202

Oracle BI Server Administrator 10g: Build Repositories

Lesson 11: Using Repository Variables

f. Click the Test button and verify the results:

g. h. i. j.

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. Click Close the close the Results window. Click OK to close the Repository Variable Init Block Data Source dialog box. Click OK to close the Repository Variable Init Block dialog box. 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.

Oracle BI Server Administrator 10g: Build Repositories

203

Lesson 11: Using Repository Variables

f. In the Server Variable field, type CurrentYear to add a filter for the Year column using the CurrentYear repository variable.

g. Click OK. h. Click Results and verify that only data for the current year (1999 based on this data set) is returned.

i. Check the query log. Notice that the logical request filters for the variable (you may need to scroll to the right): j. Close the log file.

204

Oracle BI Server Administrator 10g: Build Repositories

Lesson 12: Modeling Time Series Data

Practice 12-1 Creating Time Series Comparison Measures


Goal To create Month time comparison measures using the Ago and ToDate functions You use the Oracle BI Ago and ToDate functions to create new measures and calculations to enable users to compare dollar performance a month ago and calculate the dollar change, the percent 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. 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

Scenario

Outcome

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 comparisons over time straightforward: 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.
Oracle BI Server Administrator 10g: Build Repositories 205

Lesson 12: Modeling Time Series Data

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 Use existing logical columns as the source. 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 the first <<expr>> in the expression. h. Select Logical Tables > Sales Facts and then double-click Dollars to add it to the expression. i. Click the second <<expr>>. j. Select Time Dimensions > PeriodsDim and then double-click Month to add it to the expression. k. Click <<integer>> and type 1. The Ago function calculates the Dollars value one month prior to 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 Use existing logical columns as the source.
206 Oracle BI Server Administrator 10g: Build Repositories
.

Lesson 12: Modeling Time Series Data

d. e. f. g. h. i.

Open the Expression Builder. Select Logical Tables > Sales Facts and then double-click Dollars to add it to the expression. Insert a minus sign. Select Logical Tables > Sales Facts and then double-click Month Ago Dollars. Click OK to close the Expression Builder. 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 percent 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 Use existing logical columns as the source. 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.

Oracle BI Server Administrator 10g: Build Repositories

207

Lesson 12: Modeling Time Series Data

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 Use existing logical columns as the source. d. Open the Expression Builder. e. Select Functions > Time Series Functions and double-click ToDate to insert the expression. f. Click the first <<expr>>. g. Select Logical Tables > Sales Facts and then double-click Dollars. h. Click the second <<expr>>. i. Select Time Dimensions > PeriodsDim and the double-click Year. j. Click OK to close the Expression Builder. k. Check your work:

l. Click OK to close the Logical Column dialog box. m. Drag the Year To Date Dollars logical column to the SalesFacts presentation folder.
208 Oracle BI Server Administrator 10g: Build Repositories
.

Lesson 12: Modeling Time Series Data

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 verify this later in this practice. e. Click OK to close the logical column dialog box. 9. Check in changes. 10. Check consistency. Fix any errors or warnings before proceeding. 11. Close the Consistency Check Manager. 12. Save and the repository. 13. Verify your work in Answers. a. Return to Answers. b. Reload server metadata. c. Create the following query and filter:

Please note: Use Ctrl+click to add the Year filter or remove Year from the query criteria after the filter is set. d. Click Results.

e. Notice that Month is sorted automatically based on the MonthCode sort order column you set in the repository.
Oracle BI Server Administrator 10g: Build Repositories 209

Lesson 13: Security

Practice 13-1 Creating Users and Groups


Goal To set up user access so that Oracle BI Server can authenticate users and assign them appropriate permissions 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. Once you have created these users, you assign them to the appropriate group. 1015 minutes

Scenario

Time

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 Full Name Password Logging level SWRIGHT Sara Wright <Blank> 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 PSMITH RMIND JCRAFT MWEST JMEYER Full Name Paul Smith Rob Mind Jen Craft Mary West Jacob Meyer Logging Level 0 0 0 2 2

Oracle BI Server Administrator 10g: Build Repositories

211

Lesson 13: Security

4. In the Security Manager window, verify 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. Use CTRL+click to select SWRIGHT and PSMITH. e. Click OK. Wright and Smith are now part of the SalesManagers group. f. Click OK to close the Group dialog box. 6. Repeat this process and create the following two groups and assign users to the groups:
Group Name SalesUsers SalesHR Add User RMIND, JCRAFT JMEYER

7. Assign MWEST to the Administrators group. One user, Administrator, and one group, Administrators, are created automatically when a repository is created. The Administrator user belongs automatically to the Administrators group. The Administrator user cannot be deleted, nor can it be 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. At this point, the group and user structure resembles the following:
SalesManagers Group SWRIGHT PSMITH SalesUsers Group RMIND JCRAFT SalesHR Group JMEYER Administrators Group Administrator MWEST

8. Select Action > Close to close Security Manager.

212

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

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 Meyers access to this object. a. In the Presentation layer, double-click SupplierSales. b. Select the General tab. c. Click the Permissions button. d. Notice that by default Everyone has read permission for this object. e. Click Show all users/groups. f. Click 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 continuing. 12. Save the repository.

Oracle BI Server Administrator 10g: Build Repositories

213

Lesson 13: Security

13. With your changes now saved, log in as the new users and examine the impact of the permissions you set. a. Return to Answers, log out, and then log back in as MWEST, no password. b. Click the Dashboards link and make sure you can see Welcome, Mary West! to verify 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 notice that Mary has access to all the same objects as the Administrator user: Customers, Periods, Products, Facts, SalesFacts, and so forth. 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. i. Does the SupplierSales subject area display?

j. Why is this?

k. Log out of Oracle BI. 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 E:\OracleBI\server\Config and open the NQSConfig.ini file. b. Scroll to the SECURITY section. c. Note that DEFAULT_PRIVILEGES is set to READ.

214

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

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 are leaving DEFAULT_PRIVILEGES set to READ. If you had changed the default for DEFAULT_PRIVILEGES, it would only impact new objects after the NQSConfig.ini file was saved and Oracle BI Server was restarted. The status of permission for Everyone in existing objects would not be affected.

Oracle BI Server Administrator 10g: Build Repositories

215

Lesson 13: Security

Solutions 13-1 Creating Users and Groups


Answers
9.g. 9.h. Do the remaining users have read access? Yes 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 has a check mark, all members inherit this permission, unless the member is explicitly denied access. What subject areas are available to Mary? SupplierSales, SupplierSalesDM, Inventory Does the SupplierSales subject area display? No Why is this? The SupplierSales subject area does not appear because you explicitly denied read access to JMEYER.

13.d. 13.i. 13.j.

216

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

Practice 13-2 Assigning Permissions to Users and Groups


Goal To set up security access so Oracle BI Server can authenticate groups and assign group members appropriate permissions 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 affect this has on Jacob Meyer. Lastly, you add Jacob Meyer to another group and examine how this affects his access. Defined permissions for users and groups 1015 minutes

Scenario

Outcome Time

Instructions:
1. In this step, you modify user and group permissions for the SupplierSales presentation catalog. a. Return to the ABC repository, 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 JMEYERs explicit access restrictions from the SupplierSales presentation catalog, is he able to execute query requests against it in Answers? Explain.

Oracle BI Server Administrator 10g: Build Repositories

217

Lesson 13: Security

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 the 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 thus far, will JMEYER be able to access the SupplierSales presentation catalog?

6. Verify 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.
218 Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

d. Log back in as JMEYER with no password. 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 the changes and save the repository. 9. Log in to Oracle BI as Administrator and reload the server metadata. 10. Verify Meyers 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.

Oracle BI Server Administrator 10g: Build Repositories

219

Lesson 13: Security

Solutions 13-2 Assigning Permissions to Users


Answers
1.d. Now that you have removed JMEYERs 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. With the changes you have made thus far, will JMEYER be able to access the SupplierSales data? No Does JMEYER have access to the SupplierSales subject area now? No Why or why not? JMEYER is a member of the SalesHR group, which is explicitly denied. 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. Does JMEYER have access to the SupplierSales subject area now? Yes 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.

5.

6.e. 6.f.

10.b. 10.c.

220

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

Practice 13-3 Authenticating Using an External Database


Goal Scenario To authenticate users using an external database 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 for you 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 could 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 will retrieve this data. External database of login information used for authenticating users 1520 minutes

Outcome Time

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 user name or password was entered. At the conclusion 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 ORCL ODBC data source. c. Enter SUPPLIER2 as the username and password and click OK. The Import dialog box opens. This may take a few moments. d. Expand the SUPPLIER2 schema and select SECURITYTABLE. e. Click Import. f. When import completes, close the Import dialog box. g. Verify that SECURITYTABLE is added to SUPPLIER2 in the Physical layer. h. Check in changes.

Oracle BI Server Administrator 10g: Build Repositories

221

Lesson 13: Security

i. 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. You already created SalesRep as a group in an earlier practice. 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. j. 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, type Security. e. Click Edit Data Source. f. In the Default Initialization String field, create an initialization string that populates group, user name, 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:
222 Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

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 users 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 authenticated and session variables are populated. g. h. i. j. Click Browse. Double-click the SUPPLIER CP connection pool to select it. Click OK to close the Session Variable Initialization Block Data Source dialog box. Verify that your initialization block now 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.
Oracle BI Server Administrator 10g: Build Repositories 223

Lesson 13: Security

6. Check in changes. 7. Save the repository. 8. Verify your work. a. Return to Oracle BI and log in as AJOHNSON, with password aj. b. Click the Dashboards link. c. Verify that the greeting Welcome, ANN JOHNSON! appears to the left of the Dashboards link. This confirms that the external database was used to authenticate a user during login. d. Log out of Oracle BI.

224

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

Practice 13-4 Authenticating Users with Database Authentication


Goals Scenario To authenticate users using database authentication As an additional option, Oracle BI Server can authenticate users through database login names. If a user has read permission on a specified database, the user will be trusted by Oracle BI Server. To authenticate users with this method, you have to maintain a list of users in the repository. So for large deployments, this is typically not a good option. 1520 minutes

Time

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. Verify that the call interface is set to Default (OCI 10g). h. Enter :USER in the User name field. i. Enter :PASSWORD in the Password field.

Oracle BI Server Administrator 10g: Build Repositories

225

Lesson 13: Security

j. Enter ORCL in the data source name field.

k. l. m. n.

Click OK to close the Connection Pool dialog box. Enter :PASSWORD to confirm the password and click OK. Click OK to close the Database dialog box. Verify 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 empty. 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.
226 Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

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 Unlocked. 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 E:\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. b. Verify that you can log in to Oracle BI as user SH, with password SH. c. Click the Dashboards link and verify 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.
Oracle BI Server Administrator 10g: Build Repositories 227

Lesson 13: Security

b. c. d. e.

Navigate to E:\OracleBI\Server\Config. Open NQSConfig.ini. Scroll to the SECURITY section. 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 do database authentication. If external database table authentication fails, then the server performs database authentication.

228

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

Practice 13-5 Setting Query Limits and Timing Restrictions


Goals To disallow queries that may consume too much of the system resources by setting query limits 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. Set the maximum rows of any query to five rows, the maximum time of any query to 1 minute, and restrict access to a database on Sunday from 12:00 a.m. to 7:00 a.m. 1015 minutes

Scenario

Outcome

Time

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 that users can access specified repository resources from midnight Sunday to 7:00 a.m. Sunday: a. Click the button in the Restrict column of the ORCL database.
Oracle BI Server Administrator 10g: Build Repositories 229

Lesson 13: Security

b. Highlight the blocks from Sunday at midnight to 7 AM Sunday. Hint: With the first block selected press the SHIFT key and select the 7 AM block, or click the first box and drag to the 7 AM block. c. Click Disallow.

d. e. f. g. h. i.

If a time period is not highlighted, 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. Click OK to close the Restrictions dialog box. Click OK to close the User/Group Permissions dialog box. Click OK to close the Group dialog box. Close Security Manager. Check in the changes. Save the repository.

4. Log in to Oracle BI as Administrator and register your changes on the server by reloading the server metadata. 5. Verify 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?

230

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

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 inactivate the query restriction you just created. a. Open the Security Manager. b. Double-click the SalesManagers group. c. Click the Permissions button. d. Select 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 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?

9. Log out of Oracle BI.

Oracle BI Server Administrator 10g: Build Repositories

231

Lesson 13: Security

Solutions 13-5 Setting Query Limits and Timing Restrictions


Answers
5.e. 5.f. Did the results of the query display? No 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. Did the results display? Yes Why it this? Because the query returned only five rows, which does not exceed the maximum query restricting rows from the database. What are the results now? 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.

5.i. 5.j.

8.e.

232

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

Practice 13-6 Setting Filters to Personalize Information


Goals To set up filters to personalize the information a user gets when the user enters a query 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, not all customers 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. 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. 1015 minutes

Scenario

Outcome

Time

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 named Rib Pit, no password, 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.

Oracle BI Server Administrator 10g: Build Repositories

233

Lesson 13: Security

g. Set the following filter: "SupplierSales"."Customers"."Customer" = 'Rib Pit'

h. Click OK and the filter is added to the Filters tab.

i. j. k. l. m.

Click OK to close the User/Group Permissions dialog box. Click OK to close the User dialog box. Close the Security Manager. Check in changes. Save the repository.

3. Test your work a. Log in to Oracle BI as Rib Pit, no password. b. Click Supplier Sales. c. Create the following query using only the Customers folder:

d. Click Results.

e. Navigate to E:\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

234

Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

for the Rib Pit user. Note that the filter is applied in the WHERE clause.

f. Close the log file. g. Run another query:

h. Check the query log. Notice 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. Open the Rib Pit user. c. Click the Permissions button. d. Click the Filters tab.
Oracle BI Server Administrator 10g: Build Repositories 235

Lesson 13: Security

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. k. l. m. n.

Click OK to close the User/Group Permissions dialog box. Click OK to close the User dialog box. Close the Security Manager. Check in changes. Save the repository.

5. Test your work. a. Log out of Oracle BI and log back in as Rib Pit, no password. b. Run the following query:

c. Check the query log. Notice that this time the Name = Rib Pit filter is applied to the results. Only 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.
236 Oracle BI Server Administrator 10g: Build Repositories

Lesson 13: Security

a. b. c. d. e. f.

Open the Security Manager. Create a new SalesRep group. Recall that this is the group in SECURITYTABLE. Click the Permissions button. Click the Filters tab. Click Add. 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 session variable DISPLAYNAME. 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. k. l. m. n.

Click OK to close the User/Group Permission dialog box. Click OK to close the Group dialog box. Close the Security Manager. Check in changes. Save the repository.
Oracle BI Server Administrator 10g: Build Repositories 237

Lesson 13: Security

7. Test your work. a. Log in to Oracle BI as TBELL, with password tb. b. Click the Dashboards link and verify there is a Welcome, Tracie Bell message. c. Create the following request:

d. Click Results. Notice 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.

238

Oracle BI Server Administrator 10g: Build Repositories

Lesson 14: Cache Management

Practice 14-1 Inspecting Cache Files


Goals Scenario To create a query request and inspect cache entries using the Cache Manager You create a request in Answers and verify that a cache entry was created in the Cache Manager and that a cache file was created. You create the same request again and verify that the results were fulfilled by the cache and not the database. 1520 minutes

Time

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 E:\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, no password. b. Click the SupplierSales subject area. c. Create the following request:

Oracle BI Server Administrator 10g: Build Repositories

239

Lesson 14: Cache Management

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 verify 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. Select 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. h. With this entry still selected, scroll to the Created and Last used columns. Are the values for these fields the same?
240 Oracle BI Server Administrator 10g: Build Repositories

Lesson 14: Cache Management

i. Record the values for these two fields.

j. Do you think that the results for the query you created were satisfied from an existing cache entry or were returned directly from the database?

k. Close the Cache Manager. 8. Inspect the cache file and verify 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 E:\OracleBIData\cache. The file in this directory is the cache file that resulted from your query. b. Verify 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, no password. b. Create the same request you created earlier and inspect the results:

c. Do you think the request was satisfied by the database or by a cache? Explain.

10. Examine the cache hit in the log file. a. Open the query log.

Oracle BI Server Administrator 10g: Build Repositories

241

Lesson 14: Cache Management

b. Verify that you see a Cache Hit on query entry for the query initiated by JMEYER.

c. Notice 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 JMEYERs 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 MWESTs cache entry changed? Explain.

d. Close the Cache Manager. e. Navigate to E:\OracleBIData\cache. f. Notice that there is no new cache file created as a result of JMEYERs request. Thus, JMEYERs request was satisfied by an existing cache entry.

242

Oracle BI Server Administrator 10g: Build Repositories

Lesson 14: Cache Management

Solutions 14-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. With this entry still selected, scroll to the Created and Last used columns. Are the values for these fields the same? Yes Do you think that the results for the query you created were satisfied from an existing cache or were returned directly from the database? Results for this query were returned directly from the database. Because both Created time and Last Used time are the same, this is the first time this query has been requested. Thus, no cache file existed for this query until now. Do you think the request was satisfied by the database or by a cache? Explain. JMEYERs query was fulfilled by the cache that resulted from MWESTs query earlier. Because JMEYERs request was identical to the cache, the server used the cache (cache hit) instead of processing against the database. Are there any entries listed with JMEYER as the user? No Has the Last used date for MWESTs cache entry changed? Explain. Yes, because JMEYERs query used this cache to satisfy his request and the last used date was updated to reflect this.

7.h.

7.j.

9.c.

11.b. 11.c.

Oracle BI Server Administrator 10g: Build Repositories

243

Lesson 14: Cache Management

Practice 14-2 Modifying Cache Parameters


Goal Scenario To modify cache parameters in the NQSConfig file You use the Cache Manager to inspect the cache parameters. You 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 non-cacheable. A decrease in the number of rows per cache as well as a decrease in the number of cache entries allowed 1015 minutes

Outcome

Time

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 is met, a cache hit will not occur.

3. True or false: Cache files are stored in the E:\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 would you need to indicate this?

244

Oracle BI Server Administrator 10g: Build Repositories

Lesson 14: Cache Management

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 E:\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 verify that changes are applied. Your results should resemble the following:

Oracle BI Server Administrator 10g: Build Repositories

245

Lesson 14: Cache Management

e. Click OK. f. Close the Cache Manager. 9. Make certain tables non-cacheable, meaning that 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, no password. b. Create the following request using columns from the SupplierSales subject area:

c. d. e. f.

Click Results. Log out of Oracle BI. Return to the Administration Tool and open the Cache Manager. 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, 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.
246 Oracle BI Server Administrator 10g: Build Repositories

Lesson 14: Cache Management

f. Verify 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. Verify 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.
Oracle BI Server Administrator 10g: Build Repositories 247

Lesson 14: Cache Management

b. c. d. e.

f. g. h. i. j.

Click OK to confirm cache purge. Click the Physical tab at the bottom of the left pane. Expand ORCL > Supplier2. 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. Select Edit > Purge. Click OK to confirm cache purge. Click the Cache tab at the bottom of the left pane. Confirm that the MWEST cache entry is deleted. Close the Cache Manager.

248

Oracle BI Server Administrator 10g: Build Repositories

Lesson 14: Cache Management

Solutions 14-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 True or false: There is a list of criteria that can qualify a cache hit. If all but one of these conditions is met, a cache hit will not occur. True True or false: Cache files are stored in the E:\OracleBIData\cache directory. True True or false: Cache files can be stored anywhere. True, cache files can be stored anywhere, even on a separate machine. 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. Number of entries currently in cache: 1 Maximum allowable number of entries in cache: 1,000 Maximum allowable number of rows per cache entry result set: 100,000 Do you see an entry for the request you just created? No

2.

3. 4. 5.

6.d. 6.e. 6.f. 10.f.

Oracle BI Server Administrator 10g: Build Repositories

249

Lesson 15: Using the Multi-User Development Environment

Practice 15-1 Setting Up a Multi-User Environment


Goal Scenario To set up a multi-user development environment to support two developers ABC is accustomed to using 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. 1015 minutes

Time

Instructions:
1. Modify two users, MWEST and JMEYER, to give them administrative privileges so they can act as developers. As a security precaution, reset their passwords so they need to communicate with you before commencing with development. a. Close the ABC repository open in online mode. b. Stop the Oracle BI Server service. c. Open the ABC repository in offline mode as Administrator, with password Administrator. d. Select Manage > Security. e. Select 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. Select 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. Verify 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. c. Select the ABC repository.
Oracle BI Server Administrator 10g: Build Repositories 251

Lesson 15: Using the Multi-User Development Environment

d. Click Open. Note that you can only open the file 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 exactly what changes were made after multi-user development is established by comparing the shared repository to the original master. Normally, you create projects to contain all of 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. Notice that a Catalogs folder appears in the right pane. h. Expand Catalogs in the right pane. Notice that the Inventory presentation catalog is automatically included in the project. i. Expand Inventory in the right pane. Verify that Inventory.Inventory Facts has been included in this project as well. j. Expand the Users folder in the left pane. k. Use Ctrl+click to 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 verify that the three users are added to the project. n. Check your work:

252

Oracle BI Server Administrator 10g: Build Repositories

Lesson 15: Using the Multi-User Development Environment

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. Notice that a Catalogs folder appears in the right pane. e. Expand Catalogs in the right pane. Notice that the Inventory presentation catalog has been added to the project. f. Expand Inventory in the right pane. Verify that Inventory.Inventory Facts has been included in this project as well. g. Add the Administrator, MWEST, and JMEYER users to the project. 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.
Oracle BI Server Administrator 10g: Build Repositories 253

Lesson 15: Using the Multi-User Development Environment

a. b. c. d. e. f. g. h. i. j.

Open Windows Explorer. Select the ORACLE (E:) root directory. Right-click in the right pane and select New > Folder. Name the new folder RPD. Right-click the RPD folder and select Sharing. In the RPD Properties dialog box, select Share this folder. Click Apply. Click OK. Notice the hand icon that indicates this is now a shared directory. Copy ABC.rpd from E:\OracleBI\server\Repository to the E:\RPD folder. Rename the repository in E:\RPD to 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. d. Browse to select E:\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.

254

Oracle BI Server Administrator 10g: Build Repositories

Lesson 15: Using the Multi-User Development Environment

Practice 15-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 Time Two users, MWEST and JMEYER, work in the multi-user development environment and modify the same project simultaneously. 2030 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 user name and password. c. Click OK. d. Note that the two projects you created are listed. e. Check Inventory Project and click OK. The New Repository dialog box opens. f. Change the file name to MWEST.rpd. Notice that this repository file is being saved to the default repository directory and not the shared repository directory you created earlier. Notice also 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. Notice 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 E:\RPD. What new files appear?

b. Navigate to E:\OracleBI\server\Repository. What new files appear? What are they?

Oracle BI Server Administrator 10g: Build Repositories

255

Lesson 15: Using the Multi-User Development Environment

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 at the same time, and that multiple users can work with the same project at the same time. 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 user name and password. d. Click OK. Notice 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: a single project can be worked on by multiple developers, and changes are merged during the check-in process. e. Check the check box next to 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 at the same time. i. Navigate to E:\OracleBI\server\Repository and notice 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 in 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 will merge 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. g. Examine the effects of locking the repository. i. In Windows Explorer, navigate to E:\RPD. What additional files appear?

ii.

Navigate to E:\OracleBI\server\Repository. What additional files appear?

5. Switch to the Oracle BI Administration Tool with the JMEYER.rpd open and attempt to merge local changes.

256

Oracle BI Server Administrator 10g: Build Repositories

Lesson 15: Using the Multi-User Development Environment

a. Select File > Multi-User > Merge Local Changes. An error message appears.

No one else can check in projects while the shared repository is locked. In this instance, you are trying to check in the same project using the same Windows user name, so you are informed that you are already checking in this project. 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. Verify that the original subset is E:\OracleBI\server\Repository\originalMWEST.rpd. b. Verify that the modified subset is E:\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. 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 E:\OracleBI\server\Repository. Notice there is a new file there 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 verify the changes.

j. Close SharedABC.merge_log.csv without saving any changes and close MS Excel.


Oracle BI Server Administrator 10g: Build Repositories 257

Lesson 15: Using the Multi-User Development Environment

k. Return to the Administration Tool with SharedABC.rpd open and verify 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 a 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 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. Version 1 of SharedABC repository is opened and the history of changes is displayed.

258

Oracle BI Server Administrator 10g: Build Repositories

Lesson 15: Using the Multi-User Development Environment

s. Right-click the entry and select View > Details. The event details for the project are displayed:

t. u. v. w. x. y. z. aa.

Close the details window. Select Action > Close. The History window and Version 1 of SharedABC are closed. In the Administration Tool, select File > Open > Offline. Navigate to E:\RPD and select SharedABC.rpd to open the shared master repository. Click Open. Click Yes to acknowledge that it can only be opened as read-only. Log in as Administrator. Expand the Inventory presentation catalog and verify that the Regions presentation table no longer appears.

bb. Close the repository. cc. Select File > Exit to close this instance of the Administration Tool. 7. Return to the instance of the Administration Tool with the JMEYER.rpd open and verify that he 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 verify 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. Notice that the fact that Regions was deleted is listed in the merge log, indicating that this was done by another developer. This is why the application copies the latest version of the

Oracle BI Server Administrator 10g: Build Repositories

259

Lesson 15: Using the Multi-User Development Environment

shared repository when performing a check in.

f. Select the listing to highlight it and then click the ellipsis button deleted from the Current repository.

to view the objects

g. Click Cancel. h. In the bottom panels the original JMEYER project, the modified JMEYER project, and 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.

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

260

Oracle BI Server Administrator 10g: Build Repositories

Lesson 15: Using the Multi-User Development Environment

repository to the state before MWEST deleted Regions.

j. k. l. m. n.

Click Merge. Click No when prompted to check global consistency. Verify that Regions now appears in the Inventory presentation catalog. Select File > Multiuser > Publish to Network to publish the repository. Click No when prompted to check global consistency. The local shared repository is merged to the master shared repository.

Oracle BI Server Administrator 10g: Build Repositories

261

Lesson 15: Using the Multi-User Development Environment

o. Open E:\RPD\SharedABC.rpd in read only mode and verify that the changes were applied to the shared repository and that Regions now appears in the Inventory presentation catalog.

p. Close the repository.

262

Oracle BI Server Administrator 10g: Build Repositories

Lesson 15: Using the Multi-User Development Environment

Solutions 15-2 Using a Multi-user Development Environment


Answers
2.a. 2.b. Using Windows Explorer, navigate to E:\RPD. What new files appear? SharedABC.000 and SharedABC.mhl Navigate to E:\OracleBI\server\Repository. What new files 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 you modify. The originalMWESTt.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. In Windows Explorer, navigate to E:\RPD. What additional files appear? SharedABC.lck; this is the lock file, locking the shared repository. Navigate to E:\OracleBI\server\Repository. What additional files appear? SharedABC.rpd and SharedABC.log; these files were generated when the lock was obtained. The repository file is a local copy of the shared repository.

4.g.i. 4.g.ii.

Oracle BI Server Administrator 10g: Build Repositories

263

Lesson 16: Using Administration Tool Utilities

Practice 16-1 Exploring Administration Tool Features


Goal Scenario To provide an orientation to additional Administration Tool features that are useful for maintaining and enhancing repositories In the process of building the SupplierSales and Inventory business models, you have had a chance to interact with a number of features of the Administration Tool. In this practice, you are introduced to some additional Administration Tool features, which can aid in the development, maintenance, and administration of repositories. 1520 minutes

Time

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 according to what leaf you select in the left pane. You can view all joins in the repository, all joins in a particular business model, all joins in the Business Model and Mapping layer, all joins in the Physical layer, all joins in the Business Model and Mapping layer for a particular business model, and all joins 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. If desired, you could 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 and note that you can create new joins using the Joins Manager. This feature is typically not used very much, 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 you are 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
Oracle BI Server Administrator 10g: Build Repositories 265

Lesson 16: Using Administration Tool Utilities

ID, user, client type, repository logical name, logon time, and last active time.

b. Log in to Oracle BI as MWEST with password MWEST and create and run a request. c. Return to the Session Manager. Note the new entry for MWEST.

266

Oracle BI Server Administrator 10g: Build Repositories

Lesson 16: Using Administration Tool Utilities

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.

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 if you want to

Oracle BI Server Administrator 10g: Build Repositories

267

Lesson 16: Using Administration Tool Utilities

know the values of variables when debugging.

k. Click the Requests tab in the lower panel. l. Select the request. m. Click Kill Request to terminate the highlighted request. You could use this feature to kill 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 would have 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. c. Click the Filter button to filter the results of this query. d. In the Item column, select Related to. e. Verify that the column next to the Item column 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.
268 Oracle BI Server Administrator 10g: Build Repositories

Lesson 16: Using Administration Tool Utilities

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:

k. Click the Query button to execute the query.

l. Click the Name column heading to sort the results.

Oracle BI Server Administrator 10g: Build Repositories

269

Lesson 16: Using Administration Tool Utilities

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. Select Date and click Parent to view the object hierarchy.

p. Close the Parent Hierarchy window. 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. s. Click the Filter button. t. Click Clear All. u. Click OK.

270

Oracle BI Server Administrator 10g: Build Repositories

Lesson 16: Using Administration Tool Utilities

v. Click the Query button to execute the query. Click Yes to proceed.

w. Click Show Qualified Name to display the fully qualified names of the objects. Note that the icons help to identify if the objects are tables, keys, aggregated columns, dimension levels, and so forth. 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. Select the Month query you saved in a prior step. bb. Click Query to view the results. cc. Select 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.

Oracle BI Server Administrator 10g: Build Repositories

271

Lesson 16: Using Administration Tool Utilities

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, suppose 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 column or table in the source, this utility provides a way to quickly change all the references to the source tables. It is often used after duplicating an existing logical table source in order 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. Select 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.

272

Oracle BI Server Administrator 10g: Build Repositories

Lesson 16: Using Administration Tool Utilities

l. Click Next. The wizard identifies which tables and columns will be replaced.

m. n. o. p.

Click Finish. Double-click the INVENTORY_Q1_2004 logical table source. Click the Column Mapping tab. Verify 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, select Inventory. The strings appear in the right pane.

f. Click Save. g. Enter Inventory for the file name and save in E:\OracleBI\server\Repository.
Oracle BI Server Administrator 10g: Build Repositories 273

Lesson 16: Using Administration Tool Utilities

h. Click Close. i. Navigate to E:\OracleBI\server\Repository and open the Inventory.csv file

j. Close the file and Excel. 7. Explore the Rename Wizard utility. 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 forth. 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. a. Select Tools > Utilities > Rename Wizard and click Execute. b. At the bottom of the left pane, select 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 First letter of each word capital and click Add. i. Select Change specified text. j. In the Find field, enter an underscore. k. In the Replace with field, enter a space. l. Click Add. m. In the Check Out Objects, click Next. n. Click Next. The wizard allows you to preview the changes before committing.

o. Click Finish. p. Verify the changes in the repository.

q. Check in changes. Do not check consistency. r. Save the repository.

274

Oracle BI Server Administrator 10g: Build Repositories

Lesson 16: Using Administration Tool Utilities

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 Commaseparated 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 better understand metadata object relationships. 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 verify 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.
Oracle BI Server Administrator 10g: Build Repositories 275

Lesson 16: Using Administration Tool Utilities

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 the description, presentation columns, logical columns, and permissions associated with this object.

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 are done. 10. Explore Administration Tool options. a. Return to the Administration Tool and select Tools > Options. b. Click the General tab.

276

Oracle BI Server Administrator 10g: Build Repositories

Lesson 16: Using Administration Tool Utilities

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, like 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. 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. Options here affect where objects are visible 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 which classes of metadata objects the tool will present in alphabetically sorted 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. In an earlier lesson, you learned how to 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.

Oracle BI Server Administrator 10g: Build Repositories

277

(Optional) Practice: Exploring Level Keys

(Optional) Practice: Exploring Level Keys


Goal Scenario To explore different options for constructing level keys 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 2030 minutes

Instructions:
1. Copy the LevelKeys repository to the Repository directory. a. Stop the Oracle BI Server service. b. Navigate to E:\Labs. c. Copy LevelKeys.rpd and paste it into E:\OracleBI\server\Repository. d. Open the LevelKeys repository in offline mode. 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. j. Set the primary key to Type Code.
Oracle BI Server Administrator 10g: Build Repositories 279

(Optional) Practice: Exploring Level Keys

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,

280

Oracle BI Server Administrator 10g: Build Repositories

(Optional) Practice: Exploring Level Keys

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.

Oracle BI Server Administrator 10g: Build Repositories

281

(Optional) Practice: Exploring Level Keys

c. For the ProductsDim hierarchy, change the Type level primary key from Typecode to Type.

d. e. f. g.

Check in Changes. Click Yes to check consistency. Save the repository. 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.

282

Oracle BI Server Administrator 10g: Build Repositories

(Optional) Practice: Exploring Level Keys

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. 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. d. e. f. g. h. i. j. k. l. m.

Double-click the D1_PRODUCT_TYPE logical table source. Click the Column Mapping tab. Map the Type logical column to D1_PRODUCT_TYPE.ITEMTYPE. Click OK to close the Logical Table Source dialog box. Double-click the D1_PRODUCTS logical table source. Click the General tab. Select D1_PRODUCT_TYPE from the list of mapped tables and click Remove to remove D1_PRODUCT_TYPE from the detail source. Click OK to close the Logical Table Source dialog box. Leave Type as the primary level key and Type Code as the alternate key in ProductsDim (same as case 2). Check in changes. Check consistency and verify the repository is consistent.
Oracle BI Server Administrator 10g: Build Repositories 283

(Optional) Practice: Exploring Level Keys

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. 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.

284

Oracle BI Server Administrator 10g: Build Repositories

(Optional) Practice: Exploring Level Keys

h. Leave the D1_PRODUCT_TYPE aggregation source as well.

i. j. k. l.

Check in changes. Check consistency and verify that the repository is consistent. Save the repository. 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. 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.
Oracle BI Server Administrator 10g: Build Repositories 285

(Optional) Practice: Exploring Level Keys

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. 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.

286

Oracle BI Server Administrator 10g: Build Repositories

(Optional) Practice: Exploring Level Keys

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. f. Check in changes. g. Check consistency. h. Save the repository. i. Reload server metadata and run the same query:

Oracle BI Server Administrator 10g: Build Repositories

287

(Optional) Practice: Exploring Level Keys

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. 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.

288

Oracle BI Server Administrator 10g: Build Repositories

(Optional) Practice: Exploring Level Keys

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. e. f. g.

Check in changes. Check consistency. Save the repository. Reload server metadata and run the same query:

Oracle BI Server Administrator 10g: Build Repositories

289

(Optional) Practice: Exploring Level Keys

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:

290

Oracle BI Server Administrator 10g: Build Repositories

You might also like