This action might not be possible to undo. Are you sure you want to continue?
Purpose This tutorial shows you how to use the Aggregate Persistence Wizard to create and model aggregate tables to increase query performance by precalculating frequently accessed measure aggregations. Time to Complete Approximately 1 hour
This tutorial covers the following topics: Overview Prerequisites Using the Aggregate Persistence Wizard Summary Related information Viewing Screenshots Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.) Note: Alternatively, you can place the cursor over each individual icon in the following steps to load and view only the screenshot associated with that step.
This tutorial shows you how to create and model aggregate tables using the Aggregate Persistence Wizard. Data warehouse performance bottlenecks are often due to measure aggregation (for example, summing orders at different levels of a dimensional hierarchy) that is being performed at run time. Having identified candidate aggregate tables for inclusion in your data warehouse, you use the Aggregate Persistence Wizard to create and model aggregates to relieve the bottleneck and precalculate and store the data for better query response. When you use the Aggregate Persistence Wizard to create aggregates, it is important that you have a fully functional business model, with a complete set of measures, dimensions, and hierarchies. Before building tables with the wizard, you should have conceptually designed the desired set of aggregates on paper. The conceptual design should include the set of aggregate stars by name, the set of facts in each star, and the dimensionality and grain of each. You should also determine the
database the aggregates are to be deployed in. This is usually the existing database that contains the base tables that are being aggregated. However, the tables can be placed in a different database. These minimum requirements for the logical and physical design details are sufficient to create the tables with the Aggregate Persistence Wizard. Back to Topic List
Before starting this tutorial, you should: 1 Have access to or have installed Oracle 10g Database (preferably version 10.2) . 2 Have access to or have installed the sample schema . This example uses the SH schema included in the Oracle10g Database. You can also install the schema by following the instructions 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.x . 4 Have set up Oracle BI Scheduler . 5 Have set up the Sales History (SH.rpd) repository by performing the following steps: . 1. Click Start > All Programs > Administrative Tools > Services. 2. In the Services dialog box, select Oracle BI Presentation Server, and then select Action > Stop to stop the service. Also, stop the Oracle BI Server. These services can be stopped in any order. 3. Create a directory named SetupFiles under <InstallDrive>. Download the SH.zip file from here, copy it to the SetupFiles directory, and extract the file. 4. Using Windows Explorer, navigate to the SetupFiles folder and copy the sh folder and its contents to <InstallDrive>:\OracleBIData\web\catalog. This is a backup of the Presentation Catalog corresponding to the Sales History content. 5. Open <InstallDrive>:\OracleBIData\web\config\instanceconfig.xml in Notepad and edit the CatalogPath section to point to the directory you just copied (as shown in the following screenshot). The path should be <InstallDrive>:/OracleBIData/web/catalog/sh.
6. Navigate to the SetupFiles directory and copy sh.rpd to <InstallDrive>:\OracleBI\server\Repository. 7. Open <InstallDrive>:\OracleBI\server\Config\NQSConfig.ini in Notepad and edit the repository name to point to the sh.rpd repository you just copied. In the Repository section, enter # before "Star" to comment out any other repository name entry. Then, below this entry, create a new line and enter Star = sh.rpd, DEFAULT; to point to your repository (as shown in the following screenshot):
Note: NQSConfig.ini is the initialization file read by the Business Intelligence Server when it starts up. It contains a number of parameters that control server settings and behavior. In this step, you have set up the parameter that informs the server to read the sh.rpd metadata repository. Note: The screenshots for this tutorial were taken in a Windows XP environment. Therefore, the Start menu options may vary slightly if you are using any other Windows environment. Back to Topic List
Using the Aggregate Persistence Wizard
In this topic, you understand the role and function of the Aggregate Persistence Wizard in creating and modeling aggregates to resolve query bottlenecks. Aggregate tables store precomputed results, which are measures that have been aggregated (typically summed) over a set of dimensional attributes. Using aggregate tables is a very popular technique for speeding up query response times in decision support systems. This eliminates the need for run-time calculations and delivers faster results to users. The calculations are done ahead of time and the results are stored in tables. Aggregate tables should have fewer rows than the nonaggregate tables and, therefore, processing should be quicker.
The aggregate persistence script is intended to be run after each extraction. For Oracle BI Server to have enough information to navigate to aggregate tables. typically nightly. The Aggregate Persistence Wizard enables you to automate the creation of physical aggregate tables and their corresponding objects in the repository. The Aggregate Persistence Wizard creates an Oracle BI Enterprise Edition SQL script.”“Unit PromotionsDim/”Promotions Cost. possibly. requiring complicated data definition language (DDL) and data manipulation language (DML) scripts to be written for creating tables in the databases involved. The script specifies each aggregate table to be created. error-prone process. This is a time-consuming and.”“Gross Profit.bat or any other script called by a custom program. The traditional process of creating aggregates for Oracle BI Server queries is manual. internal instructions to generate the corresponding physical and aggregate navigation metadata. these aggregated tables need to be mapped to the repository metadata to be available for queries. transformation. or it can be run as a . and loading (ETL) of the base tables. without query authors or tools having to specify aggregate tables in the queries. you use the Aggregate Persistence Wizard to create and model aggregate tables to support query performance. and data manipulation language (DML) to aggregate and load data from the base tables into the aggregate tables. Base Fact Table: SalesFacts Measures Dimension/Grain ProductsDim/”Products Detail” ChannelsDim/”Channels Detail” “Amount Sold. which is executed by the BI Server. It can be tedious.The aggregate navigation capability of Oracle BI Server allows queries to use the information stored in aggregate tables automatically. and its dimensions and grain. certain metadata in the repository must be correctly configured. This can be done by an Oracle BI EE Job Manager job. it generates DDL to create the required tables in the target database. Additionally. The conceptual design of your aggregate star includes the following characteristics. the facts from the business model that should be included in it. Oracle BI Server allows users to concentrate on asking the right business questions. When the BI Server runs the aggregate persistence SQL script. because the server decides which tables provide the fastest answers.” and many Detail” more TimesDim/”Times Detail” CustomersDim/”Customers Detail” orcl/SH Source Database . In this topic.
Select Start > All Programs > Oracle Business Intelligence > Administration. . you perform the following steps: Create a dedicated connection pool Build the aggregate table and metadata script Schedule an aggregate creation job Verify aggregates and metadata Test using Answers Back to Topic List To create a dedicated connection pool.Aggregate Fact Table: ag_Salesfacts Measures Dimension/Grain ProductsDim/Category ChannelsDim/NA “Amount Sold” PromotionsDim/NA TimesDim/”Times Detail” CustomersDim/”State Province” orcl/SH (the same as the source database) Source Database To build and model aggregates. perform the following steps: 1.
Select File > Open > Offline and select sh. Enter Administrator as the username and password. and click OK.2.rpd in <InstallDrive>:\OracleBI\server\Repository to open the repository in offline mode. .
. . Right-click the orcl SH database and select New Object > Connection Pool.3.
and then click OK. In the Connection Pool dialog box. Note that the SH database user is the schema owner of SH in the Oracle database. select the OCI 10g/11g connection type. The Aggregate Persistence Wizard creates an Oracle BI EE SQL script that is executed by the BI . enter Aggregate Connection Pool as the name. as well as read from and write to them. enter your database TNS Name and SH as the username and password. You use the schema owner's user ID for the aggregate connection pool because the connection pool must have privileges to create and drop tables.4.
. In the Confirm Password dialog box. 6. Select File >Save to save your changes. enter SH as the password again and click OK. 5. Select File > Close to close the repository.Server using the dedicated connection pool. Click No to decline the global consistency check. 7. You need a dedicated connection pool because end users would connect to the data warehouse with much more restrictive privileges.
In the Services dialog box. In the Open Online AnalyticsWeb dialog box.8. . enter Administrator as the username and password. start the Oracle BI Presentation Server and the Oracle BI Server. perform the following steps: 1. Select File > Open > Online. and click Open. Back to Topic To build the aggregate table and metadata script.
select Aggregate Persistence Wizard and click Execute. .2. Select Tools > Utilities. In the Utilities dialog box.
3. click Browse to specify the location and the name of the script you a creating. In the wizard's "Select file location" window. This option is used to create a second script that defines the . Do not select the Generate DDL File check box.
This file stores the aggregate specifications and is updated if more aggregates are specified subsequently. 5. 4. but does not populate them.aggregate tables on the database and repository. enter CREATE_AGG and ensure that the SQL command file (*. .sql) file type is selected. Click Open to close the Select Script dialog box. This is useful for database administrat who want to make granular changes to the database tables generated by the system. In the "File name" field. The Select Script dialog box opens with the BI Server's Repository directory that is selected by default.
you can select only one business model. this is the only availab business model. In this case. Click Next to proceed to the Select Business Model & Measures window. in which you specify the measure or fact table that you want to aggregate. select the SH business model.6. if more than one is available. . However. In the top pane.
expand the Salesfacts fact table. Again. you can select only one fact table per wizard execution Note. . single script.7. Subsequent SQL instructions created by the wizard are appended to the same. however. that you can reuse the wizard repeatedly to build each aggregate fact table that you want to build. In the bottom pane.
.8. Select the Amount Sold measure. Note that you can select multiple measures.
9. ProductsDim: Category TimesDim: Times Detail CustomersDim: State Province Leave the ChannelsDim and PromotionsDim dimensions blank. Click Next to proceed to the Select Dimensions & Levels window. Select the following levels to specify what leve of detail is stored in the aggregate table. . Leave the Use Surrogate Key option deselected.
It is also used to generate the Oracle BI metadata that is used to access the tables. 10 Click Next to proceed to the "Select output Connection Pool. Container & Name" window.In this step. ag_Salesfacts. Select Aggregate Connection Po in the Connection Pool field and the default table name that appears in the "Aggregate table name" field. you set the grain of the aggregate table. expand orcl SH and select the SH catalog. This grain is used to create the DDL for the tables and the aggregating DML for loading the tables. In the second pane. select t . In the top pane. orcl SH database. .
This script tells the BI Server what to name the star. it is added as another logical SQL statement in the script.The connection pool can be in a different database than the source. . If you choose to define another aggregate. and what its grain is. where to source it from. generates the aggregate tables based on the parameters defined in the other wizard windows. 11 Click Next to proceed to the Aggregate Definition window. Review the logical SQL. This window displays the Oracle BI EE logical SQL th . and th select I am done. what facts to include.
. Clic . The Complete Aggregate Script window is displayed to confirm that the script has been generated. Finish.12 Click Next.
sql script file was created. CREATE_AGG. .13 In Windows Explorer. navigate to <InstallDrive>:\OracleBI\server\Repository and verify that the .
. In the Job Manager window. Back to Topic To schedule an aggregate creation job. .sql file and add a delete aggregates. the old aggregates from the previous load must be dropped. statement to the beginning of the script. script is run after each load of the database. Because t . perform the following steps: 1 Select Manage > Jobs. select File > Open Scheduler Connection.14 Open the CREATE_AGG.
. Scheduler.2 Enter Administrator as the Administrator name and password and click OK to connect to the .
. .3 Select All Jobs and then select Jobs > Add New Job.
Select Run Now and click OK. weekly. Select . notice that you can set the script to run daily. NQCmd as the script type and specify AnalyticsWeb as the data source name (DSN) to connect to the BI Server.sql. . Finally. and Administrator as the user ID. or at other .4 Enter Aggregate Persistence Job as the name of the job. specify the location of the aggregate creation script. intervals. <InstallDrive>:\OracleBI\server\Repository\CREATE_AGG. 5 In the Trigger Type drop-down list.
open the SH repository in online mode and log in as Administrator/Administrator.6 Verify that the job completes successfully in the Job Manager. . . In the Physical layer. . perform the following steps: 1 Verify that the aggregates are created in the Physical layer of the repository. b. If necessary. a. ensure that the aggregates were created in the SH schema. There should be one new ag_SalesFacts aggregate and three new dimension aggregates in the Physical layer. Back to Topic To verify aggregates and metadata.
461 rows. Right-click each aggregate table and select Update Row Count to check connectivity. check out objects.142 rows SA_Categor…: 5 rows SA_State_P…: 145 rows SA_Times…: 1. and select the Foreign Keys tab in the Physical Table .Notice that the aggregate tables are indicated in red in the Administration tool. Double-click ag_SalesFacts. Confirm that you see the following row counts: ag_SalesFacts: 158. d. c.
click Cancel to close the Physical Foreign Key dialog box.properties dialog box. Ensure that joins are created between ag_SalesFacts and the new dimension aggregates. e. . When you are done. Double-click the foreign keys to view the join relationships in the Physical Foreign Key dialog box.
. a.f.ag_SalesFacts dialog box. open the Sources folder for the SalesFacts. Customers. Click Cancel to close the Physical Table . Times. and Products logical tables and ensure that new logical table sources are created for the aggregates. 2 Verify that the aggregates are created in the Business Model and Mapping layer of the repository. In the Business Model and Mapping layer. .
double-click the ag_SalesFacts logical table source. .b. c. In the Sources folder for the SalesFacts logical table. Click the General tab and ensure that the ag_SalesFacts logical table source maps to the ag_SalesFacts physical table. Check out the objects.
Click the Column Mapping tab and ensure that the Amount Sold logical column maps to the corresponding physical columns in the ag_SalesFacts physical table. .d.
check for global consistency. . g. Click the Content tab and ensure that the logical levels are set correctly. f. Click Cancel to close the ag_SalesFacts Logical Table Source dialog box. and save the repository.e. Check in the changes.
Enter SH as the username and password. a. Click the Administration link. c. Click the Tables link. Open Internet Explorer and enter the following URL to open Oracle Enterprise Manager: http://<machine name>:1158/em. b. .3 Verify that the aggregates are created in the database. . and log in.
.d. Ensure that SH is entered as the schema name. Ensure that the four new aggregate tables are created in the SH schema. e. and click Go.
Back to Topic To test in Answers. . Log out from Oracle Enterprise Manager and close the browser. log in to Answers as Administrator. perform the following steps: 1. If necessary. Click the Reload Server Metadata link.f.
Amount Sold with a filter for Calendar Year = 2001 3. Ensure that the query uses the ag_SalesFacts table and the related aggregate dimension tables. Back to Topic Back to Topic List Summary In this lesson. you learned how to: . Select Settings > Administration > Manage Sessions > View Log to inspect the query log.Country Region.2. Sales Facts. Select the SH subject area and create and run the following query: Customers.
you can refer to: Additional OBEs on the OTN Web site Back to Topic List Place the cursor over this icon to hide all screenshots.Use the Aggregate Persistence Wizard to create and model aggregate tables Back to Topic List Related Information To learn more about Oracle Business Intelligence. .