Cache helps BI server to fetch data from the Cache instead of going to datawarehouse whenever a query is rerun which helps to increase performance. Cache stores the query generated with respect to the report/query run. But if the data is updated in database and corresponding cache is not purged, the reports may populate old data. In order to avoid this cache purging techniques are used. There are four techniques available for performing Cache purging.
Cache Purging Techniques
1) RPD
This is a manual technique performed in RPD. With this technique entire cache is purged.
Open Adminitration (RPD) in online and goto Manage>Cache>Select All> Purge All.
2) NQCMD Utility
This also is a manual technique where all the cache gets purged similar to the above technique.
** Update: In 12c or infact in 11g as well this is a very efficient way to purge cache automatically on a periodic basis, below are the steps to achieve this.
Assuming you have a lunix environment below are the steps (similar steps can be followed for Windows)
1) Create a .txt (cache_purge.txt) file where OBIEE is installed and save it to below location and fill in these contents
Call SAPurgeallcache()
MW_Home/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup
2) Create a .sh file in any folder where OBIEE is installed with following contents
source MW_Home/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/
OBIEE_Home/Oracle_BI1/bifoundation/server/bin/nqcmd -d AnalyticsWeb2 -u <Admin User> -p <Password> -s OBIEE_Home/instances/instance2/bifoundation/OracleBIApplication/coreapplication/setup/cache_purge.txt
3) Setup Crontab to schedule the cache purge in linux
- Crontab -e
- Fill in below details
00 08 * * * MW_Home/Oracle_Home/user_projects/domains/bi/bitools/bin/purgecache.sh 2>&1 /dev/null
-- This setup runs the script at 8AM in the morning everyday
**
** Update: In 12c or infact in 11g as well this is a very efficient way to purge cache automatically on a periodic basis, below are the steps to achieve this.
Assuming you have a lunix environment below are the steps (similar steps can be followed for Windows)
1) Create a .txt (cache_purge.txt) file where OBIEE is installed and save it to below location and fill in these contents
Call SAPurgeallcache()
MW_Home/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup
2) Create a .sh file in any folder where OBIEE is installed with following contents
source MW_Home/instances/instance1/bifoundation/OracleBIApplication/coreapplication/setup/
OBIEE_Home/Oracle_BI1/bifoundation/server/bin/nqcmd -d AnalyticsWeb2 -u <Admin User> -p <Password> -s OBIEE_Home/instances/instance2/bifoundation/OracleBIApplication/coreapplication/setup/cache_purge.txt
3) Setup Crontab to schedule the cache purge in linux
- Crontab -e
- Fill in below details
00 08 * * * MW_Home/Oracle_Home/user_projects/domains/bi/bitools/bin/purgecache.sh 2>&1 /dev/null
-- This setup runs the script at 8AM in the morning everyday
**
3) Event Polling Tables (IMP)
This is the most used technique. This is not a manual technique. In this technique the cache corresponding to the table that got updated in the datawarehouse is purged rather purging entire cache. A table is created in the database with the given script. A trigger is written in datawarehouse such that whenever a update or insert or modify is performed on any warehouse table the corresponding table name is added table (S_NQ_EPT) created. So when a report is created and if a table associated with the query generated exists in the created table the cache corresponding to the table is purged and the data is fetched from the database. Following is the procedure to implement this technique.
1) Go to C:\OBI\Server\Schema and select .txt file based on the database used. For Oracle it is SAEPT.oracle.
2) Copy the script given in the file and execute it in the datawarehouse. A table is created with name S_NQ_EPT with colum table_name and other columns.
3) Then goto RPD and import newly created table. Do not join this table as this is stand alone table.
4) Goto tools>utilities>OBI Even table > execute. Polling frequency is the interval in which the cache is updated.
5) Last step is to create a trigger in database. Trigger is given in such way that whenever a update or insert or modify is performed on a table, S_NQ_EPT is updated.
4) Fourth technique is used in RPD which is not much used. Goto table in RPD and double click on it and set option for cache. This technique may not be feasible if there are large number of tables.