Documente Academic
Documente Profesional
Documente Cultură
Overview
Purpose
This tutorial shows you how to set up usage tracking and create usage reports to monitor queries in Oracle
BI 11g.
Time to Complete
Approximately 30 minutes
Introduction
The Oracle BI Server supports the collection of usage tracking data. When usage tracking is enabled, the
Oracle BI Server collects usage tracking data for each query, and it writes statistics to a usage tracking log
file or inserts them directly into a database table.
It is strongly recommended that you use direct insertion instead of writing to a log file. The Oracle BI
Summary Advisor feature works in conjunction with the usage tracking feature. Summary Advisor works only
with direct insertion usage tracking. Oracle BI Summary Advisor is available when you are running Oracle
Business Intelligence on the Oracle Exalytics Machine.
This tutorial shows you how to set up and use usage tracking. Usage tracking is also helpful in determining
which user queries are creating performance bottlenecks, based on query frequency and response time. In
this tutorial, you use a database table.
Prerequisites
Before starting this tutorial, you should:
o
o
Complete the tutorial Creating a Repository Using the Oracle BI 11g Administration Tool.
Have access to or have installed Oracle Database 11.2 or later
Have access to or have installed the BISAMPLE sample schema that is included with the Sample
Application for Oracle Business Intelligence Suite Enterprise Edition Plus. There are two options for
accessing the BISAMPLE schema:
1. If you already have installed V107 of the Sample Application, verify that you have access to the
BISAMPLE schema and begin the tutorial.
2. If you want to download and install the complete Sample Application, you can access it here on
the Oracle Technical Network (OTN). Install the SampleApp V107 install files. Note, however, that
only the BISAMPLE schema is required to complete this tutorial.
In this section, you check for the existence of the S_NA_ACCT Usage Tracking table in the database
Repository Creation Utility (RCU) schema. You then create the three layers in the BI Repository for Usage
tracking.
You can also use SQL Developer to check for the S_NQ_ACCT table.
Right-click inside the Physical layer white space and select New Database to open the Database
properties dialog box.
Click the General tab and name the database 12-Usage Tracking.
Click the Connection Pool tab and click Add to open the Connection Pools dialog box.
Enter the data source name, username, and password. In this example, the following are entered:
Data source name: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SID=orcl)))
User name: dev_biplatform
Password: Oracle01
Click OK.
Enter Oracle01 to confirm the password, and click OK.Then click OK again to close the Database
properties dialog box.
Right-click the 12-Usage Tracking database object and select New Object>Physical Schema.
Name the physical schema Usage Tracking Schema and then click OK.
Right-click the Usage Tracking Connection Pool, select Import Metadata, and import the devbiplatform.S_NQ_ACCT table into 12-Usage Tracking.
Click Next in Step 2, Import Metadata - Select Metadata Types dialog box.
In Step 3, select the S_NQ_ACCT table under dev_biplatform and move it to the Repository View
pane. Click Finish.
Right-click S_NQ_ACCT from dev_biplatform and then cut and paste it under Usage Tracking
Schema.
You have now created the Physical Layer for Usage Tracking
Name the business model 13-Usage Tracking 2, and then click OK. Note: there is a similar
business model name 10 - Usage Tracking. This is set up by Sample Applications.
Repeat and add three more tables - Time, Topic, and User to the 13-Usage Tracking 2 business
model.
Drag the following three physical columns from Usage Tracking Schema>S_NQ_ACCT to the
Measures logical table in the 13- Usage Tracking 2 business model. For each column, right-click
the logical column and select Rename, and then rename as follows:
Physical Column
Rename
QUERY_TEXT
Query Count
ROW_COUNT
Row Count
Click the Aggregation tab and select Count from the Default aggregation rule drop-down list.
Click OK.
Similarly, set the Aggregation rule for other logical columns in the Measures logical table as
follows:
Logical Column
Aggregation Rule
Row Count
Sum
Sum
Drag the following three physical columns from Usage Tracking Schema>S_NQ_ACCT to the
Time logical table in the 13-Usage Tracking 2 business model. Rename them as follows:
Physical Column
Rename
START_DT
Start Date
START_HOUR_MIN
END_HOUR_MIN
Set Start Date as the logical key for the Time logical table. Right-click the Time logical table and
select Properties.
Click the Keys tab and enter Time_key in the Key Name column.
Select Start Date from the Columns drop-down list. Click OK.
Drag the following two physical columns from Usage Tracking Schema>S_NQ_ACCT to the
Topic logical table in the 13-Usage Tracking 2 business model. Rename them as follows:
Physical Column
Rename
QUERY_TEXT
Logical SQL
SUBJECT_ AREA_NAME
Subject Area
Set Logical SQL as the logical key for the Topic logical table.
Drag the USER_NAME physical column from Usage Tracking Schema>S_NQ_ACCT to the User
logical table in the 13-Usage Tracking 2 business mode. Rename it to User Name.
Set User Name as the logical key for the User logical table.
Use the Business Model Diagram to create logical joins from Measures to Time. Right-click the 13Usage Tracking 2 business model and select Business Model Diagram>Whole Diagram.
Click the New Join icon from the menu and create logical joins from Measure to Time, Topic, and
User as shown below. Close the diagram.
You have now created the Usage Tracking business model. You will next move it to the
Presentation layer.
Save the repository. A message will ask whether you want to check consistency. Click Yes. You
should then receive a message stating - Business model 13-Usage Tracking 2 is consistent. Do
you want to mark it as available for queries? Click YES. The Consistency Check Manager
window is displayed.
Click Close in the Consistency Check manger. Close the repository and the BI Administration Tool.
You have now finished creating the Y-Usage Tracking 2 subject area. Note: In Sample
Applications, there is another usage tracking subject area name U - Usage Tracking.
You now configure usage tracking through Oracle Enterprise Manager (EM) by performing the following
steps:
Log into EM. In this example, the user name is weblogic and the password is welcome1.
Expand bifoundation_domain.
Lock the domain to update it. Expand BIDomain and select the BIDomain MBean where group=Service.
Note: Expand Show MBean Information in the right pane.
Click the Lock link. On the Operation:lock page, click the Invoke button.
Click the Attributes tab. Scroll down and click UsageTrackingCentrallyManaged. Set Value to true in the
drop-down list.
Click the Apply button. When you see the confirmation message for the update, click the Return button.
Set the UsageTrackingPhysicalTableName attribute to the name of the fully qualified database table for
collecting query statistic information, as it appears in the Physical layer of the Oracle BI repository. In this
example, it is set as follows:
"12-Usage Tracking"."Usage Tracking Schema"."S_NQ_ACCT"
Set the UsageTrackingConnectionPool attribute to the name of the fully qualified connection pool for the
query statistics database, as it appears in the Physical layer of the Oracle BI repository. In this example, it is
set as follows:
"12-Usage Tracking"."UsageTracking Connection Pool"
Note: For usage tracking insertions to succeed, the connection pool must be configured with a user ID that
has write access to the back-end database. Also, it is recommended that the connectivity type support
international data.
After applying your changes, release the lock on the domain, as follows:
o
o
Click Invoke.
Click Return.
Go to the Oracle Business Intelligence Instance page and click Restart All on the Availability>Processes
tab.
Create and run the following analysis in the A-Sample Sales subject area:
Note that the number of rows returned for this query is 1020.
Click Results and check the results for the weblogic user. Your results should look similar to the
following image:
Check the query log in the nqquery.log file and verify that the Usage Tracking 2 and
S_NQ_ACCT table are accessed in the query.
Summary
In this tutorial, you should have learned how to:
o
o
Set up the three layers in the BI Administration Tool for usage tracking
Configure usage tracking by using Enterprise Manager
Run queries against the usage tracking table, to get user query details
Resources
o
o
Oracle University
Overview
Summary
close
To help navigate this Oracle by Example, note the following:
Hiding Header Buttons:
Click the Title to hide the buttons in the header. To show the buttons again, simply click the Title again.
Topic List Button:
A list of all the topics. Click one of the topics to navigate to that section.
Expand/Collapse All Topics:
To show/hide all the detail for all the sections. By default, all topics are collapsed
Show/Hide All Images:
To show/hide all the screenshots. By default, all images are displayed.
Print:
To print the content. The content currently displayed or hidden will be printed.