Bi Admin
Bi Admin
Bi Admin
PRODUCT CENTERS
TECHNOLOGY CENTERS
COMMUNITY
GETTING STARTED
DOWNLOADS
DOCUMENTATION
FORUMS
ARTICLES
Printer View
SAMPLE CODE
E-mail this page
TUTORIALS
Bookmark
Oracle VM
Oracle VM 2.1
Database
Database 11g
Database 10g Release 2
Demos
Archives
Fusion Middleware
Purpose
This tutorial shows you how to use the Oracle BI EE Administration Tool to build, modify, enhance, and manage an Oracle BI repository.
Time to Complete
Application Server
Oracle Beehive
Summary
Administration
End-User
Collaboration Suite
Related information
Viewing Screenshots
Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all
screenshots simultaneously, so response time may be slow depending on your Internet connection.)
Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot
associated with that step. Click a screenshot to hide it.
Overview
This tutorial shows you how to build an Oracle BI metadata repository. You learn how to import metadata from databases and other data
sources, simplify and reorganize the imported metadata into a business model, and then structure the business model for presentation to
users who request business intelligence information via Oracle BI user interfaces, such as Oracle BI Answers and Oracle BI Interactive
Dashboards.
Back to Topic List
JDeveloper
JDeveloper 11g
Prerequisites
JDeveloper 10.1.3
JDeveloper 9.0.5 and 10.1.2 Create a directory named SetupFiles under <InstallDrive>. Download and extract the SH.zip file from here to this directory named
Oracle Business Intelligence
and Enterprise Performance
Management
Legal | Privacy
SetupFiles.
This tutorial is for a Windows environment only.
Note: If you are a Oracle employee and are using the VMWare environment, you can skip the subtopic Create an ODBC Data Source.
Make sure you have 2 GB RAM and 15 GB hard disk space and have VMWare 1.5.x installed on your machine. If you do not have
VMWare software, download a copy of VMWare Player from http://www.vmware.com/download/player/.
For all others, before starting this tutorial, you should meet the following prerequisites:
1.
2.
Have access to or have installed the sample schema. This tutorial uses the SH schema included in the Oracle10g
Database.
You can also install the schema by following the instructions found in the Installing the Sample Schemas and
Establishing a Database Connection OBE tutorial.
14/02/2010 15:55
3.
2 of 148
1.
2.
3.
Click Start > Programs > Oracle Business Intelligence > Administration to open the Oracle BI Administration
Tool.
4.
Click File > New to open the New Repository dialog box.
5.
In the New Repository dialog box, the Repository folder is selected by default. Name the file SH.rpd.
14/02/2010 15:55
3 of 148
6.
Click Save. The new repository opens in the Administration Tool and displays three empty layers: Presentation,
Business Model and Mapping, and Physical. If necessary, select Tools > Options > Show toolbar to display the
toolbar.
The Physical layer is where information on physical data sources is stored. The Business Model and Mapping layer
is where measurements and terms used in business are mapped to the physical data sources. The Presentation
layer is where the business model is customized for presentation to the user. You can work on each layer at any
stage in creating a repository, but the typical order is to create the Physical layer first, then the Business Model and
Mapping layer, and then the Presentation layer.
Leave the Administration Tool open.
Back to Topic
Create an ODBC Data Source
An ODBC data source is needed to import schema information about a data source into an Oracle BI Server repository. To create an
ODBC data source for importing the SH schema information, perform the following steps:
1.
Click Start > Programs > Administrative Tools > Data Sources (ODBC) to open the ODBC Data Source
Administrator.
14/02/2010 15:55
4 of 148
2.
3.
In the Create New Data Source dialog box, select the Oracle driver.
14/02/2010 15:55
5 of 148
4.
Click Finish to open the Oracle ODBC Driver Configuration dialog box.
5.
In the Oracle ODBC Driver Configuration dialog box, enter a Data Source Name (this can be any name), select the
appropriate TNS Service Name from the drop down list (ORCL in this example), and enter SH as the User ID for the
SH schema.
6.
Click Test Connection to open the Oracle ODBC Driver Connect dialog box.
7.
In the Oracle ODBC Driver Connect dialog box, enter the password SH for the SH schema and click OK.
14/02/2010 15:55
8.
You should see a "Testing Connection" message indicating the connection is successful.
9.
10. Click OK to close the Oracle ODBC Driver Configuration dialog box.
11. Verify that the SH system data source is added in the ODBC Data Source Administrator and click OK to close the
ODBC Data Source Administrator.
Back to Topic
Import SH Schema
To import the SH schema information into the repository, perform the following steps:
6 of 148
1.
In the Oracle BI Administration Tool, click File > Import > from Database . . .
2.
In the Select Data Source dialog box, select the SH ODBC DSN you created in a previous step, enter SH as the user
name and password, and click OK to open the Import dialog box.
14/02/2010 15:55
3.
4.
Expand the SH schema folder and use Ctrl + Click to select the following tables:
CHANNELS, COSTS, COUNTRIES, CUSTOMERS, PRODUCTS, PROMOTIONS, SALES, TIMES
7 of 148
14/02/2010 15:55
8 of 148
5.
Verify that only the Tables and Keys checkboxes are selected, which is the default, and click the Import button. The
Connection Pool dialog box opens.
It is best practice to only import objects needed to support your business model. However, dont worry if you import
extra objects at this point. You can always delete objects later if they do not support your business model.
6.
In the Connection Pool dialog box, on the General tab, verify that the call interface is set to Default (OCI 10g) and
change the data source name to the appropriate tnsnames.ora entry ( ORCL in this example). Please note that this is
the TNS service name, not the ODBC DSN.
14/02/2010 15:55
9 of 148
7.
Leave the rest of the settings as they are and click OK to close the Connection Pool dialog box. The import process
starts.
8.
When the Import process completes, click Close to close the Import dialog box.
9.
In the Physical layer of the repository, expand the SH schema folder and verify that the correct tables are imported.
10. To verify connectivity, click Tools > Update All Row Counts.
11. When update all row counts completes, verify that the row counts are displayed in the Physical layer of the
Administration Tool:
Back to Topic
Create Physical Joins
To create physical joins in the Physical layer of the repository, perform the following steps:
1.
In the Physical layer, right-click the SH schema folder and select Physical Diagram > Object (s) and All Joins.
Alternatively, you can select the SH database object and then click the Physical Diagram button on the toolbar.
14/02/2010 15:55
10 of 148
2.
In the Physical Diagram, if the tables are too big, right-click in the white space, select Zoom, and adjust the size.
3.
Rearrange the tables so they are all visible in the Physical Diagram.
4.
5.
Click the Channels table and then the Sales table. The Physical Foreign Key dialog box opens.
14/02/2010 15:55
11 of 148
It matters which table you click first. The join is creating a one-to-many (1:N) relationship that joins the key column in
the first table to a foreign key column in the second table. The Administration Tool makes a best "guess" and
automatically determines which columns should be included in the join.
Make sure the join expression is:
CHANNELS.CHANNEL_ID = SALES.CHANNEL_ID
6.
Click OK to close the Physical Foreign Key dialog box. The join between Channels and Sales is displayed in the
Physical Diagram.
7.
14/02/2010 15:55
COUNTRIES.COUNTRY_ID = CUSTOMERS.COUNTRY_ID
Note that Countries joins to Customers and Costs in not joined for now. All other tables join directly to Sales.
When you are finished, click the X in the upper right corner to close the Physical Diagram.
8.
Select File > Save or click the Save button on the toolbar to save the repository.
9.
Click No when prompted to check global consistency. Checking Global Consistency checks for errors in the entire
repository. Some of the more common checks are done in the Business Model and Mapping layer and Presentation
layer. Since these layers are not defined yet, bypass this check until the other layers in the repository are built. You
learn more about consistency check later in this tutorial.
10. Leave the Administration Tool and the SH repository open for the next topic.
Congratulations! You have successfully created a new repository, set up an ODBC data source, imported a table
schema from an external data source into the Physical layer, and defined keys and joins.
In the next topic you learn how to build the Business Model and Mapping layer of a repository.
Back to Topic
Back to Topic List
12 of 148
14/02/2010 15:55
13 of 148
1.
In the Business Model and Mapping layer, right-click the white space and select New Business Model.
2.
In the Business Model dialog box, name the business model SH and leave the Available for queries box
unchecked. The Description edit box is used to add a comment for yourself or another developer. Leave it empty.
3.
Click OK to close the Business Model dialog. The new SH business model 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.
Back to Topic
Create Logical Tables
To create a new logical table, perform the following steps:
1.
In the Business Model and Mapping layer, right-click the SH business model and select New Object > Logical
Table.
14/02/2010 15:55
14 of 148
2.
In the Logical Table dialog box, name the table Sales Facts.
3.
Click OK to close the Logical Table dialog. The Sales Facts logical table appears in the SH business model in the
Business Model and Mapping layer. The Sources folder is populated in the next step when you create a logical
column.
Back to Topic
Create Logical Columns
To create a logical column, perform the following steps:
1.
14/02/2010 15:55
15 of 148
2.
3.
Drag the AMOUNT_SOLD column from the Physical layer to the Sales Facts logical table in the Business Model
and Mapping layer. A new AMOUNT_SOLD logical column is added to the Sales Facts logical table.
4.
Expand the Sources to see the logical table source that was created automatically when you dragged the
AMOUNT_SOLD column from the Physical layer. Logical table sources define the mappings from a logical table to a
physical table. A logical tables Sources folder contains the logical table sources. Because you dragged a column
from the Physical layer, the logical table source name, SALES, is the same name as the physical table. However, it is
possible to change names in the Business Model and Mapping layer without impacting the mapping.
14/02/2010 15:55
16 of 148
5.
In the Business Model and Mapping layer, double-click the AMOUNT_SOLD logical column to open the Logical
Column dialog box.
6.
14/02/2010 15:55
17 of 148
7.
8.
Click OK to close the Logical Column dialog box. Notice that the logical column icon is changed to indicate an
aggregation rule is applied.
Back to Topic
Create Logical Joins
To create logical joins in the business model, perform the following steps:
1.
Select the following tables in the Physical layer. Select only these tables:
CHANNELS, CUSTOMERS, PRODUCTS, PROMOTIONS, TIMES
2.
Drag the selected tables from the Physical layer onto the SH business model folder in the Business Model and
Mapping layer. This automatically creates logical tables in the Business Model and Mapping layer. Notice that each
logical table has a yellow table icon. In the Business Model and Mapping layer, this indicates a fact table. Because
you have not yet created the logical joins, all table icons are yellow. The icon color for dimension tables changes to
white in a later step when you create logical joins.
14/02/2010 15:55
18 of 148
3.
Right-click the SH business model and select Business Model Diagram > Whole Diagram.
4.
Rearrange the table icons so they are all visible. Place the Sales Facts table in the middle. Adjust the zoom factor, if
desired.
5.
6.
Click the Channels table icon first and then click the Sales Facts 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. Leave the default values as they are, but note which properties you can set: name, business model, tables,
driving table, join type, and cardinality. Also note which properties you cannot set: the join expression and the join
columns. Typically, when defining logical joins, you leave the defaults as they are.
14/02/2010 15:55
19 of 148
7.
Do not change the default values, click OK, and verify your work in the Logical Table Diagram. Notice that the fact
table, Sales Facts, is at the many end of the join:
8.
Repeat the steps for the remaining tables. Your final result should look similar to the picture.
9.
Click the X in the upper right corner to close the Logical Table Diagram. Notice that the color of the table icons for the
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. 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, Sales Facts, and five logical dimension
tables: Channels, Customers, Products, Promotions, and Times.
14/02/2010 15:55
20 of 148
Back to Topic
Rename Business Model Objects
To use the Rename Wizard to rename the objects in the business model, perform the following steps:
1.
2.
In the Utilities dialog box, click Rename Wizard and then Execute.
3.
In the Rename Wizard, click the Business Model and Mapping tab and select the SH business model.
14/02/2010 15:55
21 of 148
4.
5.
Click Next.
6.
14/02/2010 15:55
22 of 148
7.
8.
Click Next.
9.
14/02/2010 15:55
23 of 148
11. Click Change specified text. In the Find box, type an underscore. In the Replace box, type a space.
14/02/2010 15:55
24 of 148
13. Click First letter of each word capital and click Add.
14/02/2010 15:55
25 of 148
14. Click Change specified text. In the Find box, type a space and the letters Id. In the Replace With box, type a space
and the letters ID. Check Case sensitive.
14/02/2010 15:55
17. Click Finish and verify that logical tables and logical columns in the Business Model and Mapping layer are changed
as expected.
26 of 148
14/02/2010 15:55
27 of 148
Back to Topic
Delete Unnecessary Business Model Objects
To delete logical columns that are not needed in the business model, perform the following steps:
1.
For the Channels logical table in the Business Model and Mapping layer, use Ctrl + click to select the Channel
Class ID and the Channel Total ID logical columns.
2.
Right-click either of the highlighted columns and select Delete to delete the columns. Alternatively, you can use the
Delete key on your keyboard.
14/02/2010 15:55
28 of 148
3.
4.
Verify that the Channels logical table now has only four logical columns.
5.
Repeat the steps to delete the following logical columns in the Customers table:
Cust City ID
Cust State Province ID
Country ID
Cust Main Phone Number
Cust Total ID
Cust Src ID
Cust Eff From
Cust Eff To
Cust Valid
6.
Place the cursor over the icon to display the screenshot and verify that the Customers logical table has only the
following logical columns:
14/02/2010 15:55
29 of 148
7.
Place the cursor over the icon to display the screenshot and repeat the steps to delete the highlighted logical
columns in the Products table.
8.
Place the cursor over the icon to display the screenshot and verify that the Products logical table has only the
following logical columns:
9.
Place the cursor over the icon to display the screenshot and repeat the steps to delete the highlighted logical
columns in the Promotions table.
14/02/2010 15:55
30 of 148
10. Place the cursor over the icon to display the screenshot and verify that the Promotions logical table has only the
following logical columns:
Back to Topic
Build Dimension Hierarchies
Dimension hierarchies introduce formal hierarchies into a business model, allowing Oracle BI Server to calculate useful measures and
allowing users to drill down to more detail. In a business model, a dimension hierarchy represents a hierarchical organization of logical
columns belonging to a single logical dimension table. Common dimension hierarchies used in a business model are time periods,
products, customers, suppliers, and so forth.
Dimension hierarchies are created in the Business Model and Mapping layer and end users do not see them in end user tools such as
Oracle BI Answers or Interactive Dashboards. In each dimension hierarchy, you organize dimension attributes into hierarchical levels.
These levels represent the organizational rules and reporting needs required by your business. They provide the structure that Oracle BI
Server uses to drill into and across dimensions to get more detailed views of the data. Dimension hierarchy levels are used to perform
aggregate navigation, configure level-based measure calculations, and determine what attributes appear when Oracle BI users drill down
in their data requests.
To build the Channels dimension hierarchy in the SH business model, perform the following steps:
1.
14/02/2010 15:55
31 of 148
2.
Right-click the ChannelsDim object, which was created by the action in the previous step, and select Expand All.
3.
Place the cursor over the icon to display the screenshot and verify that the ChannelsDim dimension hierarchy
matches the picture.
4.
Right-click the Channels Detail level and select New Object > Parent Level.
14/02/2010 15:55
32 of 148
5.
In the Logical Level dialog box, name the logical level Class and set the Number of elements at this level to 3.
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).
6.
Click OK to close the Logical Level dialog box. The new Class level is added to the hierarchy.
14/02/2010 15:55
33 of 148
7.
8.
Drag the Channel Class column from the Channel Detail level to the Class level to associate the logical column
with this level of the hierarchy.
9.
14/02/2010 15:55
34 of 148
10
In the Logical Level Key dialog box, verify that Channel Class and Use for drilldown are selected. The level key
defines the unique elements in each logical level. Each level key can consist of one or more columns at this level.
11. Click OK to close the Logical Level Key dialog box. The Channel Class column now displays with a key icon.
12. Right-click the Class level and select New Object > Parent Level.
14/02/2010 15:55
35 of 148
13. In the Logical Level dialog box, name the logical level Channel Total Attribute and set the Number of elements at
this level to 1.
14. Click OK to close the Logical Level dialog box. The Channel Total Attribute level is added to the hierarchy.
14/02/2010 15:55
15. Right-click the Channel Total Attribute level and select Expand All.
16.. Drag the Channel Total column from the Channel Detail level to the Channel Total Attribute level.
17. Right-click Channel Total and select New Logical Level Key.
18. In the Logical Level Key dialog box, verify that Channel Total and Use for drilldown are selected.
36 of 148
14/02/2010 15:55
19. Click OK to close the Logical Level Key dialog box. The Channel Total column now displays with a key icon.
20. Right-click the Channel Desc column and select New Logical Level Key.
21. In the Logical Level Key dialog box, notice that Use for drilldown is selected.
37 of 148
14/02/2010 15:55
38 of 148
22. Click OK to close the Logical Level Key dialog. Both Channel Desc and Channel ID display with key icons.
23. Double-click the Channels Detail level to open the Logical Level dialog box.
14/02/2010 15:55
39 of 148
14/02/2010 15:55
40 of 148
27. In the Logical Level Key dialog box, uncheck Use for drilldown.
28. Click OK to close the Logical Level Key dialog box. Notice that the key icons are different. Channel Desc is used for
drill down Channels Detail_Key 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 Channel Class column (the next highest level), the default is to drill down to the Channel Desc
column, not the Channels Detail_Key column.
14/02/2010 15:55
41 of 148
30. Place the cursor over the icon to display the screenshot and verify that the finished ChannelsDim hierarchy looks
like the picture.
32. Optional: Build a dimension hierarchy for the Products logical table. Use the preceding steps, the screenshot, and
the characteristics below as a guide. Don't worry if you cannot complete this step. In Part Two of this OBE, you use a
different repository that already has the dimension hierarchies prebuilt.
14/02/2010 15:55
42 of 148
Back to Topic
Back to Topic List
Drag the SH business model from the Business Model and Mapping layer to the Presentation layer to create the SH
catalog in the Presentation layer.
2.
Expand the SH catalog in the Presentation layer. Notice that the tables and columns in the Presentation layer exactly
match the tables and columns in the Business Model and Mapping layer. Notice also that dimension hierarchies are
not displayed.
14/02/2010 15:55
3.
43 of 148
14/02/2010 15:55
44 of 148
2.
You should receive a message indicating that the repository is consistent and asking if you want to make it available
for queries.
3.
Click Yes to make the SH business model available for queries. The Consistency Check Manager displays.
4.
If the Consistency Check Manager displays any Error messages, edit the repository to correct the inconsistencies
and run the consistency check again.
If you see only Warning and Best Practices messages, you can ignore the messages for now and click Close.
14/02/2010 15:55
45 of 148
5.
In the Business Model and Mapping layer, notice that the SH business model icon has changed to indicate the
business model is now available for queries (the red circle with a line is gone).
6.
Double-click the SH business model object to open the Business Model properties dialog box. Notice that Available
for queries is checked.
7.
8.
Save the repository. Click No when asked to check global consistency (you just checked it).
Back to Topic
Enable Query Logging
To enable query logging for the Administrator user, perform the following steps:
1.
14/02/2010 15:55
46 of 148
2.
In the Security Manager, select Users in the left pane. The Administrator user appears in the right pane.
3.
In the right pane, double-click Administrator. The User dialog box opens.
4.
Verify that the User tab is selected. In the Password field, type Administrator and then confirm in the Confirm
Password field. In the Logging level field, set the value to 2.
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.
5.
14/02/2010 15:55
47 of 148
6.
7.
8.
9.
Back to Topic
Modify NQSConfig.ini
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 (...\\OracleBI\server\Log\NQServer.log). You also disable caching.
Caching is typically not used during development, except to test the cache.
1.
Navigate to ...\OracleBI\server\Config\ and open NQSConfig.INI with a text editor, such as Notepad.
2.
Locate the [ REPOSITORY ] section and change the entry to Star = SH.rpd, DEFAULT;
3.
In the [ CACHE ] section, immediately below the [ REPOSITORY ] section, change the ENABLE parameter from
YES to NO.
4.
14/02/2010 15:55
48 of 148
Back to Topic
Start Oracle BI Services
In this step, you start the Oracle BI Server service to load the SH repository into memory.
1.
2.
Start the Oracle BI Server service. Verify that the Oracle BI Presentation Server and Oracle BI Java Host
services are started. If they are not started, start them. It is not necessary to start the Oracle BI Scheduler or Oracle
BI Cluster Controller services. The services can be started in any order.
3.
Back to Topic
Use Oracle BI Answers to Execute Queries
To start Oracle BI Answers and execute a query, perform the following steps:
1.
Select Start > Programs > Oracle Business Intelligence > Presentation Services.
2.
3.
4.
14/02/2010 15:55
49 of 148
5.
In the left pane, click the Customers folder to expand it. Notice that the folders and columns in Answers match the
folders and column in the Presentation layer of the repository.
6.
Click the Cust State Province column in the left pane to add it to the request criteria on the right.
7.
Click the Sales Facts folder in the left pane to expand it.
14/02/2010 15:55
8.
9.
10. By default, results are displayed in a compound layout, consisting of a title and a table view.
Back to Topic
Use Query Log to Verify Queries
1.
50 of 148
Click Settings > Administration to open the Oracle BI Presentation Services Administration Window.
14/02/2010 15:55
2.
Click the Manage Sessions link to open the Session Management window.
3.
In the Session Management window, under Cursor Cache, click the View Log link for the last entry.
4.
The log displays the last query executed by Administrator. The log file should look similar to the picture.
Locate the SQL Request section. This section contains the logical SQL issued from Answers.
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.
Locate the Sending query to database named SH section, just below the General Query Info section. This section
identifies the physical data source to which Oracle BI Server is connecting and the physical SQL that was generated.
The rest of the file contains information such as query status, number of rows returned, and so forth.
51 of 148
14/02/2010 15:55
52 of 148
5.
6.
7.
Click Close Window to close the Oracle Bi Presentation Services Administration window.
8.
Back to Topic
Back to Topic List
2.
3.
4.
Using Windows Explorer, navigate to the SetupFiles folder and copy the SH_PartTwo.rpd file to
<InstallDrive>\OracleBI\server\repository.
5.
Rename SH_PartTwo.rpd to SH.rpd. There is no need to update the NQSConfig.ini file, because, in an earlier step,
you modified the entry in the Repository section of the initialization file to instruct Oracle BI Server to load the SH
repository into memory upon startup.
6.
7.
Click Start > Programs > Oracle Business Intelligence > Administration to open the Administration Tool.
14/02/2010 15:55
8.
9.
In the Open Online AnalyticsWeb dialog box, type Administrator in the Password field and click Open.
Up to this point , all the changes you have made to the repository have been in offline mode. Now that you have a
consistent repository and Oracle BI Server is running and using the repository, you can make changes to the
metadata in online mode.
In offline mode 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 (i.e., the repository that is the default repository in the DSN). The Administration Tool then
communicates changes to Oracle BI Server and Oracle BI Server makes the corresponding changes to its in-memory
copy.
Typically, you develop a repository in offline mode and use online mode for minor updates and changes.
If desired, examine the structure of the provided repository before proceeding with the remaining steps in this OBE. In
particular, examine the relevant differences: the physical joins for the COSTS physical table, and the four additional
dimension hierarchies: CustomersDim, ProductsDim, PromotionsDim, and TimesDim.
11. To verify connectivity, click Tools > Update All Row Counts. This may take a few minutes.
12. When Update Row Counts completes, expand the Physical layer and verify that row counts appear for all tables and
columns.
53 of 148
14/02/2010 15:55
54 of 148
Notice that the objects have a red check mark. Since Oracle BI Server may be processing queries while you are
editing the repository in online mode, you must check out objects before editing them. Once 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.
In this example, the Administration Tool is configured to check out objects automatically. Thus, objects were checked
out automatically when you ran Update Row Counts. If you do not see the red check marks, select Tools > Options >
General Tab > Check out objects automatically.
Back to Topic
Create a New Measure
To add a new measure to the Sales Facts table, perform the following steps:
1.
2.
Drag UNIT_COST from the Physical layer to the SALES logical table source for the Sales Facts logical table.
UNIT_COST appears as a logical column in the Sales Facts logical table.
14/02/2010 15:55
55 of 148
3.
Right-click the UNIT_COST logical column, select Rename, and rename the column to Unit Cost. Alternatively,
slowly double-click the column to make it editable.
4.
Set the aggregation rule for the Unit Cost logical column to SUM. Hint: double-click the column to open the Logical
Column properties dialog box and click the Aggregation tab..
5.
Drag the Unit Cost logical column to the Sales Facts presentation folder.
6.
Click File > Check In Changes or click the Check In Changes button on the toolbar to check in changes.
7.
Click Yes when prompted to check global consistency. The Consistency Check Manager opens and displays
Warnings and Best Practices messages. Review the messages.
14/02/2010 15:55
56 of 148
8.
For the purposes of this OBE, you disable the Warnings and Best Practices messages. Click the Options tab.
9.
Expand Warnings folder, select Check Features Match Default, and then click the Disable button.
If you desire, review the other Warnings items that are checked.
10. Select Best Practices > Physical Table > Search for Tables With No Keys, and then click the Disable button.
14/02/2010 15:55
57 of 148
If you desire, review the other Best Practices items that are checked.
11. Click the Messages tab.
12. Click Check All Objects. The Consistency Check Manager displays with no messages, indicating a consistent
repository.
14/02/2010 15:55
19. Click Settings > Administration > Manage Sessions > View Log to view the query log and examine the SQL
generated by the request.
Back to Topic
Create a Calculation Measure Using Answers
Before you create calculation measures in the metadata using the Administration Tool, you create a calculation measure using Answers.
You do this so you can compare your results later when you create similar calculations measures in the repository.
To create a calculation measure using Answers, perform the following steps:
58 of 148
1.
Click the Criteria tab. The request from the previous set of steps should still be open.
2.
3.
Click the Edit Formula button for the Amount Sold column that you just added.
4.
The Edit Column Formula dialog box displays with "Sales Facts"."Amount Sold" in the Column formula field.
5.
In the Edit Column Formula dialog box, click to the right of "Sales Facts"."Amount Sold" in the Column Formula
field.
6.
14/02/2010 15:55
59 of 148
7.
In the left panel, click Sales Facts > Unit Cost to add it to the formula.
8.
14/02/2010 15:55
60 of 148
9.
10. Click OK to close the Edit Column Formula dialog box and verify the change to the request.
12. Click Settings > Administration > Manage Sessions > View Log to view the query log.
13. Leave Answers open for the next topic.
Back to Topic
14/02/2010 15:55
61 of 148
Return to the SH repository, which should still be open in online mode in the Administration Tool.
2.
Right-click the Sales Facts logical table and select New Object > Logical Column.
3.
In the Logical Column dialog box, name the logical column Gross Profit and check Use existing logical columns as
the source.
4.
Click the Expression Builder button (three dots) to open the Expression builder.
5.
14/02/2010 15:55
62 of 148
6.
Select Sales Facts in the middle pane, Amount Sold in the right pane, and click Insert. The Amount Sold column is
added to the formula.
7.
8.
14/02/2010 15:55
9.
Click OK to close the Expression Builder. Notice that the formula appears in the Logical Column dialog box.
10. Click OK to close the Logical Column dialog box. The Gross Profit logical column appears in the business model.
11. Drag the Gross Profit logical column to the Sales Facts table in the Presentation layer.
63 of 148
14/02/2010 15:55
64 of 148
17. Expand Sales Facts and verify that the Gross Profit column is now visible in Answers.
18. Create the following request. (If the request from the previous topic is still open, delete the Gross Profit column you
created in Answers and then add the Gross Profit column you created in the repository to the query.)
Times.Calendar Year, Sales Facts.Amount Sold, Sales Facts.Unit Cost, Sales Facts.Gross Profit
14/02/2010 15:55
19. Click Results. Verify that the results are the same as for the query you built using the Gross Profit column created in
Answers.
20. Click Settings > Administration > Manage Sessions > View Log to view the query log. Your results should look
similar to the picture.
Note that the difference between AMOUNT_SOLD and UNIT_COST is being calculated in the outer query block
(SAWITH0.c2 - SAWITH0.c1 as c4 in the example pictured here). Because you defined the Gross Profit 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.
21. Close the query log.
22. Click Finished to close the Session Management window.
23. Click Close Window to close Oracle BI Presentation Services Administration.
24. Leave Answers open for the next topic.
Back to Topic
Create a Calculation Measure Using Physical Columns
In this topic, you define a new calculation measure named Gross Profit Physical in the Sales Facts logical table, using physical columns to
define the calculation formula.
To create a calculation measure using physical columns, perform the following steps.
65 of 148
1.
Return to the SH repository, which should still be open in online mode in the Administration Tool.
2.
Right-click the Sales Facts logical table and select New Object > Logical Column.
14/02/2010 15:55
66 of 148
3.
In the Logical Column dialog box, name the logical column Gross Profit Physical.
4.
5.
6.
Click OK to close the Logical Column dialog box. Gross Profit Physical is added to the business model.
14/02/2010 15:55
67 of 148
7.
Expand Sales Facts > Sources and double-click the SALES logical table source. The Logical Table Source dialog
box opens.
8.
14/02/2010 15:55
68 of 148
9.
Click the Expression Builder button for the Gross Profit Physical logical column.
10. In the Expression Builder, select Physical Tables > SALES > AMOUNT_SOLD and then click the Insert button to
add the column to the formula.
14/02/2010 15:55
69 of 148
13. Click OK to close the Expression Builder. Notice that the expression is added in the Logical Table Source dialog box.
14/02/2010 15:55
14. Click OK to close the Logical Table Source dialog box. The icon for Gross Profit Physical changes to indicate an
aggregation rule is applied.
15. Drag Gross Profit Physical to Sales Facts in the Presentation layer.
70 of 148
14/02/2010 15:55
21. Expand Sales Facts and verify that the Gross Profit Physical column is now visible in Answers.
23. Click Results. Verify that the results are the same for the Gross Profit Physical (built using physical columns) as they
were for the Gross Profit column (built using logical columns).
The calculation formula for the logical columns looks like this: sum(Amount Sold) sum(Unit Cost), whereas the
calculation formula for the physical columns looks like this: sum(AMOUNT_SOLD UNIT_COST). Because of
arithmetic laws, you know that you can sum ColumnA and sum ColumnB and then take the differences of those sums,
and have exactly the same results if you calculate the difference first (the value in ColumnA the value in ColumnB
for each row) and then sum the difference. So in this example, the results are the same for the logical column and the
physical column calculations.
24. Click Settings > Administration > Manage Sessions > View Log to view the query log. Your results should look
similar to the picture.
71 of 148
14/02/2010 15:55
Note that the difference between amount sold and unit cost is calculated first and then summed:
sum(T245.AMOUNT_SOLD - T168.UNIT_COST)in the example pictured here.
25. Close the query log.
26. Click Finished to close the Session Management window.
27. Click Close Window to close Oracle BI Presentation Services Administration.
28. Leave Answers open for the next topic.
Back to Topic
Create a Calculation Measure Using the Calculation Wizard
In this topic, you use the Calculation Wizard to define a new calculation measure named Share of Category in the Sales Facts logical
table.
To create a calculation measure using the Calculation Wizard, perform the following steps:
72 of 148
1.
Return to the SH repository, which should still be open in online mode in the Administration Tool.
2.
3.
14/02/2010 15:55
4.
5.
6.
Click the Levels tab and select Category as the logical level for ProductsDim.
Category Sales is now a level-based measure that will calculate total sales at the category level when used in a
73 of 148
14/02/2010 15:55
74 of 148
query. Level-based measures are useful for creating share measures. You use the Calculation Wizard to create a
share measure in the steps that follow.
7.
8.
9.
Click Next.
10. Check Category Sales as the column to compare with Amount Sold.
14/02/2010 15:55
75 of 148
14/02/2010 15:55
76 of 148
14/02/2010 15:55
16. Drag Category Sales and Share of Category to Sales Facts in the Presentation layer.
23. Place the cursor over the icon to display the screenshot and use it as a reference to create a query. Notice the sort
settings for the Prod Category and Amount Sold columns.
77 of 148
14/02/2010 15:55
28. Click OK to close the Create/Edit Filter dialog box. The filter is added to the request.
78 of 148
14/02/2010 15:55
29. Click Results. Only partial results are shown in the picture.
Back to Topic
Back to Topic List
79 of 148
14/02/2010 15:55
80 of 148
1.
Return to the SH repository, which should still be open in online mode in the Administration Tool.
2.
In the Presentation layer, double-click the SH presentation catalog to open the Presentation Catalog dialog box.
3.
4.
To create a new presentation Table, click the Add button to open the Presentation Table dialog box.
5.
Click the General tab and name the presentation table Calendar.
14/02/2010 15:55
81 of 148
6.
In the Description field, type -> Calendar time attributes. Adding -> in the description nests the table under the table
above it. The description displays as a tool tip in Answers.
7.
8.
Repeat the steps and create another presentation table named Fiscal with ->Fiscal time attributes in the
Description field.
14/02/2010 15:55
82 of 148
9.
Drag the tables or use the Up and Down buttons to rearrange the tables in the following order:
Times
Fiscal
Calendar
Products
Customers
Channels
Promotions
Sales Facts
10. Click OK to close the Presentation Catalog dialog box. The new tables are added to the Presentation layer and the
presentation tables are reordered.
14/02/2010 15:55
83 of 148
11. Double-click the Channels presentation table to open the Presentation Table dialog box.
13. Drag the columns or use the Up and Down arrows to reorder the columns. A suggested approach is to order the
columns hierarchically from top to bottom.
14/02/2010 15:55
84 of 148
14. Click OK to close the Presentation Table dialog box. The column order is changed in the Presentation layer.
14/02/2010 15:55
23. Verify that the columns in the Fiscal and Calendar folders appear as expected.
85 of 148
14/02/2010 15:55
86 of 148
14/02/2010 15:55
87 of 148
1.
Return to the SH repository, which should still be open in online mode in the Administration Tool.
2.
3.
4.
Right-click in the white space on the right and select New Initialization Block.
5.
In the Session Variable Initialization Block dialog box, type setUser in the Name field.
14/02/2010 15:55
88 of 148
6.
Click the Edit Data Source button to open the Session Variable Initialization Block Data Source dialog box.
7.
Click the Browse button and select SH > Connection Pool in the Select Connection Pool dialog box.
14/02/2010 15:55
8.
Double-click Connection Pool or click the Select button to add the connection pool to the Session Variable
Initialization Block Data Source dialog box.
9.
In the Default Initialization String field, type the following initialization string:
select ':USER', case when upper(':USER') = 'KURT' then 'Germany' when upper(':USER') = 'KEIKO' then
'Japan' when upper(':USER')= 'CHARLES' then 'United Kingdom' when upper(':USER') = 'KAREN' then
'United States of America' end, 'CountryManagers', 2 from Dual
89 of 148
14/02/2010 15:55
90 of 148
10. Click OK to close the Session Variable Initialization Block Data Source dialog box. The initialization string is visible in
the Session Variable Initialization Block dialog box.
11. Click Edit Data Target to open the Session Variable Initialization Block Variable Target dialog box.
14/02/2010 15:55
91 of 148
14/02/2010 15:55
92 of 148
16. The USER variable is added to the Session Variable Initialization Block Variable Target dialog box.
17. Repeat the steps and add three more variables: UserCountry, GROUP, and LOGLEVEL. Click Yes when promoted
about the GROUP and LOGLEVEL session variables having a special purpose. The order is important. The order of
the variables must match the order of the values for the variables in the initialization string in the initialization block.
14/02/2010 15:55
93 of 148
18. Click OK to close the Session Variable Initialization Block Variable Target dialog box. The variables are displayed in
the Variable Target section of the Session Variable Initialization Block dialog box.
19. Click OK to close the Session Variable Initialization Block dialog box. The setUser initialization block is visible in the
Security Manager.
14/02/2010 15:55
Back to Topic
To test the initialization block and session variables, perform the following steps:
1. Click Manage > Security to open the Security Manager.
94 of 148
2.
3.
Right-click the white space in the right pane and select New Security Group.
4.
14/02/2010 15:55
95 of 148
5.
Click the Permissions button to open the User / Group Permissions dialog box.
6.
7.
8.
14/02/2010 15:55
96 of 148
9.
Click Select to add Customers to the User / Group Permissions dialog box.
10. Click the Expression Builder button (three dots) on the right to open the Expression Builder (you may need to scroll
to see the button).
14/02/2010 15:55
11. Select Logical Tables > Customers > Country and then click the Insert button to add Country to the formula.
13. Select Session Variables > UserCountry and click the Insert button to add UserCountry to the formula as an
argument in the VALUEOF()function.
97 of 148
14/02/2010 15:55
98 of 148
14. Click OK to close the Expression Builder. The filter is added in the User / Group Permissions dialog box.
14/02/2010 15:55
99 of 148
22. Test the initialization block by logging in to Answers as one of the users in the initialization block: Kurt, Keiko,
Charles, or Karen.
23. Create the following query:
Customers.Country, Times.Calendar.Calendar Year, Sales Facts.Amount Sold.
24. Click Results. The results of the query should correspond to the the user's country (Kurt = Germany, Keiko = Japan,
Charles = United Kingdom, Karen = United States of America). The picture shows the results when the user = Kurt.
Back to Topic
To create a dynamic repository variable, perform the following steps:
1. Return to the SH repository open in online mode.
2.
3.
4.
Right-click the white space and select New Initialization Block to open the Repository Variable Init Block dialog box.
14/02/2010 15:55
100 of 148
5.
14/02/2010 15:55
101 of 148
6.
Click Edit Data Source to open the Repository Variable Init Block Data Source dialog box.
7.
Click the Browse button to open the Select Connection Pool dialog box.
14/02/2010 15:55
102 of 148
8.
Double-click the SH > Connection Pool object to add it to the Connection Pool field in the Repository Variable Init
Block Data Source dialog box.
9.
14/02/2010 15:55
10. Click OK to close the Repository Variable Init Block Data Source dialog box. The connection pool and initialization
string are added to the Repository Variable Init Block dialog box.
11. Click Edit Data Target to open the Repository Variable Init Block Variable Target dialog box.
103 of 148
14/02/2010 15:55
104 of 148
12. Use the New button to create four variables: maxSalesDate, maxYear, maxMonthDesc, and maxMonthID. The
order is important. The order of the variables must match the column order in the initialization string.
13. Click OK to close the Repository Variable Init Block Variable Target dialog box. The variables appear in the Variable
Target field in the Repository Variable Init Block dialog box.
14/02/2010 15:55
105 of 148
14. Click Edit Data Source to open the Repository Variable Init Block Data Source dialog box.
15. Click Test and verify you get the results in the picture.
19. Select Repository > Initialization Blocks > Variables > Dynamic to see the variables displayed in the Variable
Manager.
14/02/2010 15:55
106 of 148
26. Click the Add Filter button for the Calendar Year column.
27. In the Create/Edit Filter dialog box, click Add > Variable > Repository.
14/02/2010 15:55
29. Click OK to close the Create/Edit Filter dialog box. The filter is added to the request.
30. Click Results and verify that Calendar Year returns the expected result.
Back to Topic
Back to Topic List
Adding Multiple Sources
Data is often partitioned into multiple physical sources for a single logical table in a business model. When a logical table source does not
contain the entire set of data at a given level, you need to specify the portion of the set that it does contain. When individual sources at a
given level contain information for a portion or fragment of the domain, Oracle BI Server needs to know the content of the sources in order
to pick the appropriate source for the query. The goal is to provide seamless and efficient access from the users' perspective. When there
are multiple sources, the metadata is built so that Oracle BI Server handles the navigation to the appropriate source. Oracle BI Server can
seamlessly access and process data from multiple sources in an efficient manner to satisfy users requests.
In this example, sales quota numbers are stored in an Excel workbook. The workbook, SHQuota.xls, is stored on your machine. You
incorporate the quota numbers into the business model and create business measures to report variance from quota and percent of
quota.
To add quota information to the business model, you perform the following steps.
Create an ODBC DSN
Import the Excel Source
Map Logical Dimension Columns
Create Quota Measures
Test
To create an ODBC DSN for the Excel workbook, perform the following steps:
1. Using Windows Explorer, navigate to the SetupFiles folder and copy the SHQuota.xls file to a location on your
machine.
107 of 148
14/02/2010 15:55
2.
Click Start > Programs > Administrative Tools > Data Sources (ODBC) to open the ODBC Data Source
Administrator.
3.
4.
108 of 148
In the Create New Data Source dialog box, select the Microsoft Excel Driver.
14/02/2010 15:55
109 of 148
5.
Click Finish to open the ODBC Microsoft Excel Setup dialog box.
6.
In the ODBC Microsoft Excel Setup dialog box, enter a Data Source Name (this can be any name).
7.
Click Select Workbook to open the Select Workbook dialog box and navigate to the location where you saved the
SHQuota.xls file.
14/02/2010 15:55
110 of 148
8.
Click OK to close the Select Workbook dialog box. The path to the workbook is displayed in the ODBC Microsoft
Excel Setup dialog box.
9.
10. Verify that the Excel system data source is added in the ODBC Data Source Administrator and click OK to close the
ODBC Data Source Administrator.
Back to Topic
To import the Excel data source into the repository, perform the following steps:
1. Return to the SH repository open in online mode.
2.
14/02/2010 15:55
111 of 148
3.
In the Select Data Source dialog box, select the ODBC DSN you created in the previous steps. Leave User Name and
Password blank.
4.
5.
14/02/2010 15:55
112 of 148
6.
Verify that only Tables and Keys are checked and click Import.
7.
When import completes, close the Import dialog box and verify that all four range tables have been imported into the
Physical layer.
8.
Double-click the Excel database object in the Physical layer (SHQuota in this example) to open the Database dialog
box.
9.
14/02/2010 15:55
113 of 148
14/02/2010 15:55
Back to Topic
To map the logical dimension columns, perform the following steps:
1. In the Business Model and Mapping layer, expand Customers > Sources and note that there are two logical table
sources: CUSTOMERS and COUNTRIES.
114 of 148
2.
Drag the physical column COUNTRY_REGION from Geography in the Physical layer to the logical column
Customers.Country Region in the Business Model and Mapping layer. Notice that a new logical table source,
Geography, is created automatically.
3.
4.
Double-click the Geography logical table source in the Customers > Sources folder to open the Logical Table
Source dialog box.
5.
Click the Column Mapping tab. Notice the logical to physical column mappings.
14/02/2010 15:55
115 of 148
6.
7.
Drag the physical column CALENDAR_YEAR from XLDates in the Physical layer to the logical column
Times.Calendar Year in the Business Model and Mapping layer. Notice that a new logical table source, XLDates, is
created automatically.
8.
Drag the remaining physical columns from XLDates in the Physical layer to the corresponding logical columns in the
Times table in Business Model and Mapping layer.
9.
Double-click the XLDates logical table source in the Times > Sources folder to open the Logical Table Source
dialog box, click the Column Mapping tab, and verify the mappings. Note that "Show unmapped columns" is
unchecked.
14/02/2010 15:55
12. Use Ctrl+Click to select all four SHQuota tables in the Physical layer.
13. Right-click any one of the four tables and select Physical Diagram > Selected Object(s) Only to open the Physical
Diagram.
14. In the Physical Diagram, use the New foreign key button to create the following joins. Hint: Use CTRL+click to
create the multi-column joins or type the join expressions in the Expression field. Create new keys when prompted.
XLDates.CALENDAR_QUARTER_NUMBER = Quotas."Calendar Quarter Number" AND XLDates.CALENDAR_YEAR
= Quotas."Year" AND XLDates.CALENDAR_QUARTER_DESC = Quotas."Calendar Quarter Desc"
Geography.COUNTRY_NAME = Quotas.Country AND Geography.COUNTRY_SUBREGION = Quotas."Country
Subregion" AND Geography.COUNTRY_REGION = Quotas."Country Region"
ProdCategory.PROD_CATEGORY = Quotas."Prod Category".
Back to Topic
To create the quota measures, perform the following steps:
1. Drag the column Quotas.Quota from the Physical layer onto the Sales Facts logical table. Notice that a new logical
table source, Quotas, and a new logical column, Quota, are created.
116 of 148
2.
3.
Click the Aggregation tab and set the aggregation rule to Sum.
14/02/2010 15:55
117 of 148
4.
5.
The Quota logical column states quota in thousands, so rename Quota to Quota (000).
6.
Right-click Sales Facts and select New Object > Logical Column to open the Logical Column dialog box.
7.
Click the General tab and name the logical column Quota.
8.
14/02/2010 15:55
118 of 148
9.
Click the Expression Builder button (three dots) to open the Expression Builder.
11. Close the Expression Builder. The formula displays in the Logical Column dialog box.
12. Close the Logical Column dialog box. The Quota column is added to the business model.
14/02/2010 15:55
119 of 148
14/02/2010 15:55
120 of 148
14/02/2010 15:55
121 of 148
21. In the Finish window, verify the calculations that will be created by the Calculation Wizard.
22. Click Finish. The calculation measures are added to the business model.
23. Add the Quota (000), Quota, Variance From Quota, and % of Quota measures to the Sales Facts presentation
table.
14/02/2010 15:55
122 of 148
Back to Topic
To test the quota measures, perform the following steps.
1. Return to Answers. Log out and then log back in as Administrator with password Administrator.
2.
3.
4.
5.
Click Results. (Please note that SHQuota contains data only for 2001).
6.
7.
8.
Back to Topic
Back to Topic List
Executing Direct Database Requests
Users with the appropriate permissions can create and issue a direct database request directly to a physical back-end database. The
results of the request can be displayed and manipulated within Oracle BI Answers, and subsequently incorporated into Oracle BI
Interactive Dashboards and Oracle BI Delivers.
The following privilege settings in Oracle BI Presentation Services Administration control whether you can create and issue physical
requests:
Edit Direct Database Requests: If this privilege is set for you, you can create direct database requests. By default, this privilege is set only
for users defined as Presentation Server Administrators.
Execute Direct Database Requests: If this privilege is set for you, you can issue physical requests. By default, this privilege is not enabled
for anyone. It can be changed by a Presentation Server Administrator.
To execute a direct database request, perform the following steps:
1.
14/02/2010 15:55
123 of 148
2.
In the Oracle BI Presentation Service Administration screen, click Manage Privileges to open the the Privilege
Administration screen.
3.
In the Privilege Administration screen, scroll down to Answers. Note that the Edit Direct Database Requests
privilege is granted to Presentation Server Administrators. By default, the Administrator user is a member of this
group.
4.
Note that the Execute Direct Database Requests privilege is not granted to anyone.
14/02/2010 15:55
124 of 148
5.
6.
Click the Add button next to Presentation Server Administrators to give this group explicit access to this privilege.
7.
Click Finished to close the Change Privilege Permissions screen. Notice the change to the privilege permissions for
Execute Direct Database Requests.
14/02/2010 15:55
125 of 148
8.
9.
Click Close Window to close the Oracle BI Presentation Services Administration screen.
10. Click the Answers link to return to the Answers start page.
11. Click the Create Direct Request link.
12. In the Connection Pool field, type the connection pool name for the SH data source enclosed in double quotes
("SH"."Connection Pool" in this example).
13. In the SQL Statement field, type SELECT * FROM Channels.
14. Click Validate SQL and Retrieve Columns to display the columns from the Channels table.
14/02/2010 15:55
126 of 148
15. Click Results. Your results should look similar to the screenshot.
2.
Click the Criteria tab to return to the direct database request page.
14/02/2010 15:55
3.
Verify that the Connection Pool field is still set to the connection pool name for the SH data source enclosed in double
quotes ("SH"."Connection Pool" in this example).
4.
Copy the CREATE TABLE SQL for the first table, AGG_ST_CAT_DAY_SALES_F, from agg_table_sql.txt and
paste it into the SQL Statement field.
5.
6.
7.
Remove the CREATE TABLE SQL from the SQL Statement field.
8.
9.
127 of 148
14/02/2010 15:55
128 of 148
14/02/2010 15:55
129 of 148
14/02/2010 15:55
130 of 148
25. Remove the CREATE TABLE SQL from the SQL Statement field.
26. Type the following SQL in the SQL Statement field:
SELECT COUNT(*) FROM AGG_PRODUCTS_CATEGORY_D.
Back to Topic
To import the aggregate tables, perform the following steps:
1. Return to the SH repository, which should still be open in online mode.
2.
3.
In the Select Data Source dialog, select the SH data source, enter SH as User Name and Password, and click OK.
4.
In the Import dialog box, expand the SH schema and select the three aggregate tables:
AGG_ST_CAT_DAY_SALES_F, AGG_CUSTOMER_STATE_D, and AGG_PRODUCTS_CATEGORY_D.
14/02/2010 15:55
131 of 148
5.
Click Import.
6.
When the import process completes, close the Import dialog box.
7.
Expand the SH folder in the Physical layer and verify that the aggregate tables are added.
8.
Check in changes.
9.
Select the three aggregate tables in the Physical layer, right-click and select Update Row Count to verify
connectivity. You should see the expected row counts after each table.
Back to Topic
14/02/2010 15:55
132 of 148
To create physical joins for the aggregate tables, perform the following steps:
1. In the Physical layer, use Ctrl+Click to select the three new aggregate tables and the Times table.
2.
3.
In the Physical Diagram, use the New Foreign Key button to create the following joins. Click Yes when prompted to
create matching table keys.:
AGG_CUSTOMER_STATE_D.CUST_STATE_PROVINCE_ID =
AGG_ST_CAT_DAY_SALES_F.CUST_STATE_PROVINCE_ID
AGG_PRODUCTS_CATEGORY_D.PROD_CATEGORY_ID =
AGG_ST_CAT_DAY_SALES_F.PROD_CATEGORY_ID
TIMES.TIME_ID = AGG_ST_CAT_DAY_SALES_F.TIME_ID
4.
5.
Check in changes.
6.
Back to Topic
To map existing logical columns to aggregate columns and set aggregation content, perform the following steps:
1.
Map existing logical columns to new sources by dragging columns from the Physical layer to corresponding columns
in the Business Model and Mapping layer:
Logical Column
Sales Facts.Amount Sold
Physical Column
AGG_ST_CAT_DAY_SALES_F.AMOUNT_SOLD
14/02/2010 15:55
133 of 148
AGG_CUSTOMER_STATE_D.CUST_STATE_PROVINCE
Customers.Country
AGG_CUSTOMER_STATE_D.COUNTRY_NAME
Customers.Country Subregion
AGG_CUSTOMER_STATE_D.COUNTRY_SUBREGION
Customers.Country Region
AGG_CUSTOMER_STATE_D.COUNTRY_REGION
Customers.Country Total
AGG_CUSTOMER_STATE_D.COUNTRY_TOTAL
Products.Prod Category
AGG_PRODUCTS_CATEGORY_D.PROD_CATEGORY
Products.Prod Total
AGG_PRODUCTS_CATEGORY_D.PROD_TOTAL
2.
In the Business Model and Mapping layer, expand Sales Facts > Sources and verify that a new logical table source,
AGG_ST_CAT_DAY_SALES_F, is created.
3.
Double-click the AGG_ST_CAT_DAY_SALES_F logical table source to open the Logical Table Source dialog box,
click the Column Mapping tab, and verify the mapping.
4.
5.
Use the drop-down menu in the Logical Level field to set the following logical levels:
CustomersDim = State Province
ProductsDim = Category
TimesDim = Times Detail
14/02/2010 15:55
134 of 148
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 access the aggregate tables instead of the detail tables.
For example, after setting aggregation content, if a user queries for Amount Sold by Country Region, the server will
access the AGG_ST_CAT_DAY_SALES_F aggregate fact table and the corresponding aggregate dimension table,
AGG_CUSTOMER_STATE_D.
If a user queries for a level lower than the levels specified here, for example, Subregion or Country, then the server
will access the detail tables. If a user queries for higher level, for example, Country Total, 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.
6.
7.
Expand Customers > Sources and verify that a new logical table source, AGG_CUSTOMER_STATE_D, is created.
8.
Expand Customers > Sources and double-click the AGG_CUSTOMER_STATE_D logical table source, click the
Column Mapping tab, and verify the mappings.
9.
14/02/2010 15:55
135 of 148
10. Use the drop-down menu in the Logical Level field to set the following logical level to specify what level of detail is
stored in the aggregate table:
CustomersDim = State Province
13. Double-click the AGG_PRODUCTS_CATEGORY_D logical table source, click the Column Mapping tab, and verify
the mappings.
14/02/2010 15:55
Back to Topic
To test in Answers and examine the query log, perform the following steps:
1. Return to Answers.
2.
3.
136 of 148
4.
Hold down the Ctrl key and click Times > Calendar > Calendar Year. The Create/Edit Filter dialog box opens.
5.
14/02/2010 15:55
137 of 148
6.
Click OK to close the Create/Edit Filter dialog box. The filter is added to the query.
7.
Click Results.
8.
9.
10. Locate the last query run under Cursor Cache and click View Log.
11. Examine the log and verify that the aggregate tables AGG_CUSTOMER_STATE_D and
AGG_ST_CAT_DAY_SALES_F were accessed.
14/02/2010 15:55
Back to Topic
Back to Topic List
Creating Time Series Measures
The ability to compare business performance with previous time periods is fundamental to understanding a business. Time comparisons
allow businesses to analyze data that spans multiple time periods, providing a context for the data. 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
The solution is to model time series data in the Oracle BI repository. This allows users to make one request for the desired result. Oracle
BI Server runs multiple queries in parallel to get the results. The queries that run in the background to support the time measure are
transparent to the user.
Oracle BI Server provides Ago and ToDate functions for time series comparisons. Both of these functions operate on measures. The Ago
function calculates the aggregated value as of some time period shifted from the current time. For example, the Ago function can produce
sales for every month of the current quarter, along with the corresponding quarter ago sales. The ToDate function is used to aggregate a
measure attribute from the beginning of a specified time period to the currently displaying time. For example, the ToDate function can
calculate Month to Date sales for a given year. You use the Expression Builder to apply the functions.
To create time series measures, perform the following steps:
Identify a Dimension as a Time Dimension
Create a Month Ago Measure
Create a Change Month Ago Measure
Create a ToDate Measure
Test the Time Series Measures
To identify a dimension as a time dimension, perform the following steps:
1. In the Business Model and Mapping layer, double-click the TimesDim dimension hierarchy to open the Dimension
dialog box.
138 of 148
2.
3.
4.
Expand TimesDim to the Times Detail level and double-click the Times Detail level to open the Logical Level
dialog box.
5.
6.
14/02/2010 15:55
139 of 148
7.
Back to Topic
To create a Month Ago measure, perform the following steps:
1. Right-click Sales Facts and select New Object > Logical Column to open the Logical Column dialog box.
2.
3.
4.
Click the Expression Builder button (three dots) to open the Expression Builder.
5.
14/02/2010 15:55
6.
7.
8.
Select Logical Tables > Sales Facts and then double-click Amount Sold to add it to the expression.
9.
10. Select Time Dimensions > TimesDim and then double-click Month to add it to the expression.
140 of 148
14/02/2010 15:55
141 of 148
11. Click <<integer>> in the expression and type 1. The Ago function calculates the Amount Sold value one month prior
to the current month.
12. Click OK to close the Expression Builder. The formula is displayed in the Logical Column dialog box.
14/02/2010 15:55
142 of 148
Back to Topic
To create a Change Month Ago measure, perform the following steps:
1. Right-click Sales Facts and select New Object > Logical Column to open the Logical Column dialog box.
2.
3.
4.
5.
Select Logical Tables > Sales Facts and then double-click Amount Sold to add it to the expression.
6.
7.
Select Logical Tables > Sales Facts and then double-click Month Ago Dollars to add it to the expression.
14/02/2010 15:55
8.
Click OK to close the Expression Builder. The formula is displayed in the Logical Column dialog box.
9.
Back to Topic
To create a ToDate measure, perform the following steps:
1. Right-click Sales Facts and select New Object > Logical Column.
2.
143 of 148
14/02/2010 15:55
144 of 148
3.
4.
5.
Select Functions > Time Series Functions and double-click ToDate to insert the expression.
6.
7.
Select Logical Tables > Sales Facts and then double-click Amount Sold.
14/02/2010 15:55
145 of 148
8.
9.
Select Time Dimensions > TimesDim and the double-click Year to add it to the expression.
10. Click OK to close the Expression Builder. The formula is displayed in the Logical Column dialog box.
14/02/2010 15:55
146 of 148
Back to Topic
To test the time series measures, perform the following steps:
1. In the Business Model and Mapping layer, expand the Times logical table.
2.
Double-click Calendar Month Name to open the logical column dialog box.
3.
4.
5.
The sort order column displays in the Logical Column dialog box.
14/02/2010 15:55
147 of 148
The Calendar Month Name column is now automatically sorted by Calendar Month Desc whenever it is used in an
Answers query.
6.
7.
Drag the three time series measures from the Business Model and Mapping layer to the Sales Facts presentation
table.
8.
Check in changes.
9.
14/02/2010 15:55
148 of 148
Back to Topic
Back to Topic List
Summary
In this lesson, you should have learned how to:
Build the Physical, Business Model and Mapping, and Presentation layers of a repository
Test and validate a repository
Create calculation measures
Use initialization blocks and variables
Add multiple sources to logical tables in a business model
Execute direct database requests
Use aggregate tables to speed processing
Create time series measures
Back to Topic List
Related Information
To learn more about Oracle Business Intelligence, you can refer to:
Additional OBEs on the OTN Web site.
Back to Topic List
Place the cursor over this icon to hide all screenshots.
About Oracle |
14/02/2010 15:55