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.
At the SQL prompt, enter the following SQL statement:
SQL>Select table_name from tabs where table_name like 'S%';
Check the columns names by entering the following statement:
SQL>Desc S_NQ_ACCT;
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.
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.
In the Database drop-down list, select Oracle 11g.
Click the Connection Pool tab and click Add to open the Connection Pools dialog box.
Name the connection pool Usage Tacking Connection Pool.
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 dev-biplatform.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.
The dev_biplatform schema is added under 12-Usage Tracking.
Right-click S_NQ_ACCT from dev_biplatform and then cut and paste it under Usage Tracking Schema.
Expand the S_NQ_ACCT table.
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.
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.
Right-click 13-Usage Tracking 2 and select New Object>Logical Table.
Name the table Measures and click OK.
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
|
TOTAL_TIME_SEC
|
Total Time Seconds
|
Right-click the column Query Count and select Properties.
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
|
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:
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 13-Usage 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.
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.
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.
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.
Select WebLogic Domain>bifoundation_domain from the left navigation pane.
Click the WebLogic Domain drop-down list in the right pane.
Select System MBean Browser from the list.
Expand Application Defined MBeans>oracle.biee.admin.
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 Operations tab.
Click the Lock link. On the Operation:lock page, click the Invoke button.
Click the Return button.
Expand BIDomain.BIInstance.ServerConfiguration, and then select the BIDomain.BIInstance.ServerConfiguration MBean.
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.
Similarly, set the UsageTrackingEnabled attribute to true to enable usage tracking.
Set the UsageTrackingDirectInsert attribute to true to enable direct insertion.
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:
- 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.
Go to the Oracle Business Intelligence Instance page and click Restart All on the Availability>Processes tab.
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.
Create and run the following analysis in the A-Sample Sales subject area:
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:
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.
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.
No comments:
Post a Comment