Beruflich Dokumente
Kultur Dokumente
Purpose This tutorial shows you how to use the Oracle BI EE Administration Tool to build, modify, enhance, and manage an Oracle BI repository. Time to Complete Approximately 4 hours
Topics
This tutorial covers the following topics: Overview 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
Overview
This tutorial shows you how to build an Oracle BI metadata repository. You learn how to import metadata from databases and other data sources, simplify and reorganize the imported metadata into a business model, and then structure the business model for presentation to users who request business intelligence information via Oracle BI user interfaces, such as Oracle BI Answers and Oracle BI Interactive Dashboards. Back to Topic List
Prerequisites
Create a directory named SetupFiles under <InstallDrive>. Download and extract the SH.zip file from here to this directory named SetupFiles. This tutorial is for a Windows environment only. Note: If you are a Oracle employee and are using the VMWare environment, you can skip the subtopic Create an ODBC Data Source. Make sure you have 2 GB RAM and 15 GB hard disk space and have VMWare 1.5.x installed on your machine. If you do not have VMWare software, download a copy of VMWare Player from http://www.vmware.com/download/player/. For all others, before starting this tutorial, you should meet the following prerequisites: 1. Have access to or have installed Oracle 10g Database. 2. Have access to or have installed the sample schema. This tutorial uses the SH schema included in the Oracle10g Database. You can also install the schema by following the instructions found in the Installing the Sample Schemas and Establishing a Database Connection OBE tutorial. 3. Have access to or have installed Oracle BI EE 10.1.3.2.
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 Create a New Repository To create a new repository, perform the following steps: 1. Click Start > Programs > Administrative Tools > Services. 2. In the Services dialog box, stop the Oracle BI Server service.
3. Click Start > Programs > Oracle Business Intelligence > Administration to open the Oracle BI Administration Tool. 4. Click File > New to open the New Repository dialog box.
5. In the New Repository dialog box, the Repository folder is selected by default. Name the file
SH.rpd.
6. Click Save. The new repository opens in the Administration Tool and displays three empty layers: Presentation, Business Model and Mapping, and Physical. If necessary, select Tools > Options > Show toolbar to display the toolbar.
The Physical layer is where information on physical data sources is stored. The Business Model and Mapping layer is where measurements and terms used in business are mapped to the physical data sources. The Presentation layer is where the business model is customized for presentation to the user. You can work on each layer at any stage in creating a repository, but the typical order is to create the Physical layer first, then the Business Model and Mapping layer, and then the Presentation layer. Leave the Administration Tool open. Back to Topic Create an ODBC Data Source An ODBC data source is needed to import schema information about a data source into an Oracle BI Server repository. To create an ODBC data source for importing the SH schema information, perform the following steps: 1. Click Start > Programs > Administrative Tools > Data Sources (ODBC) to open the ODBC Data Source Administrator.
The Create New Data Source dialog box opens. 3. In the Create New Data Source dialog box, select the Oracle driver.
4. Click Finish to open the Oracle ODBC Driver Configuration dialog box. 5. In the Oracle ODBC Driver Configuration dialog box, enter a Data Source Name (this can be any name), select the appropriate TNS Service Name from the drop down list (ORCL in this example), and enter SH as the User ID for the SH schema.
6. Click Test Connection to open the Oracle ODBC Driver Connect dialog box. 7. In the Oracle ODBC Driver Connect dialog box, enter the password SH for the SH schema and click OK.
8. You should see a "Testing Connection" message indicating the connection is successful.
9. Click OK to close the Testing Connection message. 10. Click OK to close the Oracle ODBC Driver Configuration dialog box. 11. Verify that the SH system data source is added in the ODBC Data Source Administrator and click OK to close the ODBC Data Source Administrator.
Back to Topic Import SH Schema To import the SH schema information into the repository, perform the following steps:
1. In the Oracle BI Administration Tool, click File > Import > from Database . . .
2. In the Select Data Source dialog box, select the SH ODBC DSN you created in a previous step, enter SH as the user name and password, and click OK to open the Import dialog box.
4. Expand the SH schema folder and use Ctrl + Click to select the following tables: CHANNELS, COSTS, COUNTRIES, CUSTOMERS, PRODUCTS, PROMOTIONS, SALES, TIMES
5. Verify that only the Tables and Keys checkboxes are selected, which is the default, and click the Import button. The Connection Pool dialog box opens. It is best practice to only import objects needed to support your business model. However, dont worry if you import extra objects at this point. You can always delete objects later if they do not support your business model. 6. In the Connection Pool dialog box, on the General tab, verify that the call interface is set to Default (OCI 10g) and change the data source name to the appropriate tnsnames.ora entry ( ORCL in this example). Please note that this is the TNS service name, not the ODBC DSN.
7. Leave the rest of the settings as they are and click OK to close the Connection Pool dialog box. The import process starts. 8. When the Import process completes, click Close to close the Import dialog box. 9. In the Physical layer of the repository, expand the SH schema folder and verify that the correct tables are imported.
10. To verify connectivity, click Tools > Update All Row Counts. 11. When update all row counts completes, verify that the row counts are displayed in the Physical layer of the Administration Tool:
Back to Topic Create Physical Joins To create physical joins in the Physical layer of the repository, perform the following steps: 1. In the Physical layer, right-click the SH schema folder and select Physical Diagram > Object (s) and All Joins. Alternatively, you can select the SH database object and then click the Physical Diagram button on the toolbar.
2. In the Physical Diagram, if the tables are too big, right-click in the white space, select Zoom, and adjust the size.
3. Rearrange the tables so they are all visible in the Physical Diagram.
5. Click the Channels table and then the Sales table. The Physical Foreign Key dialog box opens.
It matters which table you click first. The join is creating a one-to-many (1:N) relationship that joins the key column in the first table to a foreign key column in the second table. The Administration Tool makes a best "guess" and automatically determines which columns should be included in the join. Make sure the join expression is: CHANNELS.CHANNEL_ID = SALES.CHANNEL_ID 6. Click OK to close the Physical Foreign Key dialog box. The join between Channels and Sales is displayed in the Physical Diagram.
7. Continue to create the following joins: PROMOTIONS.PROMO_ID = SALES.PROMO_ID TIMES.TIME_ID = SALES.TIME_ID PRODUCTS.PROD_ID = SALES.PROD_ID CUSTOMERS.CUST_ID = SALES.CUST_ID COUNTRIES.COUNTRY_ID = CUSTOMERS.COUNTRY_ID Note that Countries joins to Customers and Costs in not joined for now. All other tables join directly to Sales.
When you are finished, click the X in the upper right corner to close the Physical Diagram. 8. Select File > Save or click the Save button on the toolbar to save the repository. 9. Click No when prompted to check global consistency. Checking Global Consistency checks for errors in the entire repository. Some of the more common checks are done in the Business Model and Mapping layer and Presentation layer. Since these layers are not defined yet, bypass this check until the other layers in the repository are built. You learn more about consistency check later in this tutorial. 10. Leave the Administration Tool and the SH repository open for the next topic. Congratulations! You have successfully created a new repository, set up an ODBC data source, imported a table schema from an external data source into the Physical layer, and defined keys and joins. In the next topic you learn how to build the Business Model and Mapping layer of a repository. Back to Topic Back to Topic List
2. In the Business Model dialog box, name the business model SH and leave the Available for queries box unchecked. The Description edit box is used to add a comment for yourself or another developer. Leave it empty.
3. Click OK to close the Business Model dialog. The new SH business model appears in the Business Model and Mapping layer. The red symbol on the business model indicates it is not yet enabled for querying. You enable the business model for querying later after the Presentation layer is defined and the repository passes a global consistency check.
Back to Topic Create Logical Tables To create a new logical table, perform the following steps: 1. In the Business Model and Mapping layer, right-click the SH business model and select New Object > Logical Table.
2. In the Logical Table dialog box, name the table Sales Facts.
3. Click OK to close the Logical Table dialog. The Sales Facts logical table appears in the SH business model in the Business Model and Mapping layer. The Sources folder is populated in the next step when you create a logical column.
Back to Topic Create Logical Columns To create a logical column, perform the following steps: 1. In the Physical layer, expand the Sales physical table.
3. Drag the AMOUNT_SOLD column from the Physical layer to the Sales Facts logical table in the Business Model and Mapping layer. A new AMOUNT_SOLD logical column is added to the Sales Facts logical table.
4. Expand the Sources to see the logical table source that was created automatically when you dragged the AMOUNT_SOLD column from the Physical layer. Logical table sources define the mappings from a logical table to a physical table. A logical tables Sources folder contains the logical table sources. Because you dragged a column from the Physical layer, the logical table source name, SALES, is the same name as the physical table. However, it is possible to change names in the Business Model and Mapping layer without impacting the mapping.
5. In the Business Model and Mapping layer, double-click the AMOUNT_SOLD logical column to open the Logical Column dialog box.
8. Click OK to close the Logical Column dialog box. Notice that the logical column icon is changed to indicate an aggregation rule is applied.
Back to Topic Create Logical Joins To create logical joins in the business model, perform the following steps: 1. Select the following tables in the Physical layer. Select only these tables:
2. Drag the selected tables from the Physical layer onto the SH business model folder in the Business Model and Mapping layer. This automatically creates logical tables in the Business Model and Mapping layer. Notice that each logical table has a yellow table icon. In the Business Model and Mapping layer, this indicates a fact table. Because you have not yet created the logical joins, all table icons are yellow. The icon color for dimension tables changes to white in a later step when you create logical joins.
3. Right-click the SH business model and select Business Model Diagram > Whole Diagram.
4. Rearrange the table icons so they are all visible. Place the Sales Facts table in the middle. Adjust the zoom factor, if desired.
6. Click the Channels table icon first and then click the Sales Facts table icon in the Logical Table Diagram window. The order is important. The second table clicked is the many side of the relationship. The Logical Join dialog box opens. Leave the default values as they are, but note which properties you can set: name, business model, tables, driving table, join type, and cardinality. Also note which properties you cannot set: the join expression and the join columns. Typically, when defining logical joins, you leave the defaults as they are.
7. Do not change the default values, click OK, and verify your work in the Logical Table Diagram. Notice that the fact table, Sales Facts, is at the many end of the join:
8. Repeat the steps for the remaining tables. Your final result should look similar to the picture.
9. Click the X in the upper right corner to close the Logical Table Diagram. Notice that the color of the table icons for the dimension tables has changed to white in the business model. In a business model, a yellow icon indicates a fact table and a white icon indicates a dimension table. Defining the join relationships determined which tables are the logical dimension tables and which is the logical fact table. A fact table is always on the many side of a logical join. You now have a logical star schema consisting of one logical fact table, Sales Facts, and five logical dimension tables: Channels, Customers, Products, Promotions, and Times.
Back to Topic Rename Business Model Objects To use the Rename Wizard to rename the objects in the business model, perform the following steps: 1. Click Tools > Utilities.
2. In the Utilities dialog box, click Rename Wizard and then Execute.
3. In the Rename Wizard, click the Business Model and Mapping tab and select the SH business model.
11. Click Change specified text. In the Find box, type an underscore. In the Replace box, type a space.
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.
17. Click Finish and verify that logical tables and logical columns in the Business Model and Mapping layer are changed as expected.
Back to Topic Delete Unnecessary Business Model Objects To delete logical columns that are not needed in the business model, perform the following steps: 1. For the Channels logical table in the Business Model and Mapping layer, use Ctrl + click to select the Channel Class ID and the Channel Total ID logical columns.
2. Right-click either of the highlighted columns and select Delete to delete the columns.
4. Verify that the Channels logical table now has only four logical columns.
5. Repeat the steps to delete the following logical columns in the Customers table: Cust City ID Cust State Province ID Country ID Cust Main Phone Number Cust Total ID Cust Src ID Cust Eff From Cust Eff To Cust Valid
6. Place the cursor over the icon to display the screenshot and verify that the Customers logical table has only the following logical columns:
7. Place the cursor over the icon to display the screenshot and repeat the steps to delete the highlighted logical columns in the Products table.
8. Place the cursor over the icon to display the screenshot and verify that the Products logical table has only the following logical columns:
9. Place the cursor over the icon to display the screenshot and repeat the steps to delete the highlighted logical columns in the Promotions table.
10. 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. 12. Save the repository. Do not check global consistency.
Back to Topic Build Dimension Hierarchies Dimension hierarchies introduce formal hierarchies into a business model, allowing Oracle BI Server to calculate useful measures and allowing users to drill down to more detail. In a business model, a dimension hierarchy represents a hierarchical organization of logical columns belonging to a single logical dimension table. Common dimension hierarchies used in a business model are time periods, products, customers, suppliers, and so forth.
Dimension hierarchies are created in the Business Model and Mapping layer and end users do not see them in end user tools such as Oracle BI Answers or Interactive Dashboards. In each dimension hierarchy, you organize dimension attributes into hierarchical levels. These levels represent the organizational rules and reporting needs required by your business. They provide the structure that Oracle BI Server uses to drill into and across dimensions to get more detailed views of the data. Dimension hierarchy levels are used to perform aggregate navigation, configure level-based measure calculations, and determine what attributes appear when Oracle BI users drill down in their data requests. To build the Channels dimension hierarchy in the SH business model, perform the following steps: 1. Right-click the Channels logical table and select Create Dimension.
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 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.
8. Drag the Channel Class column from the Channel Detail level to the Class level to associate the logical column with this level of the hierarchy.
10 In the Logical Level Key dialog box, verify that Channel Class and Use for drilldown are selected. The level key defines the unique elements in each logical level. Each level key can consist of one or more columns at this level.
11. Click OK to close the Logical Level Key dialog box. The Channel Class column now displays with a key icon.
12. Right-click the Class level and select New Object > Parent Level.
13. In the Logical Level dialog box, name the logical level Channel Total Attribute and set the Number of elements at this level to 1.
14. Click OK to close the Logical Level dialog box. The Channel Total Attribute level is added to the hierarchy.
15. Right-click the Channel Total Attribute level and select Expand All.
16. Drag the Channel Total column from the Channel Detail level to the Channel Total Attribute . level.
17. Right-click Channel Total and select New Logical Level Key.
18. In the Logical Level Key dialog box, verify that Channel Total and Use for drilldown are selected.
19. Click OK to close the Logical Level Key dialog box. The Channel Total column now displays with a key icon.
20. Right-click the Channel Desc column and select New Logical Level Key.
21. In the Logical Level Key dialog box, notice that Use for drilldown is selected.
22. Click OK to close the Logical Level Key dialog. Both Channel Desc and Channel ID display with key icons.
23. Double-click the Channels Detail level to open the Logical Level dialog box.
27. In the Logical Level Key dialog box, uncheck Use for drilldown.
28. Click OK to close the Logical Level Key dialog box. Notice that the key icons are different. Channel Desc is used for drill down Channels Detail_Key is not. Later, when a user drills down in Answers or a dashboard, the default drill is to the level key that has Use for drilldown checked in the next lowest level. Based on this example, when a user drills down from the Channel Class column (the next highest level), the default is to drill down to the Channel Desc column, not the Channels Detail_Key column.
29. Click OK to close the Logical Level dialog box. 30. Place the cursor over the icon to display the screenshot and verify that the finished ChannelsDim hierarchy looks like the picture.
31. Save the repository. Do not check global consistency. 32. Optional: Build a dimension hierarchy for the Products logical table. Use the preceding steps, the screenshot, and the characteristics below as a guide. Don't worry if you cannot complete this step. In Part Two of this OBE, you use a different repository that already has the dimension hierarchies prebuilt.
The ProductsDim dimension hierarchy should have the following characteristics: For the Subcategory level, set Number of elements at this level to 21. For the Category level, set Number of elements at this level to 5. For the Product Total Attribute level, set Number of elements at this level to 1.
For the Products Detail level, uncheck Use for drill down for Products Detail_Key (Prod ID). Check Use for drill down for all other keys in the ProductsDim hierarchy. If you complete this step, save the repository. Do not check global consistency.
2. Expand the SH catalog in the Presentation layer. Notice that the tables and columns in the Presentation layer exactly match the tables and columns in the Business Model and Mapping layer. Notice also that dimension hierarchies are not displayed.
2. You should receive a message indicating that the repository is consistent and asking if you want to make it available for queries.
3. Click Yes to make the SH business model available for queries. The Consistency Check Manager displays.
4. If the Consistency Check Manager displays any Error messages, edit the repository to correct the inconsistencies and run the consistency check again. If you see only Warning and Best Practices messages, you can ignore the messages for now and click Close.
5. In the Business Model and Mapping layer, notice that the SH business model icon has changed to indicate the business model is now available for queries (the red circle with a line is gone).
6. Double-click the SH business model object to open the Business Model properties dialog box. Notice that Available for queries is checked.
7. Click OK to close the Business Model properties dialog box. 8. Save the repository. Click No when asked to check global consistency (you just checked it).
Back to Topic Enable Query Logging To enable query logging for the Administrator user, perform the following steps: 1. Select Manage > Security.
2. In the Security Manager, select Users in the left pane. The Administrator user appears in the right pane.
3. In the right pane, double-click Administrator. The User dialog box opens. 4. Verify that the User tab is selected. In the Password field, type Administrator and then confirm in the Confirm Password field. In the Logging level field, set the value to 2.
To test the repository, you need to generate some queries, retrieve the results, and examine the query log. You log query activity at the individual user level. Logging is intended for testing, debugging, and technical support. In production mode, logging is normally disabled because query logging can impact performance by producing very large log files. 5. Click OK to close the User dialog box. 6. Click Action > Close to close the Security Manager. 7. Save the repository. Do not check global consistency. 8. Select File > Close to close the repository.
Back to Topic Modify NQSConfig.ini In this step, you update the Repository and Cache sections of the initialization file, NQSConfig.ini. An entry in the Repository section of the initialization file instructs Oracle BI Server to load a specific repository into memory upon startup. If Oracle BI Server detects a syntax error while loading the repository, it logs the error to the server log file (...\\OracleBI\server\Log\NQServer.log). You also disable caching. Caching is typically not used during development, except to test the cache. 1. Navigate to ...\OracleBI\server\Config\ and open NQSConfig.INI with a text editor, such as Notepad. 2. Locate the [ REPOSITORY ] section and change the entry to Star = SH.rpd, DEFAULT;
3. In the [ CACHE ] section, immediately below the [ REPOSITORY ] section, change the ENABLE parameter from YES to NO.
Back to Topic Start Oracle BI Services In this step, you start the Oracle BI Server service to load the SH repository into memory. 1. Select Start > Programs > Administrative Tools > Services. 2. Start the Oracle BI Server service. Verify that the Oracle BI Presentation Server and Oracle BI Java Host services are started. If they are not started, start them. It is not necessary to start the Oracle BI Scheduler or Oracle BI Cluster Controller services. The services can be started in any order.
Back to Topic Use Oracle BI Answers to Execute Queries To start Oracle BI Answers and execute a query, perform the following steps: 1. Select Start > Programs > Oracle Business Intelligence > Presentation Services. 2. Log in to Oracle Business Intelligence as Administrator with password Administrator. 3. Click the Answers link.
5. In the left pane, click the Customers folder to expand it. Notice that the folders and columns in Answers match the folders and column in the Presentation layer of the repository.
6. Click the Cust State Province column in the left pane to add it to the request criteria on the right.
7. Click the Sales Facts folder in the left pane to expand it.
10. By default, results are displayed in a compound layout, consisting of a title and a table view.
Back to Topic Use Query Log to Verify Queries 1. Click Settings > Administration to open the Oracle BI Presentation Services Administration Window.
2. Click the Manage Sessions link to open the Session Management window.
3. In the Session Management window, under Cursor Cache, click the View Log link for the last entry.
4. The log displays the last query executed by Administrator. The log file should look similar to the picture.
Locate the SQL Request section. This section contains the logical SQL issued from Answers. Locate the General Query Info section, just below the SQL Request section. This section identifies the repository, subject area, and presentation catalog from which the query was run. Locate the Sending query to database named SH section, just below the General Query Info section. This section identifies the physical data source to which Oracle BI Server is connecting and the physical SQL that was generated. The rest of the file contains information such as query status, number of rows returned, and so forth. 5. Close the query log.
6. Click Finished to close the Session Management window. 7. Click Close Window to close the Oracle Bi Presentation Services Administration window. 8. Leave Answers open. Congratulations! Up to this point you have successfully built the Physical, Business Model and Mapping, and Presentation layers of a repository, run a consistency check, and tested the repository using Oracle BI Answers. For the remainder of this OBE you enhance the repository by performing tasks such as building calculation measures, adding multiple logical table sources, building variables and initialization blocks, mapping to aggregate tables, and so forth.