Configure Query Logging

This section includes information about setting the size of the query log, choosing a logging level, and enabling query logging for a user.

Because query logging can produce very large log files, the logging system is turned off by default. You can enable logging to test that the semantic model is configured properly, to monitor activity on the system, to help solve performance problems, or to assist Oracle Support Services. You must enable query logging on the system for each user whose queries you want logged. You do this using the Model Administration Tool.

Set the Query Logging Level

You can configure the amount of data query logs collect per user.

You can enable query logging levels for individual users, as described in Set the Query Log Level for a User. You can't configure a logging level for a group.

A session variable overrides the logging level for a particular user. For example, if the administrator has a logging level of 4 and the session variable logging level is defined as the default 0 (zero) in the semantic model, then the logging level for the administrator is 0.

Set the logging level based on the amount of logging that's appropriate for your organization. In normal operations, logging is generally disabled (that is, the logging level is set to 0). If you decide to enable logging, then select a logging level of 1 or 2. These two levels are designed for use by administrators.

You might want to diagnose performance or data issues by setting a temporary log level for a query. You can enable query logging for a select statement by adding a prefix clause in the Advanced SQL Clauses section of the Advanced tab in Oracle BI Presentation Services. For example, for the select statement:

SELECT year, product, sum(revenue) FROM time, products, facts; 

You can specify the logging level of 5 in the Prefix field as follows:

Set Variable LOGLEVEL=5;

For this query, the logging level of 5 is used regardless of the value of the underlying LOGLEVEL variable.

Note:

Use logging levels greater than 2 only with the assistance of Oracle Support Services.

The query logging levels are described in the following table.

Logging Level Information That Is Logged

Level 0

No logging.

Level 1

Logs the SQL statement issued from the client application. Also logs the following:

  • Physical query response time — The time for a query to be processed in the back-end database.

  • Number of physical queries — The number of queries that are processed by the back-end database.

  • Cumulative time — The sum of time for all physical queries for a request (that is, the sum of all back-end database processing times and DB-connect times).

  • DB-Connect time — The time taken to connect to the back-end database.

  • Query cache processing — The time taken to process the logical query from the cache.

  • Elapsed time — The time that has elapsed from when the logical query is presented to the Presentation Services until the result is returned to the user. Elapsed time can never be less than response time, because elapsed time takes into account the small extra time between the logical query being presented to the Presentation Services to the start of preparation of the query. In cases where this difference in time is negligible, the elapsed time equals the response time.

  • Response time — The time taken for the logical query to prepare, run, and fetch the last record. This matches the TOTAL_TIME_SEC that is logged in usage tracking, as described in Understand the Usage Tracking Tables.

  • Compilation time — The time taken to compile the logical query.

  • For each query, logs the query status (success, failure, termination, or timeout), and the user ID, session ID, and request ID.

  • Total Time in BI Server — the time spent in the BI Server for query execution only (that is, not compilation time).

Level 2

Logs everything logged in Level 1.

Additionally, for each query, logs the semantic model name, business model name, subject area name, SQL statement issued against the physical database, queries issued against the cache, number of rows returned from each query against a physical database and from queries issued against the cache, and the number of rows returned to the client application.

Level 3

Logs everything logged in Level 2.

Additionally, adds a log entry for the logical query plan, when a query that was supposed to seed the cache was not inserted into the cache, when existing cache entries are purged to make room for the current query, and when the attempt to update the exact match hit detector fails.

Don't select this level without the assistance of Oracle Support Services.

Level 4

Logs everything logged in Level 3.

Additionally, logs the query execution plan. Don't select this level without the assistance of Oracle Support Services.

Level 5

Logs everything logged in Level 4.

Additionally, logs intermediate row counts at various points in the execution plan. Don't select this level without the assistance of Oracle Support Services.

Level 6 and 7

Not used.

Set the Query Log Level for a User

You can configure the amount of query data to log per user.

  1. In the Model Administration Tool, select Manage, then Identity.

    The Identity Manager dialog is displayed.

  2. Double-click the name of the user for which you want to set the query logging level.

    The User dialog is displayed.

  3. Set the logging level by clicking the Up or Down arrows next to the Logging Level field.

    To disable query logging for a user, set the logging level to 0.

  4. Click OK.