oracle biee - everything you always wanted to know about cache

12
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

Upload: rick-brobbel

Post on 25-Jun-2015

574 views

Category:

Self Improvement


1 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: Oracle BIEE - Everything you always wanted to know about cache

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

Page 2: Oracle BIEE - Everything you always wanted to know about cache

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.

Database Cache

Not discussed on this page.

2

3

Page 3: Oracle BIEE - Everything you always wanted to know about cache

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 : 3 of 12 Contains : Cache Management Date : 10/12/13

Example: 1

2

3

Page 4: Oracle BIEE - Everything you always wanted to know about cache

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 : 4 of 12 Contains : Cache Management Date : 10/12/13

3 How it is setup

3.1 General Server Configuration

By default an Oracle BI installation will switch on the caching mechanism and starts using it with 1

default settings. This can be reviewed on the Oracle Enterprise Management console: 2

3 The parameters can be altered according to customer requirements and scaling based on the 4

number of users and reports. 5

These settings are stored in the NQSConfig.INI on the BI Server 6

(../instances/instance1/config/OracleBIServerComponent/coreapplication_obis1): 7

8 The comments also show where cache is stored on the BI Server: 9

10

Page 5: Oracle BIEE - Everything you always wanted to know about cache

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

more information this link. 4

5

Page 6: Oracle BIEE - Everything you always wanted to know about cache

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 : 6 of 12 Contains : Cache Management Date : 10/12/13

3.3 RPD Table Caching

Physical tables are by default not cached when mapped in the repository. When a table is created 1

or imported from metadata one has to deliberately switch on caching: 2

3 Mark the check box and setup the cache persistence time. For static tables such as companies this 4

might be set to a longer period. More dynamic tables with transactions can be set to shorter 5

periods. As soon as this table is queried upon by the BI Server and the database has returned the 6

results, it is cached and will stay there until the cache persistence expires or the cache is cleared 7

(see below). 8

Tables that supply real time data can be left unchecked. 9

10

Page 7: Oracle BIEE - Everything you always wanted to know about cache

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 : 7 of 12 Contains : Cache Management Date : 10/12/13

4 How it is managed

4.1 Viewing the cache

In the BI Client Admin Tools connect to the online repository and choose Manage - Cache: 1

2 Select the bottom tab Physical to view physical table caching: 3

4

4.2 Clearing the cache

Especially during test and development phase caching might be in the way because you cannot 5

directly see results of changes or in the source data. During this phase you might switch caching 6

off. If you want to delete the cache (partially) you can do so from this utility in the BI Client Admin 7

Tools: 8

9 10

Page 8: Oracle BIEE - Everything you always wanted to know about cache

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):

Check in the repository to the BI Server

Page 9: Oracle BIEE - Everything you always wanted to know about cache

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.

1

2

Page 10: Oracle BIEE - Everything you always wanted to know about cache

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 : 10 of 12 Contains : Cache Management Date : 10/12/13

4.4 Scheduling cache population

Every user that touches a dashboard or an analytics will populate the cache with this information. 1

That means that this user will have to wait. A next user will use seeded cache and therefore will 2

have a much faster response. 3

By scheduling these dashboard pages by Agents the population of the cache can be done 4

automatically. Make sure that these Agents are scheduled after the Agent that clears the cache . 5

When an Agent is setup a special checkbox in the Destinations tab is used for this: 6

7 Set the Delivery Content to the appropriate Dashboard Page and create similar agents for all the 8

separate dashboard pages that need preloading: 9

10 The delivery content, format and destination are irrelevant for these kind of agents. 11

12

Page 11: Oracle BIEE - Everything you always wanted to know about cache

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

Save the Analytics and it will bypass all caching

4

5

Page 12: Oracle BIEE - Everything you always wanted to know about cache

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 : 12 of 12 Contains : Cache Management Date : 10/12/13

5 Additional notes, tips & tricks

The cache folder as well as temp folders on the BI-server get corrupted with old data and leave 1

behind garbage. The Clear Cache command does not physically remove all these folders. 2

System Administration will have to see about cleaning up every once and a while. 3

Setting up a smart combination of datawarehouse tables with historical data and real time data 4

it is possible to optimize performance when high volume data is involved. For instance when 5

the JD Edwards General Ledger (F0911) is a source for Finance Analytics this method can 6

help. Creating a fragmented data source that might have three sources creates the optimal 7

combination of very accurate and real time data with using the power of datawarehousing and 8

the BI model: 9

o All data onto the end of last month is coming from a datawarehouse or staging area; 10

o All data from the start of this month onto yesterday is coming from the sourcedata and 11

is cached; 12

o All data from today is coming directly from the datasource without caching; 13

... 14

15

More information will follow as we go along. 16

17

18