This tutorial shows you how to set up usage tracking and create usage reports to monitor queries.
Approximately 30 minutes
This tutorial covers the following topics:
![]() |
Overview |
![]() |
Prerequisites |
![]() |
Setting Up Usage Tracking |
![]() |
Summary |
![]() |
Related information |
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 set up and use usage tracking, which is used to monitor system and ad hoc query performance and to provide input on usage trends for use in billing users and departments for resources. Usage tracking is particularly useful in determining user queries that are creating performance bottlenecks, based on query frequency and response time. When usage tracking is enabled, the Oracle BI Server collects usage tracking data for each query and writes statistics to a usage tracking log file or inserts them directly to a database table. For the purposes of this tutorial, you will use a database table, which is the recommended leading practice.
The usage tracking Presentation Catalog provides prebuilt requests and a dashboard built to provide common analysis—for example, analyzing usage patterns by users, groups, and queries; daily and weekly peak usage patterns and load variance; time series comparisons to help compare current usage over previous weeks or months; and major contention points for troubleshooting, including, for example, top long-running queries.
Before starting this tutorial, you should:
1. | Have access to or have installed Oracle Database 10g (preferably version 10.2)
|
|
2. | Have access to or have installed the sample schema This example uses the SH schema included in the Oracle Database 10g. 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.x
|
|
4. |
Have created a directory named SetupFiles under <InstallDrive>. Download the SH_UsageTracking.zip from here, copy it to the SetupFiles directory, and extract the file. This zip file contains the Sales History Usage Tracking (sh_usagetracking.rpd) merged repository and Presentation Catalog. The Usage Tracking repository that is available with the installed Oracle BI EE is merged here with the Sales History repository for use in this tutorial. Instructions on merging the Usage Tracking repository with the Sales History or other business repositories can be found in the Merging/Importing Ojects from Different Repositories With No Common Parent topic in the Merging/Importing Objects from Different Repositories using Oracle BI Administration Tool OBE tutorial. Note: Screenshots for this tutorial were taken in a Windows XP environment. Therefore, Start menu options may vary slightly if you are using other Windows environment. |
In this topic, you set up and test usage tracking.
Oracle BI Server supports the accumulation of usage tracking statistics that can be used in several ways, such as database optimization, determining aggregation strategies, and billing users or departments based on the resources that they consume. Oracle BI Server tracks usage at the detailed query level. When you enable usage tracking, statistics for every query are inserted into a database table or are written to a usage tracking log file. In this tutorial, you implement the recommended direct insertion, enabling Oracle BI Server to directly insert the usage tracking data into a relational database table. You also implement the optional time series tables and view, which support time-series analysis of usage information and are used by the sample usage tracking dashboards.
In this tutorial, you use a usage tracking repository and Presentation Catalog, which have been merged with the Sales History business repository and catalogs. The original sample Usage Tracking repository and Presentation catalog is found in your install directories in <InstallDrive>:\OracleBI\server\Sample\usagetracking. When you set up usage tracking in a production environment, you would commonly merge this content into your business repository and catalog.
To set up usage tracking, you perform the following steps:
To create the usage tracking table using the provided script, perform the following steps:
1. | Select Start > All Programs > Oracle - OraDb10g_home > Application Development > SQL Plus to start SQL*Plus.
You use a script provided with your Oracle BI installation to create the usage tracking table. There are scripts available to create the usage tracking table for Oracle, IBM DB2, Microsoft SQL Server, or Teradata databases. |
2. | Log in to your host as SH with the password SH.
|
3. | At the SQL prompt, enter start <InstallDrive>:\oraclebi\server\schema\SAACCT.Oracle.sql; and press Enter.
A table and three indexes should be created. You can change the name of the table in the script, and any change must be updated in the repository and the configuration file. If you are using the table with Business Intelligence Applications, it is not recommended that you change the table name, as it is hard-coded.
|
4. | At the SQL prompt, enter DESC S_NQ_ACCT; and press Enter. View the table structure.
Leave SQL*Plus open. |
To create the time series tables and view, perform the following steps:
1. | To create the S_ETL_DAY time series table, at the SQL prompt, enter start <InstallDrive>:\oraclebi\server\Sample\usagetracking\SQL_Server_Time\Oracle_create_nQ_Calendar.sql; and press Enter.
The table is created. Notice that an error is issued because there is a DROP TABLE statement in the script to drop any existing S_ETL_DAY table in the schema.
|
2. | To load the S_ETL_DAY table with calendar data, enter start <InstallDrive>:\oraclebi\server\Sample\usagetracking\SQL_Server_Time\Oracle_nQ_Calendar.sql;.and press Enter. It takes several minutes for the calendar information to load into the table. You can reduce the periods covered to meet your own requirements by editing the DML script before running it.
|
3. | To create the S_ETL_TIME_DAY time series table, at the SQL prompt, enter start <InstallDrive>:\oraclebi\server\Sample\usagetracking\SQL_Server_Time\Oracle_create_nQ_Clock.sql; and press Enter. .
|
4. | To load the S_ETL_TIME_DAY table with time data, enter start <InstallDrive>:\oraclebi\server\Sample\usagetracking\SQL_Server_Time\Oracle_nQ_Clock.sql;.and press Enter.
|
5. | Using Windows Explorer, open <InstallDrive>:\oraclebi\server\Sample\usagetracking\SQL_Server_Time\SQLServer_create_nQ_UserGroup.sql to edit it. This file creates a user group view, and includes a column named "login," which is a reserved word in the Oracle database. Change the name to USER_NAME. Also delete Option 1 from the script.
Save and close the file.
|
6. | Using SQL*Plus, enter start <InstallDrive>:\oraclebi\server\Sample\usagetracking\SQL_Server_Time\SQLServer_create_nQ_UserGroup.sql; and press Enter to create the view.
Close SQL*Plus. |
To load and configure the usage tracking repository, perform the following steps:
1. | Click Start > All Programs > Administrative Tools > Services.
|
2. | In the Services dialog box, select the Oracle BI Presentation Server and select Action > Stop to stop the service. Also, stop the Oracle BI Server. These services can be stopped in any order.
|
3. | Using Windows Explorer, navigate to the SetupFiles directory and copy the merged sh_usagetracking.rpd to <InstallDrive>:\OracleBI\server\Repository.
Recall that this file is a merged repository consisting of the sample Usage Tracking repository and the Sales History repository.
|
4. | Select Start > All Programs > Oracle Business Intelligence > Administration.
|
5. | Select File > Open > Offline and select sh_usagetracking.rpd in <InstallDrive>:\OracleBI\server\Repository to open the repository in offline mode. Enter Administrator as the username and password, and click OK.
|
6. | In the Physical layer of the repository, expand OBI Usage Tracking > Catalog > dbo and verify that the usage tracking table and time series tables are present in the physical catalog.
|
7. | Right-click the Usage Tracking Writer Connection Pool and select Properties. This connection pool is used to perform writes to the usage tracking table, and should be kept separate. In the Connection Pool dialog box, notice that the data source name and shared logon are configured by default to use variables. Click Cancel to close the dialog box.
You can set up the OLTP_DSN and OLTP_USER variables to point to the correct database values or you can directly change the writer and reader connection pools so that they are hard-coded.
|
8. | For the Usage Tracking Writer Connection Pool, change the Data Source Name to your TNS name. Change the user name and password to SH, then click OK. To confirm the password, enter SH in the Confirm Password dialog box and click OK.
|
9. | Right-click the Connection Pool and select Properties. Change it to point to your TNS name and use the SH user name and password. Click OK and confirm the password in the Confirm Password dialog box.
|
10. | Click File > Save to save the repository and decline the global consistency check. Click File > Close to close the Administration Tool.
|
To configure the server configuration parameters, perform the following steps:
1. | Open <InstallDrive>:\OracleBI\server\Config\NQSConfig.ini in Notepad and edit the repository name to point to the usage tracking repository you copied above. In the Repository section, enter # before "Star" to comment out any other repository name entry. Then, below that entry, create a new line and enter Star = sh_usagetracking.rpd, DEFAULT; to point to your repository (as shown below):
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_usage.rpd metadata repository.
|
2. | Next, set the usage tracking options. Scroll to the Usage Tracking section. Set Enable = Yes; to enable usage tracking. Notice that, when you scroll past the parameters for writing data to a flat file, the configuration file is set by default to DIRECT_INSERT = YES, which determines that usage tracking information is stored in the S_NQ_ACCT database table, which is the recommended approach.
If the DIRECT_INSERT parameter is set to NO, usage tracking information is stored in a file.
|
3. | In the section that lists parameters used for inserting data into a table, set the PHYSICAL_TABLE_NAME = "OBI Usage Tracking"."Catalog"."dbo"."S_NQ_ACCT" ; .
The table name is the fully qualified name as it appears in the Physical layer of the Server Administration Tool. The general structure of this parameter depends on the type of database being used. For Oracle, the structure is PHYSICAL_TABLE_NAME = "<Database>"."<Schema>"."<Table>".
|
4. | Set the CONNECTION_POOL parameter to specify the connection pool to use for inserting records into the usage tracking table. The setting is CONNECTION_POOL = “OBI Usage Tracking”.“Usage Tracking Writer Connection Pool”. Leave the default settings for BUFFER_SIZE, BUFFER_TIME_LIMIT_SECONDS, NUM_INSERT_THREADS, and MAX_INSERTS_PER_TRANSACTION. Your configuration file should look like this:
The connection pool name is the fully qualified name as it appears in the Physical layer of the repository.
|
5. | Save and close the NQSConfig.ini configuration file. |
To load the SH usage tracking Presentation Catalog, perform the following steps:
1. | Using Windows Explorer, navigate to the SetupFiles directory 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, merged with the Usage Tracking content from the sample Usage Tracking catalog.
|
2. | 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 screen below). The path should be : <InstallDrive>:/OracleBIData/web/catalog/sh.
|
3. | Save and close the file. |
To test your usage tracking setup, perform the following steps:
1. | Click Start > All Programs > Administrative Tools > Services. In the Services dialog box, select the Oracle BI Server and click Action > Start. Also start the Oracle BI Presentation Server service.
|
2. | Click Start > All Programs > Oracle Business Intelligence > Presentation Services, enter Administrator as the user ID and password, and click Log In.
|
3. | Click Answers.
|
4. | Verify that the Usage Tracking subject area is visible. If not, click Reload Server Metadata.
|
5. | Select the SH subject area and create the following query: Customers.Country Region, Measures.Sales Facts.Amount Sold.
This query represents the sum of the sales revenue at the Region level in the Customer dimensional hierarchy.
|
6. | Press and hold the Ctrl key and click Times > Calendar > Calendar Year. The Create/Edit Filter dialog box opens.
|
7. | Create the filter Calendar Year is equal to / is in 2001. .
|
8. | Click OK to close the Create/Edit Filter dialog box. The filter is added to the query.
|
9. | Click Results.
|
10. | Click the Create a New Request icon in the upper-right portion and select the Usage Tracking subject area.
|
11. | Create the following query: Users.User Name, Query Time.Date, Topic.Logical SQL, Measures.Max Row Count, and Measures.Total Time in Secs.
|
12. | Click Results and verify that you get the expected usage tracking results.
|
13. | Click the Answers link and, in the selection pane, expand the Shared Folders > Usage Tracking > Usage Monitoring Reports folders to view and explore the prebuilt usage tracking requests that come with the sample Usage Tracking Presentation Catalog.
|
14. | Click the Usage Tracking dashboard link to view and explore the prebuilt Interactive Dashboard, which lists the packaged requests you just explored in the presentation catalog.
|
In this lesson, you learned how to:
![]() |
Set up usage tracking and create usage tracking queries | |
To learn more about Oracle Business Intelligence, you can refer to:
![]() |
Additional OBEs on the OTN Web site |
![]() |
Merging/Importing Objects from Different Repositories using Oracle BI Administration Tool OBE on the OTN Web site |
Place the cursor over this icon to hide all screenshots.