Category Archives: Cache Optimization

Problem With Caching A Report in Answers Using A Script

The cache is purged but new cache is not created. Customer is not able to cache the reports which contain Database Functions for Columns.
All the cache entries were not created when used a logical query which contains DB functions in it. The query doesn’t get cached and there is no error
produced.
Cache is created when the queries are not using any database functions.

Cause

Queries containing the evaluate function are not qualified to cache. Hence this query is not getting cached. This is expected behavior.
Evaluate is not cacheable because there is no reliable means for OBIEE to interpret the semantics of the string function definition and determine if the
function defined there can be reused under what condition. Take a simple example, Evaluate(‘Today()’ as Date), OBIEE would have no idea this function
returns a result that can be reused till the end of day.

Dynamic repository variables are refreshed by data returned from queries. The same rule applies here. If the query that refreshes the variable is using a
database function and evaluate then the whole query (report) will not be cached as the value of the variable cannot be cached.
If the query that refreshes the variable does not use database functions then it is cached and the report should be cached.
However, when the value of a dynamic repository variable changes, all cache entries associated with a business model that reference the value of the variable,
are purged automatically.

If you see the query in the Cache Manager then it means that is cached. You can check if that particular cached query is used or not by checking the “Last
used” column after the user ran the report. The cache should be used and the value of the “Last Used” column should be updated and different from the value
of the “Created” column.

Solution
Using iBots is an alternative. If you schedule the reports they should appear in the cache until the cache is purged. Keep in mind that reports having the
database functions and evaluate will not be cached either. Also, reports having dynamic repository variables will automatically be purged when the variable
changes.
The iBot should not include queries with database functions and evaluate in order to be cached.

Data Not Getting Refreshed in Answers when Changed in Base Database. Cache problem.

Found something interesting about cache today.

Symptoms

Have a report in Answers.
For one of the values (Jan09 / Budget) the value is 10,000.
Value in database is updated to 600,000
Looking at the report in Answers, it still displays the amount for this value as 10,000.  This happens even after selecting ‘Refresh’ for the report.

If the user drills into Jan09, & so views each week of Jan09, then the value can be seen as 600,000. Drill back out to Jan09 & again it is displaying as 10,000 (the original value).

Turning off caching (in NQSConfig.INI with [ CACHE ] ENABLE =NO ) DOES fix the issue. However, this causes performance issues.
Cause
In fact, this is working as designed.

As per Answers guide, this is expected behavior:

“When executing an Oracle BI Interactive Dashboard or a request, Oracle BI uses temporary storage areas, called caches, to save frequently accessed or recently accessed results. Storing certain results in cache helps to improve Oracle BI performance. You can use the Refresh feature to make sure that your request bypasses saved information in the Oracle BI Presentation Services cache and is issued to the Oracle Business Intelligence Server for processing. NOTE: The Oracle BI Server maintains its own cache. This cache is separate from the Oracle BI Presentation Services cache.”

So, the ‘Refresh’ link only bypasses the OBI Presentation Services cache and the request is issued to the Oracle Business Intelligence Server for processing. It does not bypass OBI Server cache. If the BI Server cache is enabled the request hits the BI Server cache and you then see the old data.

It will not bypass the BI Server cache and will only satisfy your request (and fire the SQL to database) if there is no BI Server cached results.
Solution

The BI Server cache should be cleared to fix the issue.

Oracle BIEE 10.1.3.4 TMP and Cache Files Still in Original Path After Modifying NSQConfig.ini File

Modified the NQSConfig.ini file to change the TMP directory and the DATA_STORAGE_PATH (Cache).
Restarted the BI server and presentation server and noticed that files are not being written to the expected locations.

For example, the TMP directory was changed from:

WORK_DIRECTORY_PATHS = “/u01/app/oracle/product/10.1.3/obiee/OracleBIData/tmp”;

To:
WORK_DIRECTORY_PATHS = “/obi-tmp/tmp”;

The DATA_STORAGE_PATH was changed from:
DATA_STORAGE_PATH = “C:\OracleBI\server\Data\Temp\Cache” 500 MB ;

To:
DATA_STORAGE_PATH = “/obi-tmp/cache” 500 MB;

After making these changes, the TMP and cache files are still being written to the original locations.
Cause

Cache and TMP file locations are controlled by NSQConfig.ini parameters and the SATEMPDIR environment variable.
While the NSQConfig.ini file had been partially updated, the SATEMPDIR had not been updated at all.

The cache settings need to be updated in the NSQConfig.ini file under “[MDX_MEMBER_CACHE]” and “Query Result Cache Section.”

If the SATEMPDIR environment variable is not set and both cache locations are not updated in the
NSQConfig.ini file, the files will continue to write to the default locations.
Solution

Please complete/verify the following steps to change TMP and Cache File locations:

1. Open the NQSConfig.ini file and verify/modify desired paths for the TMP and Cache files.
You should leave original values in the file, but prefix with a “#” symbol to comment out the value.
For example:

TMP Files

#WORK_DIRECTORY_PATHS = “/u01/app/oracle/product/10.1.3/obiee/OracleBIData/tmp”;
WORK_DIRECTORY_PATHS = “/obi-tmp/tmp”;

Cache Files

Query Result Cache Section

[ CACHE ]

ENABLE = NO;
// A comma separated list of <directory maxSize> pair(s)
// e.g. DATA_STORAGE_PATHS = “d:\OracleBIData\nQSCache” 500 MB;
#DATA_STORAGE_PATHS = “/u01/app/oracle/product/10.1.3/obiee/OracleBIData/cache” 500 MB;
DATA_STORAGE_PATHS = “/obi-tmp/cache” 500 MB;

[ MDX_MEMBER_CACHE ]

#DATA_STORAGE_PATH = “/u01/app/oracle/product/10.1.3/obiee/OracleBIData/cache” 500 MB;
DATA_STORAGE_PATH = “/obi-tmp/cache” 500 MB;

2. Then update the SATEMPDIR environment variable to show the same physical path as the WORK_DIRECTORY_PATHS variable in the NSQConfig.ini file (“/obi-tmp/tmp”).
The SATEMPDIR is only applicable to the TMP files.

NOTE: On Linux/Unix systems, this environment variable is defined in the common.sh file in the OracleBI/setup directory.

On Windows, the SATEMPDIR is defined under System Settings -> Advanced -> Environment Variables.

3. After making these changes, stop the BI Presentation Server and BI Server. Then restart.

4. After restarting, you will see .tmp and cache files written to the new directories.

A very good cache article by David Kwan

David Kwan posted a very nice OBIEE caching article – To Cache or Not to Cache That is The Question. I found it very interesting and worth reading. From myself, I’d like to add that in some situations using cache is necessary – for example – a relatively static Dashboard report (maybe updated monthly) from a very large table. I am positive that it’s not worth it for a BI server or a database to waster resources running it for every user over and over.

Cache persistence

There’re a few well-written articles on about OBIEE caching configuration and strategies already. However, I’m posting a solution that I’ve found while investigating an unexpected behavior with tpl cache files disappearing for no reason (no updates in polling table, no manual purge, no BI services restart). Here’s the solution from Oracle:

The behavior was resolved when customer modified the refresh interval for the Repository variables that exist in their Repository.
When a dynamic repository variable is updated, cache is automatically purged. This is designed behavior. Cache will be invalidated (i.e. purged) whenever the initialization block that populates dynamic repository variable is refreshed. The reason that refreshing a variable purges cache is that if a variable was used in a calculation, and the variable changed, then cache would have invalid data. By purging cache when a variable changes, this problem is eliminated.

Since this is the designed functionality, Change Request 12-EOHPZ3 titled ‘Repository variable refresh purges cache’ exists on our database to address a product enhancement request. The workaround is to go through the dynamic repository variables and verify that the variables are being refreshed at the correct interval. If a variable needs to be refreshed daily, there may be a need to set up a cache seeding .bat file that runs after the dynamic variable has been updated. If the cache seeding .bat file runs prior to the refresh of the dynamic variable refresh, then the cache will be lost.

I think they should try to cover similar thing in OBIEE documentation.