Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v. Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 1 of 12 Contains : Cache Management Date : 10/12/13 Oracle BI - Cache Management 1 Introduction Caching in Oracle BI is an extremely smart and powerful mechanism to drastically increase 1 performance and response times. This page explains how it works and how you set it up and how 2 you can influence it. 3 4 2 How it works On the BI Server (partially in memory, but mostly in files) the results of BI Analytics can be cached. 5 The purpose is that any user requiring data that has already been requested by another user can 6 give immediate response, without querying the database or datawarehouse. 7 8 Therefore the BI Server will try to (partially) match the logical request to the contents of the cache 9 files. When a hit is found, the results are returned to the new user. When not the BI Server will 10 generate the SQL-query and request the information from the database. 11 The database itself has caching as well and uses statistics for optimization of queries and datasets. 12 This topic is not discussed here. 13 2.1 Seeding the cache Any user running a specific analytics for the first time will seed the cache. The logfiles of the BI 14 Server will show that a cache ID is created and the query and result set is stored in cache files in 15 the file system of the BI Server. 16 17
12
Embed
Oracle BIEE - Everything you always wanted to know about cache
When researching a nitty-gritty in Oracle BIEE Cache Management I came across all kinds of posts, blogs and papers, all partially describing fragments of the subject. Enclosed an attempt in a white paper that tries to cover all topics. Enjoy.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v.
Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 1 of 12 Contains : Cache Management Date : 10/12/13
Oracle BI - Cache Management
1 Introduction
Caching in Oracle BI is an extremely smart and powerful mechanism to drastically increase 1
performance and response times. This page explains how it works and how you set it up and how 2
you can influence it. 3
4
2 How it works
On the BI Server (partially in memory, but mostly in files) the results of BI Analytics can be cached. 5
The purpose is that any user requiring data that has already been requested by another user can 6
give immediate response, without querying the database or datawarehouse. 7
8 Therefore the BI Server will try to (partially) match the logical request to the contents of the cache 9
files. When a hit is found, the results are returned to the new user. When not the BI Server will 10
generate the SQL-query and request the information from the database. 11
The database itself has caching as well and uses statistics for optimization of queries and datasets. 12
This topic is not discussed here. 13
2.1 Seeding the cache
Any user running a specific analytics for the first time will seed the cache. The logfiles of the BI 14
Server will show that a cache ID is created and the query and result set is stored in cache files in 15
Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v.
Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 2 of 12 Contains : Cache Management Date : 10/12/13
2.2 Hitting the cache
There are a couple of levels involved here: 1
Level Comments
Web Browser Cache
The user is working in a web browser such as MS Internet Explorer , Google
Chrome or Mozilla Firefox . This software runs on a PC or laptop and uses temporary internet files and cookies to generate and reuse the specific HTML-page that is on the screen. When the browser is refreshed this 'cache' is used to show a HTML-page as quick as possible when no changes in the contents exist. This helps this one user with his or hers individual screens.
BI Presentation Server Cache
The BI Server uses the BI Presentation Server Component to generate the HTML-content for that browser. The BI Server will keep track of the Dashboards and Analytics and Views generated. These objects are cached so they can be reused. If for instance a user switches between Graph- and a Table-view both views are cached for reuse. This is stored in cache, so regardless of the underlying data the BI Presentation Server cache is keeping track of the 'pictures' that have been on users' screens. This information is not user dependent, so the first user touching views generates caching for other users to follow as well.
BI Table Cache
The BI Server does the same with the queries, filters and physical tables and keeps track of the SQL-statements executed and the result sets returned. This itself has a couple of components and levels:
Level Comments Example
Query Cache
The logical request and result set is stored in cache.
Show me the revenue and sold quantities per company
Partial Query Cache
The result might supply partial queries, when only a subset of the cached request is hit.
Show me the revenue per company is a subset in columns of the logical request above, Show me the revenue and sold quantities of company 00001 is a subset in rows of the logical request above.
Table Cache
The physical tables in the repository are physically cached as well. It's important to understand that this has a great deal to do with how current and real time data must be and is dependent on how cache refresh is scheduled.
Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v.
Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 5 of 12 Contains : Cache Management Date : 10/12/13
3.2 Server Parameters explained
Parameter Default Explanation
ENABLE YES Switches caching on in the first place
DATA_STORAGE_PATHS Physical folder location
MAX_ROWS_PER_CACHE_ENTRY 100.000 The maximum number of rows in the result set of a query that is cached
MAX_CACHE_ENTRY_SIZE 20 MB The maximum size of the cache folder on the server
MAX_CACHE_ENTRIES 1000 The maximum number of different queries and result sets to be cached
POPULATE_AGGREGATE_ROLLUP_HITS NO Set this to YES to activate smart roll up of cache hits.
For example a user requests all revenue per month.
The next user requests all revenue per year.
The BI Server will aggregate the first question to a higher level and answers the second question.
USE_ADVANCED_HIT_DETECTION NO When caching is enabled, each query is evaluated to determine whether it qualifies for a cache hit. A cache hit means that the server was able to use cache to answer the query and did not go to the database at all. The Oracle BI Server can use query cache to answer queries at the same or higher level of aggregation.
MAX_SUBEXPR_SEARCH_DEPTH n/a Undocumented feature that indicates how deep this aggregation levels are evaluated for rollup.
The three bottom parameters cannot be altered in the Enterprise Management Console. For this 1
you need to edit this file manually and then restart the BI Server. 2
Additional parameters become relevant when the BI Server is clustered over more servers. See for 3
Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v.
Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 8 of 12 Contains : Cache Management Date : 10/12/13
4.3 Scheduling cache clearing
In a real live situation the cache might be cleared periodically (for instance every day early in the 1
morning). 2
This requires the following setup: 3
Step Screen print
Create a Database in the RPD
In the BI Model create a ODBC-connection-pool that matches the ODBC-connection on the local PC that runs the BI Client Admin Tools as well as the ODBC-settings on the BI Server (see OBIEE Server for this):
Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v.
Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 9 of 12 Contains : Cache Management Date : 10/12/13
Step Screen print
On the BI Web Client - New - Create Direct Database Request
Enter "BIServer"."AnalyticsWeb" in the Connection Pool Enter Call SAPurgeAllCache(); in the SQL-statement (this is an ODBC nQSCommand that does the job). Press Validate SQL and Retrieve Columns to see the Result Columns.
Click tab Results (this clears the cache directly because this command is now executed).
This Analytics can now be stored, put on a System Administration dashboard for manual execution and be scheduled periodically using an Agent.
Reference: Oracle BI - Cache Management-v11-20131210_1236.docx Cadran Consultancy b.v.
Author : Rick Brobbel Date printed : 10/12/13 Project : Oracle BIEE Page : 11 of 12 Contains : Cache Management Date : 10/12/13
4.5 Bypassing cache
When an analytics must always access the database because real time data is required, the cache 1
can by bypassed. 2
To realize this do the following: 3
Step Screen print
Edit the Analysis and go to the Advanced tab and check the box Bypass Oracle BI Presentation Services Cache. This takes care of not using the BI Presentation Cache.
Scroll down to the section Advanced SQL Clauses Enter SET VARIABLE DISABLE_CACHE_HIT=1; in the Prefix and press Apply SQL This takes care of overriding the physical table cache.
Click OK on the warning
Note that this code has now been added to the SQL-statement