Your SlideShare is downloading. ×
  • Like
Oracle BIEE - Everything you always wanted to know about cache
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Oracle BIEE - Everything you always wanted to know about cache

  • 368 views
Published

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 …

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.

Published in Self Improvement , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
368
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
13
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Author : Project : Contains : Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 1 of 12 10/12/13 Oracle BI - Cache Management 1 Introduction 1 2 3 4 2 Caching in Oracle BI is an extremely smart and powerful mechanism to drastically increase performance and response times. This page explains how it works and how you set it up and how you can influence it. How it works 5 6 7 On the BI Server (partially in memory, but mostly in files) the results of BI Analytics can be cached. The purpose is that any user requiring data that has already been requested by another user can give immediate response, without querying the database or datawarehouse. 8 9 10 11 12 13 Therefore the BI Server will try to (partially) match the logical request to the contents of the cache files. When a hit is found, the results are returned to the new user. When not the BI Server will generate the SQL-query and request the information from the database. The database itself has caching as well and uses statistics for optimization of queries and datasets. This topic is not discussed here. 2.1 Seeding the cache 14 15 16 17 Any user running a specific analytics for the first time will seed the cache. The logfiles of the BI Server will show that a cache ID is created and the query and result set is stored in cache files in the file system of the BI Server. Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 2. Author : Project : Contains : 2.2 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 2 of 12 10/12/13 Hitting the cache 1 There are a couple of levels involved here: Level Comments Web Browser The user is working in a web browser such as MS Internet Explorer , Google Cache 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 The BI Server uses the BI Presentation Server Component to generate the HTMLServer Cache 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 The BI Server does the same with the queries, filters and physical tables and Cache 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 The logical request and result set is stored in Show me the revenue and sold quantities per Cache cache. company Partial The result might supply partial queries, when Show me the revenue per company is a subset Query only a subset of the cached request is hit. Cache 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 The physical tables in the repository are Cache 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. Database Cache Not discussed on this page. 2 3 Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 3. Author : Project : Contains : 1 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 3 of 12 10/12/13 Example: 2 3 Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 4. Author : Project : Contains : Rick Brobbel Oracle BIEE Cache Management 3 10/12/13 4 of 12 10/12/13 How it is setup 3.1 Date printed : Page : Date : General Server Configuration 1 2 By default an Oracle BI installation will switch on the caching mechanism and starts using it with default settings. This can be reviewed on the Oracle Enterprise Management console: 3 4 5 6 7 The parameters can be altered according to customer requirements and scaling based on the number of users and reports. These settings are stored in the NQSConfig.INI on the BI Server (../instances/instance1/config/OracleBIServerComponent/coreapplication_obis1): 8 9 10 The comments also show where cache is stored on the BI Server: Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 5. Author : Project : Contains : 3.2 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 5 of 12 10/12/13 Server Parameters explained Parameter ENABLE DATA_STORAGE_PATHS MAX_ROWS_PER_CACHE_ENTRY 1 2 3 4 5 Default Explanation YES Switches caching on in the first place Physical folder location 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 you need to edit this file manually and then restart the BI Server. Additional parameters become relevant when the BI Server is clustered over more servers. See for more information this link. Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 6. Author : Project : Contains : 3.3 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 6 of 12 10/12/13 RPD Table Caching 1 2 Physical tables are by default not cached when mapped in the repository. When a table is created or imported from metadata one has to deliberately switch on caching: 3 4 5 6 7 8 9 Mark the check box and setup the cache persistence time. For static tables such as companies this might be set to a longer period. More dynamic tables with transactions can be set to shorter periods. As soon as this table is queried upon by the BI Server and the database has returned the results, it is cached and will stay there until the cache persistence expires or the cache is cleared (see below). Tables that supply real time data can be left unchecked. 10 Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 7. Author : Project : Contains : Rick Brobbel Oracle BIEE Cache Management 4 10/12/13 7 of 12 10/12/13 How it is managed 4.1 Date printed : Page : Date : Viewing the cache 1 In the BI Client Admin Tools connect to the online repository and choose Manage - Cache: 2 3 Select the bottom tab Physical to view physical table caching: 4 4.2 Clearing the cache 5 6 7 8 Especially during test and development phase caching might be in the way because you cannot directly see results of changes or in the source data. During this phase you might switch caching off. If you want to delete the cache (partially) you can do so from this utility in the BI Client Admin Tools: 9 10 Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 8. Author : Project : Contains : 4.3 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 8 of 12 10/12/13 Scheduling cache clearing 1 2 3 In a real live situation the cache might be cleared periodically (for instance every day early in the morning). This requires the following setup: 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): Check in the repository to the BI Server Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 9. Author : Project : Contains : Rick Brobbel Oracle BIEE Cache Management Step On the BI Web Client - New - Create Direct Database Request Date printed : Page : Date : 10/12/13 9 of 12 10/12/13 Screen print Enter "BIServer"."AnalyticsWeb" in the Connection Pool Enter Call SAPurgeAllCache(); in the SQLstatement (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. 1 2 Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 10. Author : Project : Contains : 4.4 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 10 of 12 10/12/13 Scheduling cache population 1 2 3 4 5 6 Every user that touches a dashboard or an analytics will populate the cache with this information. That means that this user will have to wait. A next user will use seeded cache and therefore will have a much faster response. By scheduling these dashboard pages by Agents the population of the cache can be done automatically. Make sure that these Agents are scheduled after the Agent that clears the cache . When an Agent is setup a special checkbox in the Destinations tab is used for this: 7 8 9 Set the Delivery Content to the appropriate Dashboard Page and create similar agents for all the separate dashboard pages that need preloading: 10 11 12 The delivery content, format and destination are irrelevant for these kind of agents. Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 11. Author : Project : Contains : 4.5 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 11 of 12 10/12/13 Bypassing cache 1 2 3 When an analytics must always access the database because real time data is required, the cache can by bypassed. To realize this do the following: 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 Save the Analytics and it will bypass all caching 4 5 Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.
  • 12. Author : Project : Contains : 5 Rick Brobbel Oracle BIEE Cache Management Date printed : Page : Date : 10/12/13 12 of 12 10/12/13 Additional notes, tips & tricks 1 2 3  4 5 6 7 8 9 10 11 12 13  14 15 16 17 18  The cache folder as well as temp folders on the BI-server get corrupted with old data and leave behind garbage. The Clear Cache command does not physically remove all these folders. System Administration will have to see about cleaning up every once and a while. Setting up a smart combination of datawarehouse tables with historical data and real time data it is possible to optimize performance when high volume data is involved. For instance when the JD Edwards General Ledger (F0911) is a source for Finance Analytics this method can help. Creating a fragmented data source that might have three sources creates the optimal combination of very accurate and real time data with using the power of datawarehousing and the BI model: o All data onto the end of last month is coming from a datawarehouse or staging area; o All data from the start of this month onto yesterday is coming from the sourcedata and is cached; o All data from today is coming directly from the datasource without caching; ... More information will follow as we go along. Reference: Oracle BI - Cache Management-v11-20131210_1236.docx  Cadran Consultancy b.v.