Friday 12 August 2016

OBIEE 11g Usage Tracking

Checking for Usage Tracking Table
In this sub-section, you check for the existence of the S_NA_ACCT Usage Tracking table in the database Repository Creation Utility (RCU) schema. In this example, the data source name is orcl, the schema name isdev_biplatform, and the password is Oracle01. Open SQL*Plus on your desktop. Log in with the user name dev_biplatform and password Oracle01.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10101.gif
At the SQL prompt, enter the following SQL statement:
SQL>Select table_name from tabs where table_name like 'S%';
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10102.gif
Check the columns names by entering the following statement:
SQL>Desc S_NQ_ACCT;
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10103.gif
You can also use SQL Developer to check for the S_NQ_ACCT table.


Creating the Database Object in the Physical Layer
Open SampleApp.rpd in offline mode in the BI Administration Tool. This is the rpd that comes with the Sample Applications. Enter Admin123 as the repository password.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10201.gif
Right-click inside the Physical layer white space and select New Database to open the Database properties dialog box.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10202.gif
Click the General tab and name the database 12-Usage Tracking.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10203.gif
In the Database drop-down list, select Oracle 11g.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10204.gif
Click the Connection Pool tab and click Add to open the Connection Pools dialog box.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10205.gif
Name the connection pool Usage Tacking Connection Pool.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10206.gif
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
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10207.gif
Click OK.
Enter Oracle01 to confirm the password, and click OK.Then click OK again to close the Database properties dialog box.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10208.gif
Right-click the 12-Usage Tracking database object and select New Object>Physical Schema.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10209.gif
Name the physical schema Usage Tracking Schema and then click OK.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10210.gif
Right-click the Usage Tracking Connection Pool, select Import Metadata, and import the dev-biplatform.S_NQ_ACCT table into 12-Usage Tracking.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10211.gif
Click Next in Step 2, Import Metadata - Select Metadata Types dialog box.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10212.gif
In Step 3, select the S_NQ_ACCT table under dev_biplatform and move it to the Repository View pane. Click Finish.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10213.gif
The dev_biplatform schema is added under 12-Usage Tracking.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10214.gif
Right-click S_NQ_ACCT from dev_biplatform and then cut and paste it under Usage Tracking Schema.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10216.gif
Expand the S_NQ_ACCT table.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10217.gif
You have now created the Physical Layer for Usage Tracking

Creating the Business Model Layer for Usage Tracking
Right-click in the Business Model and Mapping layer white space and select New Business Model.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10301.gif
Name the business model 13-Usage Tracking 2, and then click OKNote: there is a similar business model name 10 - Usage Tracking. This is set up by Sample Applications.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10302.gif
Right-click 13-Usage Tracking 2 and select New Object>Logical Table.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10303.gif
Name the table Measures and click OK.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10304.gif
Repeat and add three more tables - TimeTopic, and User to the 13-Usage Tracking 2 business model.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10305.gif
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
TOTAL_TIME_SEC
Total Time Seconds
Right-click the column Query Count and select Properties.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10307.gif
Click the Aggregation tab and select Count from the Default aggregation rule drop-down list. Click OK.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10308.gif
Similarly, set the Aggregation rule for other logical columns in the Measures logical table as follows:
Logical Column
Aggregation Rule
Row Count
Sum
Total Time Seconds
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
Start Hour Minute
END_HOUR_MIN
End Hour Minute
The Time logical table should look like this:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10309.gif
Set Start Date as the logical key for the Time logical table. Right-click the Time logical table and select Properties.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10310.gif
Click the Keys tab and enter Time_key in the Key Name column.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10311.gif
Select Start Date from the Columns drop-down list. Click OK.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10312.gif
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.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/css/images/show_image_v.png
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.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10314.gif
Set User Name as the logical key for the User logical table.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10315.gif
Use the Business Model Diagram to create logical joins from Measures to Time. Right-click the 13-Usage Tracking 2 business model and select Business Model Diagram>Whole Diagram.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10316.gif
Click the New Join icon from the menu and create logical joins from Measure to TimeTopic, and User as shown below. Close the diagram.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10317.gif
You have now created the Usage Tracking business model. You will next move it to the Presentation layer.

Creating the Presentation Layer
Drag the 13-Usage Tracking 2 business model to the Presentation layer to create the Presentation layer objects. Rename the subject area to Y-Usage Tracking 2.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10401.gif
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.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t10402.gif
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.

Configuring Usage Tracking in Enterprise Manager
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.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20101a.gif
Select WebLogic Domain>bifoundation_domain from the left navigation pane.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20102.gif
Click the WebLogic Domain drop-down list in the right pane.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20103.gif
Select System MBean Browser from the list.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20104.gif
Expand Application Defined MBeans>oracle.biee.admin.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20105.gif
Expand bifoundation_domain.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20106.gif
Lock the domain to update it. Expand BIDomain and select the BIDomain MBean where group=ServiceNote: Expand Show MBean Information in the right pane.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20107.gif
Click the Operations tab.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20108.gif
Click the Lock link. On the Operation:lock page, click the Invoke button.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20109.gif
Click the Return button.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20108.gif
Expand BIDomain.BIInstance.ServerConfiguration, and then select the BIDomain.BIInstance.ServerConfiguration MBean.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20110.gif
Click the Attributes tab. Scroll down and click UsageTrackingCentrallyManaged. Set Value to true in the drop-down list.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20111.gif
Click the Apply button. When you see the confirmation message for the update, click the Return button.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20112.gif
Similarly, set the UsageTrackingEnabled attribute to true to enable usage tracking.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20113.gif
Set the UsageTrackingDirectInsert attribute to true to enable direct insertion.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20113a.gif
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"
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20115.gif
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"
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20114.gif
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:
    • Return to the BIDomain MBean where group=Service under oracle.biee.admin, Domain:bifoundation_domain, BIDomain.
    • Click the Operations tab.
    • Click the first commit operations.
    • Click Invoke.
    • Click Return.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20116.gif
Go to the Oracle Business Intelligence Instance page and click Restart All on the Availability>Processes tab.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t20118.gif

Populating the Usage Tracking Table and Verifying Usage Tracking
You now run analyses to populate the Usage Tracking S_NQ_ACCT table, and then you run queries on the table to get details of these queries.

Creating and Running to Populate Usage Tracking Table
Log in to Oracle BI as weblogic/welcome1.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t30101a.gif
Create and run the following analysis in the A-Sample Sales subject area:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t30101.gif
Note that the number of rows returned for this query is 9.
Create and run the following analysis in the A-Sample Sales subject area:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t30102.gif
Note that the number of rows returned for this query is 1020.

Creating and Running Analyses to Verify Usage Tracking
Create and run an analysis to check usage tracking. Create the following analysis in the Y- Usage Tracking 2 subject area.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t30103.gif
Click Results and check the results for the weblogic user. Your results should look similar to the following image:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t30104.gif
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.
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi1116/ut/images/t30105.gif

No comments:

Post a Comment