P. 1
Repositry Creation

Repositry Creation

|Views: 1|Likes:
Published by pubaskar

More info:

Published by: pubaskar on Aug 31, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/31/2013

pdf

text

original

Sections

  • Prerequisites
  • Building the Physical Layer of a Repository
  • Building the Business Model and Mapping Layer of a Repository
  • Building the Presentation Layer of a Repository
  • Testing and Validating a Repository
  • Creating Calculation Measures
  • Organizing the Presentation Layer
  • Using Initialization Blocks and Variables
  • Adding Multiple Sources
  • Executing Direct Database Requests
  • Using Aggregates
  • Creating Time Series Measures
  • Summary

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Creating a Repository Using the Oracle Business Intelligence Administration Tool

Purpose This tutorial shows you how to use the Oracle BI EE Administration Tool to build, modify, enhance, and manage an Oracle BI repository on the BIC2G:EE 10.1.3.2 VMWare image (Linux Edition v1.0). Time to Complete: Approximately 3 hours Topics This tutorial covers the following topics: Page Prerequisites .....................................................................................................2 Building the Physical Layer of a Repository ......................................................3 Building the Business Model and Mapping Layer of a Repository...................16 Building the Presentation Layer of a Repository..............................................44 Testing and Validating a Repository................................................................46 Creating Calculation Measures .......................................................................57 Organizing the Presentation Layer ..................................................................87 Using Initialization Blocks and Variables .........................................................93 Adding Multiple Sources................................................................................110 Executing Direct Database Requests............................................................125 Using Aggregates..........................................................................................129 Creating Time Series Measures ....................................................................137 Summary .......................................................................................................147

1

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.

Prerequisites
This tutorial is for a Windows client environment connecting to the Linux BIC2G image as a server. Instructions for installing VMWare software and client BI tools and data source drivers are found in the file “Prerequisites for Oracle BI Workshop” After installing VMWare and opening the BIC2G Linux image, follow these instructions to map a network drive on local client to the Linux Server: ¾ Go to http://192.168.209.134/go/setup.html and click on the Map button.

¾ Execute the downloaded file to map the chosen drive letter (G:) to the Linux Server. Open up the mapped drive and rename the existing SH.rpd repository: ¾ Open up G:\biee\10.1.3.2\OracleBI\server\Repository in windows explorer ¾ Rename the existing SH.rpd to SH_backup.rpd

2

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

3

us. Wait for the flag to turn RED. 4 .2\OracleBI\server\Repository Name the file SH.com/go/process_control/pc. click on STOP. 2. 5.rpd.html Select the checkbox next to BI Server.oracle. 4. the local Repository folder is selected by default. perform the following steps: 1.3. http://oracle2go. Click File > New to open the New Repository dialog box. Open the BIC2G Process Control for Services.1. Click Start > Programs > Oracle Business Intelligence > Administration to open the Oracle BI Administration Tool.Create a New Repository To create a new repository. In the New Repository dialog box. 3. Browse to the Linux server repository folder in the drive mapped during the pre-requisite steps to this section: Browse to G:\biee\10.

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

The Create New Data Source dialog box opens.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. Click Start > Programs > Administrative Tools > Data Sources (ODBC) to open the ODBC Data Source Administrator. 6 . perform the following steps: 1. To create an ODBC data source for importing the SH schema information. 2. Click the System DSN tab and click Add.

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

enter the password SH for the SH schema and click OK.7. 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. 9. Click OK to close the Oracle ODBC Driver Configuration dialog box. 8 . 8. In the Oracle ODBC Driver Connect dialog box. Click OK to close the Testing Connection message. You should see a "Testing Connection" message indicating the connection is successful. 11. 10.

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

COUNTRIES. TIMES 5. The Connection Pool dialog box opens. Expand the SH schema folder and use Ctrl + Click to select the following tables: CHANNELS. which is the default. PRODUCTS. COSTS. SALES. It is best practice to only import objects needed to support your business 10 . and click the Import button. CUSTOMERS. PROMOTIONS.4. Verify that only the Tables and Keys checkboxes are selected.

9. verify that the call interface is set to Default (OCI 10g) and change the data source name to the appropriate tnsnames. 7.ora entry ( ORCL in this example).model. 11 . click Close to close the Import dialog box. expand the SH schema folder and verify that the correct tables are imported. Leave the rest of the settings as they are and click OK to close the Connection Pool dialog box. The import process starts. In the Connection Pool dialog box. 6. 8. not the ODBC DSN. Please note that this is the TNS service name. on the General tab. don’t worry if you import extra objects at this point. When the Import process completes. In the Physical layer of the repository. You can always delete objects later if they do not support your business model. However.

Alternatively. right-click the SH schema folder and select Physical Diagram > Object (s) and All Joins. click Tools > Update All Row Counts. you can select the SH database object and then click the Physical Diagram button on the toolbar. To verify connectivity. When update all row counts completes. verify that the row counts are displayed in the Physical layer of the Administration Tool: Create Physical Joins To create physical joins in the Physical layer of the repository. 12 . In the Physical layer. 11. perform the following steps: 1.10.

and adjust the size. 5.2. right-click in the white space. 4. 3. The Physical Foreign Key dialog box opens. if the tables are too big. 13 . select Zoom. In the Physical Diagram. Rearrange the tables so they are all visible in the Physical Diagram. Click the New Foreign Key button on the toolbar. Click the Channels table and then the Sales table.

Click OK to close the Physical Foreign Key dialog box. 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. Continue to create the following joins: 14 .CHANNEL_ID = SALES. 7. Make sure the join expression is: CHANNELS.It matters which table you click first. The join between Channels and Sales is displayed in the Physical Diagram.CHANNEL_ID 6.

imported a table schema from an external data source into the Physical layer.CUST_ID = SALES.COUNTRY_ID = CUSTOMERS. Click No when prompted to check global consistency. Leave the Administration Tool and the SH repository open for the next topic. click the X in the upper right corner to close the Physical Diagram. 15 .PROMO_ID = SALES. set up an ODBC data source. 10. Checking Global Consistency checks for errors in the entire repository. and defined keys and joins. Congratulations! You have successfully created a new repository. Since these layers are not defined yet.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.CUST_ID COUNTRIES.PROD_ID = SALES. You learn more about consistency check later in this tutorial.TIME_ID = SALES.TIME_ID PRODUCTS.PROMO_ID TIMES.PROMOTIONS. Some of the more common checks are done in the Business Model and Mapping layer and Presentation layer.PROD_ID CUSTOMERS. bypass this check until the other layers in the repository are built. 9. 8. In the next topic you learn how to build the Business Model and Mapping layer of a repository. Select File > Save or click the Save button on the toolbar to save the repository.

The business model simplifies the physical schema and maps the users’ business vocabulary to physical sources. Logical dimension tables contain the data used to qualify the facts. you perform the following steps: Create a Business Model Create Logical Tables Create Logical Columns Create Logical Joins Rename Business Model Objects Delete Unnecessary Business Model Objects Build Dimension Hierarchies 16 . The Business Model and Mapping layer of the Administration Tool can contain one or more business model objects. or logical. The main purpose of the business model is to capture how users think about their business using their own vocabulary. Each logical column (and hence each logical table) can have one or more physical objects as sources. model of the data and specifies the mappings between the business model and the Physical layer schemas. Collections of logical columns form logical tables. A business model object contains the business model definitions and the mappings from logical to physical tables for the business model. There are two main categories of logical tables: fact and dimension. The Business Model and Mapping layer of the Administration Tool defines the business. Logical fact tables contain the measures by which an organization gauges its business operations and performance.Building the Business Model and Mapping Layer of a Repository In this topic you use the Oracle BI Administration Tool to build the Business Model and Mapping layer of a repository. Most of the vocabulary translates into logical columns in the business model. To build the Business Model and Mapping layer. This is where the physical schemas are simplified to form the basis for the users’ view of the data.

The new SH business model appears in the Business Model and Mapping layer. In the Business Model and Mapping layer. name the business model SH and leave the Available for queries box unchecked. The red symbol on the business model indicates it is not yet enabled for querying. In the Business Model dialog box. Leave it empty. Click OK to close the Business Model dialog. 17 . The Description edit box is used to add a comment for yourself or another developer. 2.Create a Business Model To create a new business model. right-click the white space and select New Business Model. perform the following steps: 1. 3. You enable the business model for querying later after the Presentation layer is defined and the repository passes a global consistency check.

perform the following steps: 1. The Sales Facts logical table appears in the SH business model in the Business Model and Mapping layer. In the Business Model and Mapping layer. name the table Sales Facts. Click OK to close the Logical Table dialog. 3. 2. right-click the SH business model and select New Object > Logical Table. 18 . In the Logical Table dialog box.Create Logical Tables To create a new logical table. The Sources folder is populated in the next step when you create a logical column.

perform the following steps: 1. expand the Sales physical table. 19 . 2. In the Physical layer.Create Logical Columns To create a logical column. Select the column AMOUNT_SOLD.

Logical table sources define the mappings from a logical table to a physical table. Expand the Sources to see the logical table source that was created automatically when you dragged the AMOUNT_SOLD column from the Physical layer. is the same name as the physical table. A logical table’s Sources folder contains the logical table sources. the logical table source name.3. 4. However. 20 . 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. Because you dragged a column from the Physical layer. it is possible to change names in the Business Model and Mapping layer without impacting the mapping. SALES.

Click OK to close the Logical Column dialog box. 8. In the Business Model and Mapping layer. Click the Aggregation tab. Notice that the logical column icon is changed to indicate an aggregation rule is applied. 6. In the Default aggregation rule drop down list. 7.5. double-click the AMOUNT_SOLD logical column to open the Logical Column dialog box. 21 . select SUM.

This automatically creates logical tables in the Business Model and Mapping layer. PROMOTIONS. TIMES 2. Drag the selected tables from the Physical layer onto the SH business model folder in the Business Model and Mapping layer. Select only these tables: CHANNELS. In the Business Model and Mapping layer. CUSTOMERS. The icon color for dimension tables changes to white in a later step when you create logical joins. PRODUCTS. this indicates a fact table. Notice that each logical table has a yellow table icon. Because you have not yet created the logical joins. perform the following steps: 1. Select the following tables in the Physical layer. all table icons are yellow. 22 .Create Logical Joins To create logical joins in the business model.

6. Click the Channels table icon first and then click the Sales Facts table icon in the Logical Table Diagram window. but note which properties you can set: name. Leave the default values as they are. The Logical Join dialog box opens. Click the New Complex Join button in the toolbar. if desired.3. The order is important. business model. The second table clicked is the many side of the relationship. driving table. 4. Also note 23 . Rearrange the table icons so they are all visible. 5. Adjust the zoom factor. Place the Sales Facts table in the middle. join type. tables. Right-click the SH business model and select Business Model Diagram > Whole Diagram. and cardinality.

click OK. Notice that the fact table. when defining logical joins. Sales Facts. 24 .which properties you cannot set: the join expression and the join columns. and verify your work in the Logical Table Diagram. you leave the defaults as they are. Do not change the default values. Repeat the steps for the remaining tables. is at the many end of the join: 8. Your final result should look similar to the picture. 7. Typically.

a yellow icon indicates a fact table and a white icon indicates a dimension 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. Do not check global consistency. Promotions. Customers. In a business model. Save the SH repository. Defining the join relationships determined which tables are the logical dimension tables and which is the logical fact table. 10.9. Click the X in the upper right corner to close the Logical Table Diagram. perform the following steps: 1. and five logical dimension tables: Channels. Rename Business Model Objects To use the Rename Wizard to rename the objects in the business model. 25 . Products. Notice that the color of the table icons for the dimension tables has changed to white in the business model. Sales Facts. and Times. Click Tools > Utilities.

Check Logical Table and Logical Column. Click Next. 7. In the Utilities dialog box. click the Business Model and Mapping tab and select the SH business model. 6.2. 4. 26 . click Rename Wizard and then Execute. 5. Click the Add Hierarchy button. In the Rename Wizard. 3. Click Select None.

8. Click Next. 9. Select All text lowercase.

10. Click Add 11. Click Change specified text. In the Find box, type an underscore. In the Replace box, type a space.

12. Click Add.

27

13. Click First letter of each word capital and click Add. 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.

15. Click Add. 16. Click Next and review changes.

17. Click Finish and verify that logical tables and logical columns in the Business Model and Mapping layer are changed as expected.

28

18. Save the repository. Do not check global consistency.

29

you can use the Delete key on your keyboard. 30 .Delete Unnecessary Business Model Objects To delete logical columns that are not needed in the business model. 3. Right-click either of the highlighted columns and select Delete to delete the columns. 2. Click Yes to confirm the delete. use Ctrl + click to select the Channel Class ID and the Channel Total ID logical columns. perform the following steps: 1. For the Channels logical table in the Business Model and Mapping layer. Alternatively.

Verify that the Channels logical table now has only four logical columns.4. 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 31 .

Place the cursor over the icon to display the screenshot and repeat the steps to delete the highlighted logical columns in the Products table. Place the cursor over the icon to display the screenshot and verify that the Customers logical table has only the following logical columns: 7. 32 .6.

10. 33 . 12.8. Place the cursor over the icon to display the screenshot and verify that the Promotions logical table has only the following logical columns: 11. Do not delete any columns in the Times table. Place the cursor over the icon to display the screenshot and repeat the steps to delete the highlighted logical columns in the Promotions table. Place the cursor over the icon to display the screenshot and verify that the Products logical table has only the following logical columns: 9. Do not check global consistency. Save the repository.

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. Right-click the Channels logical table and select Create Dimension.

34

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.

5. In the Logical Level dialog box, name the logical level Class and set the

35

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.

7. Right-click the Class level and select Expand All.

36

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. verify that Channel Class and Use for drilldown are selected. Each level key can consist of one or more columns at this level. 37 . 10 In the Logical Level Key dialog box. Right-click Channel Class and select New Logical Level Key. 9. The level key defines the unique elements in each logical level.8.

11. 14. 38 . 12. 13. Click OK to close the Logical Level dialog box. Right-click the Class level and select New Object > Parent Level. The Channel Total Attribute level is added to the hierarchy. In the Logical Level dialog box. name the logical level Channel Total Attribute and set the Number of elements at this level to 1. Click OK to close the Logical Level Key dialog box. The Channel Class column now displays with a key icon.

Right-click Channel Total and select New Logical Level Key. 16. 17.15. verify that Channel Total and Use for 39 . Right-click the Channel Total Attribute level and select Expand All. Drag the Channel Total column from the Channel Detail level to the Channel Total Attribute level. 18.. In the Logical Level Key dialog box.

20. notice that Use for drilldown is selected. Right-click the Channel Desc column and select New Logical Level Key.drilldown are selected. The Channel Total column now displays with a key icon. 40 . 21. 19. Click OK to close the Logical Level Key dialog box. In the Logical Level Key dialog box.

Double-click the Channels Detail level to open the Logical Level dialog box. Click the Keys tab. 24. Both Channel Desc and Channel ID display with key icons. 23. 41 . Click OK to close the Logical Level Key dialog.22.

25. Click the Edit button. 27. uncheck Use for drilldown. Channel Desc is used for drill down Channels Detail_Key is 42 . Click OK to close the Logical Level Key dialog box. Click Channels Detail_Key. In the Logical Level Key dialog box. Notice that the key icons are different. 26. 28.

Later. not the Channels Detail_Key column.not. Do not check global consistency. 31. 32. Optional: Build a dimension hierarchy for the Products logical table. The ProductsDim dimension hierarchy should have the following characteristics: ¾ For the Subcategory level. Place the cursor over the icon to display the screenshot and verify that the finished ChannelsDim hierarchy looks like the picture. when a user drills down from the Channel Class column (the next highest level). Use the preceding steps. you use a different repository that already has the dimension hierarchies prebuilt. and the characteristics below as a guide. Don't worry if you cannot complete this step. the default is to drill down to the Channel Desc column. when a user drills down in Answers or a dashboard. 29. set Number of elements at this level to 43 . Save the repository. Based on this example. In Part Two of this OBE. 30. the screenshot. the default drill is to the level key that has Use for drilldown checked in the next lowest level. Click OK to close the Logical Level dialog box.

¾ For the Category level. save the repository. Do not check global consistency. set Number of elements at this level to 1. ¾ Check Use for drill down for all other keys in the ProductsDim hierarchy. To build the Presentation layer. Building the Presentation Layer of a Repository In this topic you use the Oracle BI Administration Tool to build the Presentation layer of a repository. ¾ For the Product Total Attribute level. uncheck Use for drill down for Products Detail_Key (Prod ID). Simplifying the view of the data for users makes it easier to craft queries based on users’ business needs because you can expose only the data that is meaningful to the users. 44 .21. you can organize columns into catalogs and folders. The Presentation layer provides a means to further simplify or customize the Business Model and Mapping layer for end users. You typically create Presentation layer objects by dragging objects from the Business Model and Mapping layer. Presentation layer objects can then be renamed and reorganized. If you complete this step. Corresponding objects are automatically created in the Presentation layer. ¾ For the Products Detail level. organize the data in a way that aligns with the way users think about the data. 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. you perform the following steps: 1. For example. The Presentation layer is built after the Physical layer and Business Model and Mapping layer and adds a level of abstraction over the Business Model and Mapping layer. and rename data as necessary for the set of users. It is the view of the data seen by end users in client tools and applications. such as Oracle BI Answers. set Number of elements at this level to 5.

Notice also that dimension hierarchies are not displayed. Notice that the tables and columns in the Presentation layer exactly match the tables and columns in the Business Model and Mapping layer.2. Do not check global consistency. Expand the SH catalog in the Presentation layer. 45 . Save the repository. 3.

the object. The Consistency Check Manager displays three types of messages: Error messages indicate errors that need to be fixed to make the repository consistent. but is not a requirement for a consistent repository. For example. you perform the following steps: Run a Consistency Check Enable Query Logging Create an empty Webcatalog to test your RPD Change the metadata files file and Start Oracle BI Services Use Oracle BI Answers to Execute Queries Use Query Log to Verify Queries Run a Consistency Check Consistency check is a utility in the Administration Tool that checks if a repository has met certain requirements. For example. For each message the Consistency Check Manager identifies the message type. To test and validate a repository. Defining keys for physical tables is best practice. You then test the repository by running queries using Oracle BI Answers. Repositories and the business models within them must pass the consistency check before you can make business models available for queries. a best practice message is displayed. You begin by checking the repository for errors using the check consistency option. if there are physical tables with no keys defined. if the Administrator user has an empty password this should be addressed. There are options to display only selected message types. Best Practices messages provide information about conditions but do not indicate an inconsistency. depending upon the intent of the Oracle BI Server administrator. but is not a requirement for a consistent repository. display results using 46 .Testing and Validating a Repository You have finished building the initial business model and now need to test the repository before continuing your development. Finally. you examine the query log file to verify the SQL generated by Oracle BI Server. a detailed message alerts you to the nature of the inconsistency. Warning messages indicate conditions that may or may not be errors. When a repository or business model is inconsistent. and provides a detailed description of the message. the object type.

qualified names. To check consistency. 3. Select File > Check Global Consistency. 47 . Click Yes to make the SH business model available for queries. and copy the results to another file. check all objects in the repository. 2. You should receive a message indicating that the repository is consistent and asking if you want to make it available for queries. The Consistency Check Manager displays. you perform the following steps: 1.

4. 6. If you see only Warning and Best Practices messages. 48 . In the Business Model and Mapping layer. Double-click the SH business model object to open the Business Model properties dialog box. Click No when asked to check global consistency (you just checked it). you can ignore the messages for now and click Close. Save the repository. Click OK to close the Business Model properties dialog box. 8. 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). Notice that Available for queries is checked. 7. edit the repository to correct the inconsistencies and run the consistency check again. If the Consistency Check Manager displays any Error messages. 5.

In the Password field. The User dialog box opens.Enable Query Logging To enable query logging for the Administrator user. double-click Administrator. 4. 2. In the Security Manager. In the right pane. The Administrator user appears in the right pane. select Users in the left pane. Select Manage > Security. perform the following steps: 1. set the value to 2. In the Logging level field. 49 . type Administrator and then confirm in the Confirm Password field. 3. Verify that the User tab is selected.

and technical support. 5. debugging. Save the repository. logging is normally disabled because query logging can impact performance by producing very large log files. Click Action > Close to close the Security Manager. Select File > Close to close the repository. Click OK to close the User dialog box. 50 . you need to generate some queries. and examine the query log. You log query activity at the individual user level. retrieve the results.To test the repository. In production mode. Logging is intended for testing. 6. 8. 7. Select File > Exit to close the Administration Tool. 9. Do not check global consistency.

ini instructs Oracle BI Server to load a specific repository into memory upon startup.. it logs the error to the server log file (. An entry in the Repository section of the initialization file NQSConfig.ini only if you wish to change system settings like turning caching on. you start the Oracle BI Server service to load the SH repository into memory.\\OracleBI\server\Log\NQServer. 1. Modify the NQSConfig. We will create a new Web catalog to start our testing of the SH. Browse to G:\biee\10..1. The Linux image includes a special Process Control page that allows us to easily perform this change to the server’s main metadata files through a web GUI.3.log). If Oracle BI Server detects a syntax error while loading the repository. 51 .rpd.2\OracleBIData\web\catalog Create a new folder in this location called SH_Start Change the metadata files file and Start Oracle BI Services In this step. You will find instructions for doing this in the online documentation.Create an empty Webcatalog to test your RPD The end-user report objects are stored in a Web Catalog.

rpd and Web Catalog SH_Start Click SET 2. Check the BI Server and BI Presentation Server boxes and click Start Wait until all the relevant flags go green 52 .html Select Repository: sh. you will need to explicitly start them.xml.oracle. Oracle BI Presentation Server and Oracle BI Java Host services were not started prior to making the previous change.us.The path to the Web Catalog is stored in another initialization file called InstanceConfig. Open the Process Control Page: http://oracle2go. Ensure that the previous step is completed and that the files listed under each service are correct. The editing of this file has also been simplified on the Linux image by the Process Control page 1.com/go/process_control/pc. If the Oracle BI Server.

Click the Answers link. perform the following steps: 1. click the Customers folder to expand it. In the left pane. Click the Cust State Province column in the left pane to add it to the request criteria on the right. Select Start > Programs > Oracle Business Intelligence > Presentation Services. Click the SH subject area. Log in to Oracle Business Intelligence as Administrator with password Administrator 3. 5. 53 . 6. 4. 2. Notice that the folders and columns in Answers match the folders and column in the Presentation layer of the repository. 7. Click the Sales Facts folder in the left pane to expand it.Use Oracle BI Answers to Execute Queries To start Oracle BI Answers and execute a query.

54 . Click the Amount Sold column to add it to the request criteria. 9. 10. results are displayed in a compound layout.8. Click the Results tab. By default. consisting of a title and a table view.

Click Settings > Administration to open the Oracle BI Presentation Services Administration Window. The log file should look similar to the picture. The log displays the last query executed by Administrator. In the Session Management window. 4. under Cursor Cache. 2. Click the Manage Sessions link to open the Session Management window.Use Query Log to Verify Queries 1. click the View Log link for the last entry. 55 . 3.

adding multiple logical table sources. run a consistency check. This section identifies the repository. Click Close Window to close the Oracle Bi Presentation Services Administration window. Click Finished to close the Session Management window. Leave Answers open. Locate the Sending query to database named SH section. and so forth. 7. subject area. and Presentation layers of a repository. For the remainder of this OBE you enhance the repository by performing tasks such as building calculation measures. This section identifies the physical data source to which Oracle BI Server is connecting and the physical SQL that was generated. 56 . building variables and initialization blocks. 6. just below the SQL Request section. number of rows returned.Locate the SQL Request section. Close the query log. The rest of the file contains information such as query status. just below the General Query Info section. Locate the General Query Info section. and so forth. Congratulations! Up to this point you have successfully built the Physical. and tested the repository using Oracle BI Answers. This section contains the logical SQL issued from Answers. and presentation catalog from which the query was run. 8. Business Model and Mapping. mapping to aggregate tables. 5.

or use the Calculation Wizard to automate the process. You use logical columns for calculation formulas that require an aggregation rule that is applied before the calculation. you use the Expression Builder to create calculation measures that appear as columns to users in Answers. Users can then easily build queries using familiar terminology. The advantages to building calculation measures in the repository is the measures are built once and can be made available to all users. Calculation measures allow end users to ask business questions like “Show me the accounts receivable balance as of Q3” or “Show me the difference between units ordered and units shipped. use physical columns as objects in a formula. Oracle BI Server has a calculation engine to perform a multitude of calculations. a business wants to compare values of a measure and needs a calculation to express the comparison. In the examples in this lesson. The advantage of defining a logical column formula based on existing logical columns is that you only have to define it once. You use physical columns for calculations that require and aggregation rule to be applied after the calculation. All three methods are covered in this OBE. You can also build calculation measures in Answers. you perform the following steps: Create a BI Server ODBC Connection Load a Prebuilt Repository Create a New Measure Create a Calculation Measure Using Answers Create a Calculation Measure Using Logical Columns Create a Calculation Measure Using Physical Columns Create a Calculation Measure Using the Calculation wizard 57 .” An Expression Builder enables you to create expressions that are similar to expressions created with SQL. There are different methods for creating calculation measures in the Administration Tool. To create calculation measures. You can use existing logical columns as objects in a formula. you have to map for each physical source it could be derived from.Creating Calculation Measures Often. When you create formulas based on physical columns.

LinuxPEServer-SalesHistory Enter oracle2go for the Server Click Next > 4. Open Start > Control Panel > Administrative Tools > Data Sources (ODBC) 2. To connect to this layer to modify the . The Oracle BI Server provides an ODBC API just for this purpose. Click on the System DSN tab and select Add… 3. requests being sent to the server as Logical SQL queries. Enter a suitable name for the DSN e.rpd “Online”.Create a BI Server ODBC Connection To edit the RPD while the server is running it is necessary to create a direct connection to the server rather than opening up the .rpd file on it’s own.g. This is also the way that Presentation Services connects to the mid-tier BI Server. we need to first create the necessary ODBC DSN: 1. ¾ Login ID: Administrator ¾ Password: Administrator ¾ Port: 9703 Check the box “Connect to the Oracle BI Server to obtain default settings…” 58 .

Click Next > 5. Change the default Catalog to SH Click Finish 6. Hit OK to close the ODBC Administrator 59 .

com/go/process_control/pc.rpd file to G:\biee\10. The provided repository is similar to the repository you built in the first part of this OBE. There are four additional dimension hierarchies: CustomersDim. because. Rename SH_PartTwo.us.oracle. but with the following relevant differences: Physical joins are built for the the COSTS physical table in the Physical layer.1.html 2. Type Administrator in the Password field and click Open. There is no need to update the NQSConfig. navigate to the SetupFiles folder and copy the SH_PartTwo.com/go/process_control/pc.2\OracleBI\server\Repository. Using Windows Explorer. 3.oracle. 6. 4. Stop the Oracle BI Server service using the Process control page: http://oracle2go.2\OracleBI\server\Repository. 9. in an earlier step.rpd to SH.3.rpd file to SH_PartOne. 5. perform the following steps: 1.ini file. 8. and TimesDim.us.rpd. 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. Click Start > Programs > Oracle Business Intelligence > Administration to open the Administration Tool. PromotionsDim. Using Windows Explorer.html 7. In the Open Online dialog box.1. navigate to G:\biee\10.Load a Prebuilt Repository A prebuilt repository is provided to expedite your completion of the remaining exercises in this OBE. select the LinuxPEServer-Sales History DSN you created earlier. Start the Oracle BI Server service from the process control page: http://oracle2go. ProductsDim. Click File > Open > Online. 10 The SH repository opens in online mode.rpd.3. To load the prebuilt repository. Change the name of the SH. 60 .

row counts appear for all tables and columns. PromotionsDim. you can make changes to the metadata in online mode.e. the relationship is different. In online mode. few minutes. In particular. click Tools > Update All Row Counts. expand the Physical layer and verify that . ProductsDim. and. examine the structure of the provided repository before proceeding with the remaining steps in this OBE. tells the OS to save the changed file. When the Administration Tool tells it to. when told by the Administration Tool. and TimesDim. In this mode. Then it listens for messages from the Administration Tool about changes. This may take a . If desired.. makes those changes to its in-memory copy. the Administration Tool in this case. you develop a repository in offline mode and use online mode for minor updates and changes. you pick an Oracle BI ODBC DSN that points to the repository you want to edit (i. The Administration Tool then communicates changes to Oracle BI Server and Oracle BI Server makes the corresponding changes to its in-memory copy. Up to this point . Typically. 61 . When you start the Administration Tool in online mode. An application. Oracle BI Server can act as an agent of the Administration Tool. and the four additional dimension hierarchies: CustomersDim. Oracle BI Server sends the Administration Tool a copy of its in-memory repository. In offline mode the relationship between the Administration Tool and the repository is like the relationship between any Windows application and a file. examine the relevant differences: the physical joins for the COSTS physical table. Oracle BI Server has already opened the repository file and the operating system has put a write-lock on the file. all the changes you have made to the repository have been in offline mode. makes changes to its in-memory copy. 11 To verify connectivity. 12 When Update Row Counts completes. the repository that is the default repository in the DSN). opens a file for editing. and tells the OS to save the changed file.. Now that you have a consistent repository and Oracle BI Server is running and using the repository.

the Administration Tool is configured to check out objects automatically. you can save the changes to the repository. When you are finished editing. 62 .Notice that the objects have a red check mark. you check them in again. Once the objects have been edited. objects were checked out automatically when you ran Update Row Counts. select Tools > Options > General Tab > Check out objects automatically. Since Oracle BI Server may be processing queries while you are editing the repository in online mode. If you do not see the red check marks. Thus. In this example. At that point the changes you made become active. you must check out objects before editing them.

UNIT_COST appears as a logical column in the Sales Facts logical table. Alternatively.Create a New Measure To add a new measure to the Sales Facts table. perform the following steps: 1. select Rename. 2. Right-click the UNIT_COST logical column. In the Physical layer. navigate to COSTS > UNIT_COST. and rename the column to Unit Cost. 63 . 3. slowly double-click the column to make it editable. Drag UNIT_COST from the Physical layer to the SALES logical table source for the Sales Facts logical table.

Click File > Check In Changes or click the Check In Changes button on the toolbar to check in changes. 5. 7. Click Yes when prompted to check global consistency.4. Drag the Unit Cost logical column to the Sales Facts presentation folder. 6. Review the messages. Hint: doubleclick the column to open the Logical Column properties dialog box and click the Aggregation tab. Set the aggregation rule for the Unit Cost logical column to SUM. The Consistency Check Manager opens and displays Warnings and Best Practices messages.. 64 .

review the other Warnings items that are checked. 11 Click the Messages tab. you disable the Warnings and Best Practices messages. 65 . For the purposes of this tutorial. and then click the Disable button. Expand Warnings folder. 10 Select Best Practices > Physical Table > Search for Tables With No Keys. and then click the Disable button. 9. review the other Best Practices items that are checked. . . select Check Features Match Default. Click the Options tab. If you desire.8. If you desire.

. . . indicating a consistent repository. If Answers is not open. 14 Save the repository. 19 Click Settings > Administration > Manage Sessions > View Log to view the . 17 Build the following request: . query log and examine the SQL generated by the request.Calendar Year. log in as Administrator with password Administrator. messages.Unit Cost. . The Consistency Check Manager displays with no . Sales Facts. click the Answers link. 66 . 15 Return to Answers to test the new column in Answers. and click the SH subject area.Amount Sold. Times. 13 Click Close to close the Consistency Check Manager. select Start > Programs > Oracle Business Intelligence > Presentation Server. Sales Facts. . 16 Click Reload Server Metadata.12 Click Check All Objects. 18 Click Results.

2. 5. You do this so you can compare your results later when you create similar calculations measures in the repository. you create a calculation measure using Answers. Click the Edit Formula button for the Amount Sold column that you just added. Click the Minus operator to add it to the formula. The request from the previous set of steps should still be open. perform the following steps: 1. click to the right of "Sales Facts". The Edit Column Formula dialog box displays with "Sales Facts". Add another Amount Sold column to the request. To create a calculation measure using Answers. Click the Criteria tab. In the Edit Column Formula dialog box."Amount Sold" in the Column Formula field. 3.Create a Calculation Measure Using Answers Before you create calculation measures in the metadata using the Administration Tool. 67 . 4. 6."Amount Sold" in the Column formula field.

In the left panel. 10. 68 . In the Custom Heading field.Click OK to close the Edit Column Formula dialog box and verify the change to the request.7. click Sales Facts > Unit Cost to add it to the formula. type Gross Profit. 9. Click the Custom Headings check box. 8.

Click Results.Click Settings > Administration > Manage Sessions > View Log to view the query log. 12. 69 . 13.11.Leave Answers open for the next topic.

Click the Expression Builder button (three dots) to open the Expression builder. using existing logical columns to define the calculation formula. 2. perform the following steps. 4. 5. which should still be open in online mode in the Administration Tool. 1. The Amount Sold column is added to the formula. 70 . In the left pane. you define a new calculation measure named Gross Profit in the Sales Facts logical table. Select Sales Facts in the middle pane. 3. 6. Return to the SH repository. click Logical Tables. Right-click the Sales Facts logical table and select New Object > Logical Column. and click Insert. To create a calculation measure using logical columns. name the logical column Gross Profit and check Use existing logical columns as the source.Create a Calculation Measure Using Logical Columns In this topic. In the Logical Column dialog box. Amount Sold in the right pane.

Click OK to close the Expression Builder. Double-click Unit Cost in the right pane to add it to the formula. Notice that the formula appears in the Logical Column dialog box. 71 .7. Click the minus sign operator to add it to the formula. 8. 9.

Return to Answers. 11. If there are Error messages. Click Yes when prompted to check global consistency. 72 . Click OK to close the Logical Column dialog box. If the repository is consistent (no Error messages). you must correct the errors before continuing. 14. Click Reload Server Metadata. Drag the Gross Profit logical column to the Sales Facts table in the Presentation layer.10. 16. 13. Save the repository. The Gross Profit logical column appears in the business model. 15. 12. close the Consistency Check Manager. which should still be open from the previous topic. Check in changes.

18.) ¾ Times. Sales Facts.17. Expand Sales Facts and verify that the Gross Profit column is now visible in Answers.Unit Cost. Sales Facts.Calendar Year ¾ Sales Facts. Create the following request. (If the request from the previous topic is still open.Amount Sold.Gross Profit 73 . delete the Gross Profit column you created in Answers and then add the Gross Profit column you created in the repository to the query.

24. 22. Note that the difference between AMOUNT_SOLD and UNIT_COST is being calculated in the outer query block (SAWITH0. Click Finished to close the Session Management window.19. Verify that the results are the same as for the query you built using the Gross Profit column created in Answers. 74 . Because you defined the Gross Profit calculation using logical columns. Click Results.c2 . 21.SAWITH0. Close the query log. the columns are summed first and then the difference is calculated. 23. Click Settings > Administration > Manage Sessions > View Log to view the query log. You compare these results to the query results in the next practice. 20.c1 as c4 in the example pictured here). Click Close Window to close Oracle BI Presentation Services Administration. Leave Answers open for the next topic. Your results should look similar to the picture.

Click the Aggregation tab. 1. perform the following steps. 2. 6. using physical columns to define the calculation formula. Return to the SH repository. name the logical column Gross Profit Physical.Create a Calculation Measure Using Physical Columns In this topic. Set the default aggregation rule to SUM. Gross Profit Physical is 75 . you define a new calculation measure named Gross Profit Physical in the Sales Facts logical table. which should still be open in online mode in the Administration Tool. 3. Click OK to close the Logical Column dialog box. Right-click the Sales Facts logical table and select New Object > Logical Column. In the Logical Column dialog box. To create a calculation measure using physical columns. 5. 4.

select Physical Tables > SALES > 76 . 9. 8. Click the Column Mapping tab. Expand Sales Facts > Sources and double-click the SALES logical table source. The Logical Table Source dialog box opens. 7.added to the business model. 10 In the Expression Builder. Click the Expression Builder button for the Gross Profit Physical logical column.

.

AMOUNT_SOLD and then click the Insert button to add the column to the formula.

11 Click the minus sign operator to add it to the formula. . 12 Select Physical Tables > COSTS > UNIT_COST and then click the Insert . button to add the column to the formula.

13 Click OK to close the Expression Builder. Notice that the expression is added . in the Logical Table Source dialog box.

77

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

16 Check in changes. . 17 Click Yes when prompted to check global consistency. If the repository is . consistent (no Error messages), close the Consistency Check Manager. If there are Error messages, you must correct the errors before continuing. 18 Save the repository. . 19 Return to Answers, which should still be open from the previous topic. . 20 Click Reload Server Metadata.

78

.

21 Expand Sales Facts and verify that the Gross Profit Physical column is now . visible in Answers.

22 Create the following request. . ¾ Times.Calendar Year, Sales ¾ Facts.Amount Sold, Sales Facts.Unit Cost, Sales Facts.Gross Profit Physical

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

79

. 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. whereas the calculation formula for the physical columns looks like this: sum(AMOUNT_SOLD – UNIT_COST). Because of arithmetic laws. . 24 Click Settings > Administration > Manage Sessions > View Log to view .AMOUNT_SOLD . . Note that the difference between amount sold and unit cost is calculated first and then summed: sum(T245.UNIT_COST)in the example pictured here. So in this example. . 28 Leave Answers open for the next topic. 27 Click Close Window to close Oracle BI Presentation Services Administration. the query log.The calculation formula for the logical columns looks like this: sum(Amount Sold) – sum(Unit Cost). Your results should look similar to the picture. 80 . 25 Close the query log. 26 Click Finished to close the Session Management window. you know that you can sum ColumnA and sum ColumnB and then take the differences of those sums. the results are the same for the logical column and the physical column calculations.T168.

Return to the SH repository. 3. you use the Calculation Wizard to define a new calculation measure named Share of Category in the Sales Facts logical table. A new column named Amount Sold#1 is added to the business model.Create a Calculation Measure Using the Calculation wizard In this topic. perform the following steps: 1. Right-click the Amount Sold logical column and select Duplicate. which should still be open in online mode in the Administration Tool. To create a calculation measure using the Calculation Wizard. 81 . 2.

Right-click Amount Sold and select Calculation Wizard. 8. Category Sales is now a level-based measure that will calculate total sales at the category level when used in a query.4. 6. Click OK to close the Logical Column dialog box. 82 . 7. Level-based measures are useful for creating share measures. Double-click Category Sales to open the Logical Column dialog box. Rename Amount Sold#1 to Category Sales. 5. Click the Levels tab and select Category as the logical level for ProductsDim. You use the Calculation Wizard to create a share measure in the steps that follow.

83 . 11. 12.9.Uncheck Change and Percent Change and check Percent. Click Next.Click Next. 10.Check Category Sales as the column to compare with Amount Sold.

Click Finish.Drag Category Sales and Share of Category to Sales Facts in the 84 . 16.Click Next. 14.Change Calculation Name to Share of Category. Share of Category is added to the business model. 15.13.

24.Expand Sales Facts and verify that Category Sales and Share of Category are now visible in Answers.Return to Answers.Click Reload Server Metadata.Presentation layer. which should still be open from the previous topic.Save the repository. Notice the sort settings for the Prod Category and Amount Sold columns. 17. 20.Place the cursor over the icon to display the screenshot and use it as a reference to create a query. If there are Error messages. you must correct the errors before continuing.Check in changes. 19.Click Yes when prompted to check global consistency. 21. 23. close the Consistency Check Manager. If the repository is consistent (no Error messages). 22.Expand the Times folder. 18. 85 .

Hold down the Ctrl key and click the Calendar Year column to open the Create/Edit Filter dialog box. 29. 26.Click 2001 to add it to the Value field.Click Results. 28. 86 . Only partial results are shown in the picture.25.Click the All Choices link.Click OK to close the Create/Edit Filter dialog box. The filter is added to the request. 27.

Leave Answers open. multiple presentation catalogs can refer to the same business model. However. You can use the Presentation Tables tab in the Presentation Catalog properties dialog box to reorder.30. Presentation catalogs contain presentation tables. and rename data as necessary for the set of users. They cannot span business models. Presentation catalogs have to be populated with content from a single business model. Changes to 87 . sort. Organizing the Presentation Layer The Presentation layer is built after the Physical layer and Business Model and Mapping layer and adds a level of abstraction over the Business Model and Mapping layer. such as Oracle BI Answers. For example. organize the data in a way that aligns with the way users think about the data. You can also use this tab to access the Presentation Table dialog box. or delete Presentation layer tables. You typically create Presentation layer objects by dragging objects from the Business Model and Mapping layer. You also can manually create catalogs and folders based on the needs of your users. where you can create and edit tables. Simplifying the view of the data for users makes it easier to craft queries based on users’ business needs because you can expose only the data that is meaningful to the users. It is the view of the data seen by end users in client tools and applications. The Presentation layer provides a means to further simplify or customize the Business Model and Mapping layer for end users. you can organize columns into catalogs and folders. Corresponding objects are automatically created in the Presentation layer. Presentation catalogs allow you to show different views of a business model to different sets of users.

the Presentation layer do not impact corresponding objects in the Business Model and Mapping layer. The presentation column names are. Use presentation tables to organize columns into categories that make sense to the user community. which should still be open in online mode in the Administration Tool. 2. 88 . perform the following steps: 1. Presentation tables appear as folders in the Oracle BI user interface. Return to the SH repository. Use the Columns tab in the Presentation Table properties dialog box to reorder. such as Oracle BI Answers. 3. Presentation tables contain presentation columns. Presentation columns define the columns used to build queries in the Oracle BI user interface. To provide a convenient organization for your end users. by default. In the Presentation layer. A presentation table can contain columns from one or more logical tables. identical to the logical column names in the Business Model layer. The names and object properties of the presentation tables are independent of the logical table properties. double-click the SH presentation catalog to open the Presentation Catalog dialog box. where you can create and edit columns. sort. you can drag a column from a single logical table in the Business Model and Mapping layer onto multiple presentation tables. or delete Presentation layer columns. You can also use this tab to access the Presentation Column dialog box. To organize the Presentation layer. Click the Presentation Tables tab. Presentation tables contain presentation columns.

click the Add button to open the Presentation Table dialog box. Adding -> in the description nests the table under the table above it. 6. Repeat the steps and create another presentation table named Fiscal with >Fiscal time attributes in the Description field. 5. 9. 8.4. Click OK to close the Presentation Table dialog box. Drag the tables or use the Up and Down buttons to rearrange the tables in the following order: ¾ Times 89 . Click the General tab and name the presentation table Calendar. The description displays as a tool tip in Answers. type -> Calendar time attributes. In the Description field. To create a new presentation Table. 7.

90 .Click OK to close the Presentation Table dialog box.¾ ¾ ¾ ¾ ¾ ¾ ¾ Fiscal Calendar Products Customers Channels Promotions Sales Facts 10. The new tables are added to the Presentation layer and the presentation tables are reordered. 13. A suggested approach is to order the columns hierarchically from top to bottom. 14.Drag the columns or use the Up and Down arrows to reorder the columns.Click OK to close the Presentation Catalog dialog box.Click the Columns tab. The column order is changed in the Presentation layer. 12.Double-click the Channels presentation table to open the Presentation Table dialog box. 11.

15.Click Yes when prompted to check global consistency.Use cut and paste to move all the fiscal columns from the Times presentation table to the Fiscal presentation table and all the remaining columns from the Times presentation table to the Calendar presentation table. 20.Save the repository.Return to Answers.Expand the Times presentation table. 21. If there are Error messages. close the Consistency Check Manager. 18. which should still be open from the previous topic. 91 . Use Shift+click and Ctrl+click to select multiple columns. If the repository is consistent (no Error messages). 17. you must correct the errors before continuing. 16. 19.Check in changes.Click Reload Server Metadata.

Verify that the Fiscal and Calendar folders are nested under the Times folder.Verify that the Channels columns appear as expected.Leave Answers open. 92 .Verify that the columns in the Fiscal and Calendar folders appear as expected. 23.22. 24. 25.

Static repository variables have values that are constant and do not change while Oracle BI Server is running. To create initialization blocks. Session variables are created and assigned a value when each user logs on. and dynamic repository variables. Initialization blocks are used to initialize dynamic repository variables. There are two types of session variables: system and nonsystem. System variables have reserved names and are used for specific purposes by Oracle BI Server. you perform the following steps: Create an Initialization Block for Session Variables Test the Initialization Block and Session Variables Create a Dynamic Repository Variable 93 . Repository variables are represented by a question mark icon in the Variable Manager. system session variables. A variable has a single value at any point in time. Oracle BI Server substitutes the value of a variable for the variable itself in the metadata. Dynamic repository variables have values that are refreshed by data returned from queries in initialization blocks. System and nonsystem variables are represented by a question mark icon in the Variable Manager. A repository variable has a single value at any point in time. There are two classes of variables: repository variables and session variables. session variables. such as authenticating users. Non-system variables are applicationspecific variables created by an Administrator. There are two types of repository variables: static and dynamic.Using Initialization Blocks and Variables You can use variables in a repository to streamline administrative tasks and modify metadata content dynamically to adjust to a changing data environment. Variables can be used instead of literals or constants in the Expression Builder in the Administration Tool. You use the Variable Manager to define variables and initialization blocks. and nonsystem session variables.

there are as many instances of a session variable as there are active sessions on Oracle BI Server. Each instance of a session variable could be initialized to a different value. 2. A session is an instance of a user running the client application. Unlike a repository variable. Unlike dynamic repository variables. Return to the SH repository. Click Session > Initialization Blocks. The session starts when the application is started and ends when the application is exited. perform the following steps: 1. When a user begins a session. however. 3. which should still be open in online mode in the Administration Tool. 94 . Oracle BI Server creates new instances of session variables and initializes them. Click Manage > Variables to open the Variable Manager.Create an Initialization Block for Session Variables Session variables are like dynamic repository variables in that they obtain their values from initialization blocks. the initialization of session variables is not scheduled. To create an initialization block for session variables.

Click the Edit Data Source button to open the Session Variable Initialization Block Data Source dialog box. Right-click in the white space on the right and select New Initialization Block. In the Session Variable Initialization Block dialog box. 6. type setUser in the Name field.4. 5. 95 .

type the following initialization string: select ':USER'. Click the Browse button and select SH > Connection Pool in the Select Connection Pool dialog box. Double-click Connection Pool or click the Select button to add the connection pool to the Session Variable Initialization Block Data Source dialog box. 96 . 2 from Dual 10. 'CountryManagers'. The initialization string is visible in the Session Variable Initialization Block dialog box. Click OK to close the Session Variable Initialization Block Data Source dialog box. In the Default Initialization String field. 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.7. 9. 8.

11. Click New to open the Session Variable dialog box. In the Name field. type USER. Click Yes when prompted about the USER session variable having a special purpose. 13. The USER variable is added to the Session Variable Initialization Block Variable Target dialog box. 15. 16. 97 . 12. Click OK to close the Session Variable dialog box. 14. Click Edit Data Target to open the Session Variable Initialization Block Variable Target dialog box.

The order is important. 98 . and LOGLEVEL. GROUP. Click Yes when promoted about the GROUP and LOGLEVEL session variables having a special purpose. The order of the variables must match the order of the values for the variables in the initialization string in the initialization block.17. Repeat the steps and add three more variables: UserCountry.

The variables are displayed in the Variable Target section of the Session Variable Initialization Block dialog box. The setUser initialization block is visible in the Security Manager. Click OK to close the Session Variable Initialization Block Variable Target dialog box. Check in changes. Click OK to close the Session Variable Initialization Block dialog box. 20. 21. Save the repository. 22.18. 99 . Click Action > Close to close the Variable Manager. 19.

Right-click the white space in the right pane and select New Security Group. Name the group CountryManagers. 100 . 2. 4. Click the Permissions button to open the User / Group Permissions dialog box. 5. Click Groups in the left pane. Click Manage > Security to open the Security Manager. 3.Test the Initialization Block and Session Variables 1.

10. Click Select to add Customers to the User / Group Permissions dialog box. Click the Add button.6. 9. Click the Filters tab. 7. Click the Customers presentation table. Click the Expression Builder button (three dots) on the right to open the 101 . 8.

11. 13. 102 . 14. 12.Expression Builder (you may need to scroll to see the button). The filter is added in the User / Group Permissions dialog box. Select Logical Tables > Customers > Country and then click the Insert button to add Country to the formula. Click OK to close the Expression Builder. Select Session Variables > UserCountry and click the Insert button to add UserCountry to the formula as an argument in the VALUEOF() function. Click the = operator to add it to the formula.

23. 24.Amount Sold. The results of the query should correspond to the the user's country (Kurt = Germany. or Karen. Times. Keiko = Japan. Click Results. Click OK to close the Group dialog box. Return to Answers.Country. 20. Karen = United States of America). Sales Facts. Charles. Click OK to close the User / Group Permissions dialog box.Calendar Year. 22. Click Action > Close to close the Security Manager.Calendar. Charles = United Kingdom. 21. Create the following query: Customers. Test the initialization block by logging in to Answers as one of the users in the initialization block: Kurt. CountryManagers is added as a group in the Security Manager. 17. Keiko. Check in changes. Save the repository.15. 18. 103 . Log out of Answers. 19. The picture shows the results when the user = Kurt. 16.

Click Manage > Variables to open the Variable Manager.25. Return to the SH repository open in online mode. Click Edit Data Source to open the Repository Variable Init Block Data Source dialog box. Leave Answers open. Create a Dynamic Repository Variable 1. Name the initialization block getMaxSalesDate. Right-click the white space and select New Initialization Block to open the Repository Variable Init Block dialog box. Click the Browse button to open the Select Connection Pool dialog box. 2. 7. 6. 3. 5. Click Repository > Initialization Blocks. 104 . 4.

CALENDAR_MONTH_ID from TIMES WHERE TIME_ID = (select max(TIME_ID) from SALES) 10. CALENDAR_YEAR. 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.Click OK to close the Repository Variable Init Block Data Source dialog box. type the following SQL: select TIME_ID.8. 105 . In the Default Initialization String field. The connection pool and initialization string are added to the Repository Variable Init Block dialog box. CALENDAR_MONTH_DESC. 9.

12. maxYear.Use the New button to create four variables: maxSalesDate.Click Edit Data Target to open the Repository Variable Init Block Variable Target dialog box.11. 106 .

13. The variables appear in the Variable Target field in the Repository Variable Init Block dialog box. The order is important.Click Edit Data Source to open the Repository Variable Init Block Data Source dialog box. The order of the variables must match the column order in the initialization string. 107 . 16. and maxMonthID. 14.maxMonthDesc. 15.Click Test and verify you get the results in the picture.Close Results.Click OK to close the Repository Variable Init Block Data Source dialog box. 17.Click OK to close the Repository Variable Init Block Variable Target dialog box.

Calendar Year.Click the Add Filter button for the Calendar Year column.Check in changes. The getMaxSalesDate initialization block is displayed in the Variable Manager. Sales Facts. 21. 24.Save the repository. 20.Amount Sold. 19. If the Consistency Check Manager displays any errors. edit the repository to correct the errors before continuing.Return to Answers.Select Repository > Initialization Blocks > Variables > Dynamic to see the variables displayed in the Variable Manager.Build the following query: Calendar. 25.Select File > Check Global Consistency.Click OK to close the Repository Variable Init Block dialog box. 23. 22. 108 .18. 26. If there are no error messages.Click Action > Close to close the Variable Manager. close the Consistency Check Manager.

In the Create/Edit Filter dialog box.Click OK to close the Create/Edit Filter dialog box.In the Server Variable field. type maxYear. The filter is added to the request. 29. 30.27. 28. click Add > Variable > Repository.Click Results and verify that Calendar Year returns the expected result. 109 .

xml to the network drive G:\. go to the Process Control page and change the BI Server to use the original SH. you need to specify the portion of the set that it does contain. Also. 2. sales quota numbers are stored in an XML file. To add quota information to the business model. SHQuota. Oracle BI Server needs to know the content of the sources in order to pick the appropriate source for the query. When individual sources at a given level contain information for a portion or fragment of the domain.xml.rpd that you backed-up as SH_backup. 110 . Import the XML data source into the repository 1. copy the file SHQuota. Return to the SH repository open in online mode. you perform the following steps. Select File > Import > from Database. Oracle BI Server can seamlessly access and process data from multiple sources in an efficient manner to satisfy users’ requests.Adding Multiple Sources Data is often partitioned into multiple physical sources for a single logical table in a business model. This equates to the folder /ora/ in the Linux file system. The goal is to provide seamless and efficient access from the users' perspective.rpd at the beginning of this entire tutorial. Import the XML data source into the repository Map the Logical Dimension Columns Setup Time Alias on imported XML source Create the quota measures Test the Quota Measures. You incorporate the quota numbers into the business model and create business measures to report variance from quota and percent of quota. When a logical table source does not contain the entire set of data at a given level. First. When there are multiple sources. In this example. the metadata is built so that Oracle BI Server handles the navigation to the appropriate source.

xml Leave the XSLT and other parameters blank. Click OK. Verify that Tables are checked and click Import. 5. select the top level SHQuota. Insert the URL: G:\SHQuota. Change the Connection Type to XML in the dropdown.xml object. In the Import dialog box. 6.3. The Import dialog box opens. Click OK to accept the default configuration for the XML Connection Pool 111 . 4.

xml 112 . Since this file needs to be accessed by the Linux server we need to change the path to the file. 8. Click the XML tab. When import completes. 9. Double-click the Table database object in the Physical layer (SHQuota) to open the Table dialog box.7.xml to /ora/SHQuota. close the Import dialog box and verify that the SHQuota table has been imported into the Physical layer. Change the URL from G:\SHQuota.

Click on the Columns tab.Likewise. 113 . 11.Since XML is all text by default. change the following other column types: ¾ Quota: DOUBLE ¾ Year: INT ¾ QtrNumber:INT 12. Click OK. 13. Double-click on Amt column and change Type to DOUBLE.Save the repository.Check in changes. 14.10. this time we need to manually tell the server what format the column data is expected in.Click OK to close the Table dialog box.

3. 114 . In the Business Model and Mapping layer. 4.Country in the Business Model and Mapping layer. expand Customers > Sources and note that there are two logical table sources: CUSTOMERS and COUNTRIES. Notice that a new logical table source.Map the Logical Dimension Columns 1. is created automatically. Drag the physical columns SubRegion and Region from SHQuota in the Physical layer to the corresponding logical columns in the Customers table in Business Model and Mapping Layer. Double-click the SHQuota logical table source in the Customers > Sources folder to open the Logical Table Source dialog box. 5. 2. SHQuota. Click the Column Mapping tab. Notice the logical to physical column mappings. Drag the physical column Country from SHQuota in the Physical layer to the logical column Customers.

Prod Category to Category and verify the logical table source mapping.6. 1. Select New Object > Alias. This can be easily achieved in most instances via the use of an alias. Setup Time Alias on imported XML source The Time Comparison measure functions Ago() and ToDate() used elsewhere in this tutorial enforce requirements on the physical tables. We need to use this approach for the imported XML file. the Time attributes must be in a separate physical layer table definition from other attributes. Right click on SHQuota. Call the object TimeAlias 115 . Specifically. Repeat the steps and map Products. 11. Click OK to close the Logical Table Source dialog box.

Create a foreign key join from the TimeAlias table to the SHQuota table: ¾ Click on the foreign key button: ¾ The icon should remain pushed in ¾ Now click first on the TimeAlias table and then click on the SHQuota table (The join path should appear as a line from the source to target as you drag the mouse between the first and second click) 4. Right-click on the XML database and select Physical Diagram > Selected Objects Only 3. The expression for the join should correctly map each column from parent to child but can be edited if it is not as shown below: 116 . Create a join on ALL COLUMNS by multi-selecting all columns from both table lists.2.

5. Save the repository.Since we don’t have a dedicated dimension table at the quarter level. 8. 9. Check in changes. this join on all columns ensures we can model the XML file as an aggregate time dimension without worrying about double-counting quotas. 117 . Check global consistency. Accept the table key creation by clicking Yes. 6. The joined Tables should appear in the Physical layer as follows: 7. Fix any errors before proceeding.

12. are created. Quota. 2. Notice that a new logical table source. Double-click Sales Facts. 5. and a new logical column. so rename Quota to Quota (000). Drag the column SHQuota. 4.Quota to open the Logical Table dialog box. Close the Logical Table dialog box. SHQuota. Click the Aggregation tab and set the aggregation rule to Sum. The Quota logical column states quota in thousands.Create the quota measures 1.Set the Level of the Quota (000) Measure according to the granularity of the XML file: 118 .Quota from the Physical layer onto the Sales Facts logical table. 3.

Click the Expression Builder button (three dots) to open the Expression Builder. 10.6. 7.Create the following formula: 1000*"SH". 9. Right-click Sales Facts and select New Object > Logical Column to open the Logical Column dialog box."Quota (000)" 119 ."Sales Facts". Check Use existing logical columns as the source. 8. Click the General tab and name the logical column Quota.

The Quota column is added to the business model.Select the Quota column.Amount Sold and select Calculation Wizard.Click Next.11.Click Next.Close the Expression Builder. 14. 12. 120 . The formula displays in the Logical Column dialog box.Right-click Sales Facts.Close the Logical Column dialog box. 15. 13. 16.

19. In the Calculation Name field. 18. name the calculation Variance from Quota.Uncheck Percent Change.17. 20.Make sure Change is selected. In the Calculation Name field. 21.Click Next.In the Finish window. 121 . verify the calculations that will be created by the Calculation Wizard. leave the name as is: % of Quota.Check Percent and make sure it is selected.

122 . 23. edit the repository to correct the errors before proceeding. 24.Click Finish.Save the repository. and % of Quota measures to the Sales Facts presentation table. 25. 26.22. If you receive any Error messages. Quota.Add the Quota (000). The calculation measures are added to the business model. Test the Quota Measures.Check in changes. Variance From Quota.Check global consistency.

(Please note that SHQuota contains data only for 2001).Variance From Quota.Amount Sold. 6. Click Manage Sessions. 5.Calendar Year. 4. Create the following filter: ¾ Calendar Year is equal to / is in 1999. 2000. 2001. 11. 8. Sales Facts. Drill down on 2001. Reload Server Metadata.Quota. Sales Facts. Log out and then log back in as Administrator with password Administrator. Examine the query log Click Settings > Administration. Create the following request: Calendar. Click Results. 9.1. 7. Notice that two separate queries are executed to collect the data from the ORCL database and the SHQuota. 10. Sales Facts.xml file: 123 . Return to Answers.% of Quota. 2. Sales Facts. Locate the last query run under Cursor Cache and click View Log. 3.

D1.CALENDAR_QUARTER_DESC as c3.-------------------.xml</NQSDatabaseName><NQSUser></NQSUser>< NQSPassword></NQSPassword><NQSQuery><NQSColumn> <NQSColumnType>int</NQSColumnType> <NQSColumnAlias>c2</NQSColumnAlias> <NQSColumnName>Year</NQSColumnName> <NQSColumnFullName>//Table/QUOTA/Year</NQSColumnFullName> <NQSTableName>SHQuota</NQSTableName> <NQSTableAlias>4194</NQSTableAlias> <NQSTableAliasName>SHQuota</NQSTableAliasName> <NQSTableFullName>/ora/SHQuota.c1 as c3 from SAWITH0 order by c2 +++Administrator:b5ed0000:b5ed000b:----2007/05/22 01:16:07 -------------------.xml (id: <<46004>>): <NQSQueryInput><NQSDatabaseName>G:\SHQuota. SAWITH0.CALENDAR_YEAR = 2001 ) group by T268.CALENDAR_QUARTER_DESC ASC) as c4 from TIMES T268.c1 as c1. SALES T245 where ( T245. D1.CALENDAR_QUARTER_DESC ORDER BY T268. T268.TIME_ID and T268.c2 as c1. SAWITH0.xml</NQSTableFullName> </NQSColumn> <NQSColumn> <NQSColumnType>string</NQSColumnType> <NQSColumnAlias>c3</NQSColumnAlias> <NQSColumnName>QtrDesc</NQSColumnName> <NQSColumnFullName>//Table/QUOTA/QtrDesc</NQSColumnFullName> <NQSTableName>SHQuota</NQSTableName> <NQSTableAlias>4194</NQSTableAlias> <NQSTableAliasName>SHQuota</NQSTableAliasName> 124 .c4 = 1 ) ) select SAWITH0.c2 as c2. T268. ROW_NUMBER() OVER (PARTITION BY T268.CALENDAR_QUARTER_DESC.Sending query to external gateway database named G:\SHQuota.TIME_ID = T268.CALENDAR_YEAR ) D1 where ( D1.Sending query to database named SH (id: <<46098>>): WITH SAWITH0 AS (select D1.c3 as c2.AMOUNT_SOLD) as c1. T268.c3 as c3 from (select sum(T245.CALENDAR_YEAR as c2.

Rows 201.<NQSTableFullName>/ora/SHQuota. bytes 224 retrieved from database query id: <<46098>> 12. and subsequently incorporated into Oracle BI Interactive Dashboards and Oracle BI Delivers. 14. Executing Direct Database Requests Users with the appropriate permissions can create and issue a direct database request directly to a physical back-end database. 13. bytes 9648 retrieved from database query id: <<46004>> +++Administrator:b5ed0000:b5ed000b:----2007/05/22 01:16:08 -------------------.Query Status: Successful Completion +++Administrator:b5ed0000:b5ed000b:----2007/05/22 01:16:08 -------------------. 15. you can create direct database requests. 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. By default. 125 .xml</NQSTableFullName> </NQSColumn> <NQSColumn> <NQSColumnType>double</NQSColumnType> <NQSColumnAlias>c5</NQSColumnAlias> <NQSColumnName>Quota</NQSColumnName> <NQSColumnFullName>//Table/QUOTA/Quota</NQSColumnFullName> <NQSTableName>SHQuota</NQSTableName> <NQSTableAlias>4194</NQSTableAlias> <NQSTableAliasName>SHQuota</NQSTableAliasName> <NQSTableFullName>/ora/SHQuota. Close the query log. Click Finished to close the Session Management screen.xml</NQSTableFullName> </NQSColumn> </NQSQuery></NQSQueryInput> +++Administrator:b5ed0000:b5ed000b:----2007/05/22 01:16:08 -------------------. Leave Answers open. this privilege is set only for users defined as Presentation Server Administrators.Rows 4. The results of the request can be displayed and manipulated within Oracle BI Answers. Click Close Window to close the Oracle BI Presentation Services screen.

It can be changed by a Presentation Server Administrator. 126 . In Answers. To execute a direct database request. 3. click Settings > Administration. In the Oracle BI Presentation Service Administration screen. Note that the Edit Direct Database Requests privilege is granted to Presentation Server Administrators. 5. By default. Click (not permitted) to open the Change Privilege Permissions screen. you can issue physical requests. 2. 4. perform the following steps: 1. By default. Note that the Execute Direct Database Requests privilege is not granted to anyone. scroll down to Answers. click Manage Privileges to open the the Privilege Administration screen. the Administrator user is a member of this group. In the Privilege Administration screen.Execute Direct Database Requests: If this privilege is set for you. this privilege is not enabled for anyone.

. 8. 127 . Click the Add button next to Presentation Server Administrators to give this group explicit access to this privilege. Notice the change to the privilege permissions for Execute Direct Database Requests. Click Close Window to close the Oracle BI Presentation Services Administration screen. 9.6. 10 Click the Answers link to return to the Answers start page. 7. Click Finished to close the Privilege Administration screen. Click Finished to close the Change Privilege Permissions screen.

14 Click Validate SQL and Retrieve Columns to display the columns from the . source enclosed in double quotes ("SH". type the connection pool name for the SH data . Your results should look similar to the screenshot. 15 Click Results. 13 In the SQL Statement field."Connection Pool" in this example). . 12 In the Connection Pool field. . 16 Leave Answers open . Channels table.11 Click the Create Direct Request link. 128 . type SELECT * FROM Channels. .

The calculations are done ahead of time and the results are stored in the tables. The aggregate navigation capability of Oracle BI Server allows queries to use the information stored in aggregate tables automatically. Aggregate tables should have many fewer rows than the non-aggregate tables and. go to Tools > Utilities Select Aggregate Persistence Wizard and click Execute… 129 . In the Administration Tool. processing should be quicker. Hence from the business model we have already created. which are measures that have been aggregated (typically summed) over a set of dimensional attributes. Oracle BI Server allows users to concentrate on asking the right business questions. it is possible to quickly generate aggregate tables to improve system performance and have these tables automatically mapped into the central business model without the need to maintain these mappings manually. because the server decides which tables provide the fastest answers. There is a utility in Oracle BI EE called the Aggregate Persistence Wizard that enables model-first DWH development and maintenance. For Oracle BI Server to have enough information to navigate to aggregate tables. therefore.Using Aggregates Aggregate tables store pre-computed results. The following steps are included for Managing Aggregates: Run the Aggregate Persistence Wizard Execute the Aggregate Build Scripts Study the Aggregate Metadata and Test in Answers Run the Aggregate Persistence Wizard 1. Using aggregate tables is a very popular technique for speeding up query response times in decision support systems. you need to configure certain metadata in the repository. This eliminates the need for run-time calculations and delivers faster results to users. without query authors or tools having to specify aggregate tables in the queries.

Insert a path for the aggregate DDL file. Click Next Select the whole fact table SalesFacts Select the levels of aggregation for each dimension. G:\AggregateDDL.sql. these should only include the dimensions for which quotas are stored and to the following maximum depth: ¾ ProductDim: Category ¾ TimeDim: Quarter ¾ CustomerDim: Subregion Click Next 130 . Since we are including SHQuota fields. E.g.

"# Customers MAgo"."Quota (000)") at levels ("SH"."# of Customers"."CountDays"."Category Sales"."Unit Cost MAgo"."Unit Cost". Close the Administration Tool 131 ."Subregion") using connection pool "orcl SH"."Gross Profit Physical"."Quarter".."TimesDim". "SH"."CustomersDim". "SH"."Connection Pool" in "orcl SH"."Amount Sold MAgo"."Salesfacts"("Amount Sold"."ProductsDim"."Category"."SH" Check I am done and click Next Click Finish Save and Check-in Changes. Click Next Notice the logical SQL generated by the wizard "ag_Salesfacts" for "SH".Select the location for the aggregate within the existing SH schema.

"Quarter".."Salesfacts"("Amount Sold".. we will use the NQCmd utility.sql -u Administrator -p Administrator Notice the executed command and output results: create aggregates "ag_Salesfacts" for "SH"."Subregion") using connection pool "orcl SH"."Quarter"."Unit Cost MAgo"."# Customers MAgo". To execute the aggregate build scripts follow these steps: Open a command prompt: Start > Run > cmd Browse to G:\ and run the following command to create the Aggregate metadata nqcmd -d LinuxPEServer-SalesHistory -s g:\AggregateDDL."Unit Cost MAgo"."Quota (000)") at levels ("SH"."Amount Sold MAgo". "SH"."CustomersDim"."Salesfacts"("Amount Sold". "SH"."Category"."Connection Pool" in "orcl SH"."# of Customers"."Connection Pool" in "orcl SH"."Amount Sold MAgo"."Category Sales". As we have not configured the scheduler yet."SH" Statement execute succeeded Processed: 1 queries Next run the following command to create the Aggregate tables in the database nqcmd -d LinuxPEServer-SalesHistory -s g:\AggregateDDL."Unit Cost"."Category"."ProductsDim"."CountDays". if the BI Server is to be responsible for rebuilding aggregates on a regular basis these jobs can be set up in the BI Scheduler."CustomersDim". "SH"."CountDays"."ProductsDim"."Unit Cost"."Category Sales"."Gross Profit Physical".sql_DDL -u Administrator -p Administrator Notice the executed command and output results: prepare aggregates "ag_Salesfacts" for "SH"."Gross Profit Physical"."Quota (000)") at levels ("SH"."TimesDim"."# of Customers"."Subregion") using connection pool "orcl SH".exe utility on-demand or. "SH"."SH" Statement execute succeeded Processed: 1 queries 132 ."TimesDim".Execute the Aggregate Build Scripts These scripts can be executed either using the NQCmd."# Customers MAgo".

you can understand how preexisting aggregates are manually mapped into the business model by creating a new logical table source.Study the Aggregate Metadata and Test in Answers Open Admin Tool and connect to Oracle BI Server Online Notice the new Physical tables with a red icon have been created in the SH schema and new Logical table sources in the Business Model Studying the new SalesFacts table source. defining the appropriate expression to map each Logical column to the aggregate table: Then the aggregation level of the logical table source is configured for each dimension under the Content tab to tell the server when it should be used vs the detail tables or other aggregates: 133 .

g. The tables we created with the Aggregate Persistence Wizard have the following physical relationships: E. for the Time Dimension) that aggregate dimension tables are included and set to the correct level for that dimension.g.Also you can see from the new Logical Dimension Table sources (e. This further speeds up query times and ensures that tables are joined at the same level so as not to double count any records. Join on Category: 134 .

"% of Quota" saw_4 FROM SH ORDER BY saw_0 +++Administrator:b5fc0000:b5fc001b:----2007/05/22 05:42:10 -------------------. Locate the last query run under Cursor Cache and click View Log. Presentation: SH +++Administrator:b5fc0000:b5fc001b:----2007/05/22 05:42:10 135 . 9. Click Manage Sessions. "Sales Facts". 10.Quota saw_2. "Sales Facts". "Sales Facts".SELECT Calendar. "Sales Facts".General Query Info: Repository: BIEE.SQL Request: SET VARIABLE QUERY_SRC_CD='Report'. the server uses the aggregate definitions for the base measures to calculate the derived figures in the most optimal way."Calendar Year" saw_0. -------------------."Variance from Quota" saw_3.Test the aggregates by logging into Answers and creating the same query as before: Run the query and check the results 8."Amount Sold" saw_1. Notice also that even though the physical aggregate tables do not include any calculated measures like Variance from Quota or % Quota. Subject Area: SH. Click Settings > Administration. You can see from the SQL that the BI Server “aggregate awareness” ensured the new table was used without any guidance from the user and as a result all previously created queries will now run faster if they are at a sufficiently high level of granularity.

Calendar_Y00000809 as c3 from SA_Quarter0000097D T4315.-------------------.Amount_Sol00000140) as c2. 0) .nvl(SAWITH0.c2 * 100.c2 .c1 * 1000 as c3.Calendar_Y00000809) select distinct SAWITH0.c1 * 1000.0 / nullif( SAWITH0.Query Status: Successful Completion 136 . sum(T4383.c2 as c2. T4315. SAWITH0. ag_Salesfacts T4383 where ( T4315. nvl(SAWITH0. case when SAWITH0. 0) as c4.c1 * 1000 .Quota_0008059661B) as c1.Sending query to database named orcl SH (id: <<213522>>): WITH SAWITH0 AS (select sum(T4383.c1 * 1000 = 0 then NULL else SAWITH0. SAWITH0.Calendar_Q000007F5 ) group by T4315.c3 as c1.Calendar_Q000007F5 = T4383. 0) end as c5 from SAWITH0 order by c1 +++Administrator:b5fc0000:b5fc001b:----2007/05/22 05:42:10 -------------------.

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. the Ago function can produce sales for every month of the current quarter. Oracle BI Server provides Ago and ToDate functions for time series comparisons. the ToDate function can calculate Month to Date sales for a given year. 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 Ensure Correct Month Sort-Order for To-Date Calculation Test the Time Series Measures 137 . This allows users to make one request for the desired result. 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. Oracle BI Server runs multiple queries in parallel to get the results. The ToDate function is used to aggregate a measure attribute from the beginning of a specified time period to the currently displaying time. The Ago function calculates the aggregated value as of some time period shifted from the current time. and to enable researchers and early developers to proceed with building the first relational systems in the mid1970s.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. To create time series measures. You use the Expression Builder to apply the functions. For example. providing a context for the data. Yet. as Ralph Kimball states. The queries that run in the background to support the time measure are transparent to the user. along with the corresponding quarter ago sales. For example. 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. Both of these functions operate on measures.

3. 7. double-click the TimesDim dimension hierarchy to open the Dimension dialog box. Check the Chronological Key checkbox for Times Detail_Key. Click OK to close the Dimension dialog box. Expand TimesDim to the Times Detail level and double-click the Times Detail level to open the Logical Level dialog box.Identify a Dimension as a Time Dimension: 1. 2. In the Dimension dialog box. 138 . 4. check Time Dimension. 5. In the Business Model and Mapping layer. Click the Keys tab. 6. Click OK to close the Logical Level dialog box.

Select Functions > Time Series Functions > Ago. Name the logical column Month Ago Sales. Click the Expression Builder button (three dots) to open the Expression Builder. 3. 139 . Click Insert to add the Ago function to the Expression Builder. 4. 5. 6. Right-click Sales Facts and select New Object > Logical Column to open the Logical Column dialog box. 2. Check Use existing logical columns as the source.Create a Month Ago Measure 1.

Click the first <<expr>> in the expression.Click <<integer>> in the expression and type 1. 11.Select Time Dimensions > TimesDim and then double-click Month to add it to the expression. 8. Click the second <<expr>> in the expression. 9. 140 . The Ago function calculates the Amount Sold value one month prior to the current month.7. Select Logical Tables > Sales Facts and then double-click Amount Sold to add it to the expression. 10.

Click OK to close the Logical Column dialog box. The formula is displayed in the Logical Column dialog box. 13.Click OK to close the Expression Builder. 141 .12.

7. 5. 4. Right-click Sales Facts and select New Object > Logical Column to open the Logical Column dialog box. 142 . Insert a minus sign in the expression. Select Logical Tables > Sales Facts and then double-click Amount Sold to add it to the expression. Click OK to close the Logical Column dialog box.Create a Change Month Ago measure 1. Click the Expression Builder button to open the Expression Builder. Check Use existing logical columns as the source. Select Logical Tables > Sales Facts and then double-click Month Ago Dollars to add it to the expression. 3. 2. 9. Click OK to close the Expression Builder. The formula is displayed in the Logical Column dialog box. Name the logical column Change Month Ago Dollars. 8. 6.

Click the first <<expr>>. Select Logical Tables > Sales Facts and then double-click Amount Sold. 4. Select Functions > Time Series Functions and double-click ToDate to insert the expression. 2. 3.Create a To-Date Measure 1. 7. Open the Expression Builder. Select Use existing logical columns as the source. Name the new logical column Year To Date Sales. 5. 143 . 6. Right-click Sales Facts and select New Object > Logical Column.

11. Select Time Dimensions > TimesDim and the double-click Year to add it to the expression. 144 . 9. Click the second <<expr>>. 10. Click OK to close the Logical Column dialog box. The formula is displayed in the Logical Column dialog box. Click OK to close the Expression Builder.8.

Click the Set button. 5. 6. Double-click Calendar Month Name to open the logical column dialog box. 4. 8. 2. expand the Times logical table. Select Calendar Month Desc and click OK. In the Business Model and Mapping layer. 3. The Calendar Month Name column is now automatically sorted by Calendar Month Desc whenever it is used in an Answers query.Ensure Correct Month Sort-Order for To-Date Calculation 1. 7. 145 . The sort order column displays in the Logical Column dialog box. Drag the three time series measures from the Business Model and Mapping layer to the Sales Facts presentation table. Click OK to close the logical column dialog box. Check in changes.

Calendar Month Name ¾ Sales Facts. Create the following query and filter in Answers: ¾ Times.Year To Date Sales ¾ Calendar Year is equal to / is in 2001 3. Test the Time Calculations 1. See here for how to resolve any Time dimension errors related to imported XML data source. Return to Answers and reload server metadata.Save the repository.Change Month Ago Sales ¾ Sales Facts. 146 .Amount Sold ¾ Sales Facts. Fix any errors before proceeding. 2.Month Ago Sales ¾ Sales Facts.9. 10. Check global consistency. Click Results.

Business Model and Mapping. 147 . you should have learned how to: Build the Physical. you can refer to: Additional OBEs on the OTN Web site. 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 Related Information To learn more about Oracle Business Intelligence.Summary In this lesson.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->