OBI-EE Caching
Your Best Friend For Improving Performance
A Case Study
Presented by:
Narasimha Rao Madhuvarsu
Kshitij Kumar
Agenda
Introduction
About Project
Presentation context
Issues faced
Solution - OBIEE Caching
Lessons learnt
Summary
Questions & Answers
Speaker(s) Profile
Narasimha Rao Madhuvarsu
OBIEE Implementation consultant
2 years of OBIEE Implementation experience
Pernod Ricard
Wyndham Worldwide
Welch’s
8 years of Oracle ERP experience
Kshitij Kumar
Vice President of BI Practice
10 years of BI experience
15 Years of IT experience
Visit us at Booth # : 4145
About the Customer – Pernod Ricard
• Manufacturer and supplier of some of the most
prestigious spirits and wine brands in the world
• World Headquarters based out of Paris, France.
• US Headquarters – White plains, NY
About the Project
Design and build Data Warehouse
Capture huge amount of sales reporting data
Develop Analytical reports to satisfy Sales and
Marketing professionals
Solution : Oracle Business Intelligence on Custom
Data warehouse
Presentation Context
• Case study to show how OBIEE caching was used
• Describes the problems faced and
• Solutions to overcome performance issues
• To improve dashboard performance
• Request vs. Report
About Company – Apps Associates LLC
Making Global Delivery Feel Closer To Home
Offices in USA, Germany and India MA (HQ);
NY/NJ & Atlanta in 2009
Founded in 2002 with >100 % growth every
year for last 5 years:
2007 Inc. 500 list of fastest growing U.S.
companies
Over 250 employees (end of Q3 2008) with
strong local presence
Management & Sr. Consultants: 75% former
Oracle employees
7
Issues faced
Frequent execution of requests returning large
amounts of data
Huge amount of data aggregation
Low report response time
Solution
Caching
• Oracle BI uses temporary storage area, called cache,
to save frequently / recently accessed Requests
result set
Contd..
Caching Methods
Oracle BI Server Cache
Oracle BI Presentation Server Cache
Contd..
Oracle BI Server Cache Configuration
• ‘[Link]’
– ENABLE (YES/NO)
– DATA_STORAGE_PATHS
• MAX_ROWS_PER_CACHE_ENTRY
- Specifies the maximum number of rows in a query result set
to qualify for storage in the cache
- When set to 0, there is no limit to the number of rows per
cache entry
• MAX_CACHE_ENTRY_SIZE
– Specifies the maximum size for a cache entry. Default is 1MB
• MAX_CACHE_ENTRIES
– Specifies the maximum number of cache entries allowed in the
query cache. Default is 1000.
• POPULATE_AGGREGATE_ROLLUP_HITS
– Specifies if data can be aggregated from an earlier cached query
result set and create new entries for rollup cache hits. The default
value is NO
• USE_ADVANCED_HIT_DETECTION
– Describes whether each query is to be evaluated to determine
whether it qualifies for a cache hit.
• MAX_SUBEXPR_SEARCH_DEPTH
– Describes how deep the hit detector looks for an inexact match in
an expression of a query.
– Ex: sin(cos(tan(abs(round(trunc(profit)))))) misses if value is set
to 5 and hits if value is set to 7 or more.
Oracle BI Presentation Server Cache
• Retains the content accessed in the active sessions.
• Uses the request key and the logical SQL string to
determine if subsequent queries can use cached
results.
• Not Smart to work for subsets
• Primary use is short term, when user navigation
across pages in short period of time.
Contd..
Configure Presentation server Cache
• Location of Presentation server cache
$OracleBI_HOME\OracleBIData\tmp
• Set parameters in [Link]
• Location -
($OracleBI_Home\OracleBIData\web\config)
Contd..
• CacheMaxExpireMinutes
– Maximum number of minutes an entry can exist in the cache
• CacheMinExpireMinutes
– Minimum number of minutes an entry can exist in the cache
• CacheMaxEntries
– maximum number of open record sets that Oracle BI
Presentation Services keeps open at any one time
Contd..
Default Values
– <CacheMaxExpireMinutes>60</CacheMaxExpireMinutes>
– <CacheMinExpireMinutes>10</CacheMinExpireMinutes>
– <CacheMaxEntries>100</CacheMaxEntries>
Contd..
Bypassing Presentation services cache
• By pressing the Refresh button in answers
• By changing the underlying filters
• Also be cleared from Settings
Administration
Manage Sessions Close All Cursors.
Cache hit & miss
• When a request result set can be retrieved
from presentation services cache or BI Server
cache then it is said to be cache hit.
• When a request result set found in neither of
the above places it is said to be a miss.
Contd..
When Cache hit occurs ?
• When query returns a subset of cached data
– Run a report without filters
• E.g.: Select brand, quality, Sales_Qty_MTD from
products
– Run the same report with filters, or select subset
of columns
• Select brand, quality , Sales_Qty_MTD from products
where brand='Chivas regal';
• Select Brand from Products;
Contd..
• WHERE clause semantically the same or a logical
subset
– Ex: Select brand, quality from products where brand in ('100
Pipers','Chivas regal','Kahlua')
– Ex: Select brand, quality from products where brand in
('Chivas regal','Kahlua')
Contd..
• Logical subset of a literal comparison
Ex: select [Link], "Report Measures"."YTD Reporting
N-1" from "Report Measures" where "Report
Measures"."YTD Reporting N-1"<10000
Select [Link], "Report Measures"."YTD Reporting N-1"
from "Report Measures" where "Report Measures"."YTD
Reporting N-1"<5000
Cache hit & miss
• When no entry in [Link] – Presentation
server cache
• When logical SQL and cache hit message in
[Link] – OBI server cache
• When logical SQL and Physical SQL in [Link]
– Cache miss, physical query sent to DB
Purging Cache – Why & How
• Process of deleting entries from the query cache
• Cache entries may become Stale over time
• How?
– Manual
– Automatic
– Programmatic
Contd..
Manual Purge
– Purge all/specific entries from repository ONLINE
– Manage->Cache
Contd..
Automatic purge
• Disable cache for the system
• By setting the Cache Persistence Time field in the
Physical Table dialog box for a particular table.
• By setting up an Oracle BI Server event polling at
table
• As the cache storage space fills up
Contd..
Programmatically purge
• Oracle BI Server provides ODBC-extension functions
for purging cache
• These functions gives choice and the timing flexibility
of cache purge
• Manage with the automation of event tables entries
programmatically
Contd..
• SAPurgeCacheByQuery: Purges cache entry for a
particular logical query
– Call SAPurgeCacheByQuery(‘select lastname, firstname
from employee where salary > 100000’ );
• SAPurgeCacheByTable: Purges all cache entries
based on a particular table
– Call SAPurgeCacheByTable( ‘VENUS’, ‘APOLLO_BI’,
‘PRNA’, ‘HFM_F_REPORT_RATIOS’ );
Contd..
• SAPurgeAllCache: Purges all cache entries
– Call SAPurgeAllCache();
• SAPurgeCacheByDatabase: Purges cache entries
pertaining to a specific physical database.
– Call SAPurgeCacheByDatabase( ‘VENUS’ );
Cache Seeding
• A mechanism allows administrators to run requests
on dashboard pages or requests stored in the
Presentation Catalog or commonly accessed
requests and create a Server cache
• Selected requests are pre-run to increase response
time when users actually run them
Contd..
Cache Seeding Methods for Answers
Requests
• Using Logical SQL, NQCMD command
– nqcmd -d AnalyticsWeb -u <User Name> -p <Password> -s <sql
template file name with path>
Contd..
Seed cache using Delivers
– Create an iBot
– Select the request/dashboard as content
– Select “Oracle BI Server Cache” in destinations tab
Contd..
Cache Seed Using Briefing Books
• Create a Briefing Book
• Mark it as updatable
• Add dashboards as contents
• Create an iBot with Briefing Book as the delivery
content
• Purge cache after each ETL finish
• Schedule iBot after each ETL run
Advantages
Improves query performance.
Reduces network traffic.
Reduction in Oracle BI server processing overhead.
Contd..
Costs of Caching
Disk space for the cache
Administrative costs of managing the cache
Potential for cached results being stale
Minor CPU and disk I/O on server machine
Approach : Pernod-Ricard-USA
• Combination of multiple strategies followed
– iBots
– Briefing Books and iBots
• Cache seed of logical SQL using NQCMD was ruled out
– Manual effort
– Maintenance
– Specifying parameters prone to errors
Contd..
• Briefing Books & iBots
– Frequently used performance intensive request dashboards
are added to updatable briefing books.
– iBots are created with briefing books as delivery content
– Destination is set to a dummy email
– Cache purge and iBots scripts are scheduled as post ETL
process.
• For BI Publisher reports
– Query results cached
– Document cache is enabled
Lessons learnt
• Flood of requests submitted to BI server when cache
seed scripts kicked
• Huge CPU and resource usage at the time of cache
seed
• Other scheduled processes effects
• Introduce delays in cache seed script to decrease
sudden load on CPU & other resources
Summary
• Recommended when
– Less amount of data & frequently used reports
– Commonly used expensive requests
– When original requests are expected to bring subset of
cached data
– Requests with out filter criteria if subsets are expected later
• Not recommended when
– Queries returns huge amount of data, equal to retrieving
from database
Thank You
Visit us at Booth # : 4145
Questions/suggestions can be emailed to:
[Link]@[Link]
[Link]@[Link]
56
Caching for BI Publisher Reports
• Set BI Publisher system caching parameters
– Cache Expiration
• Expiration period for dataset cache in minutes
• Default is 30 minutes
– Cache Size Limit
• Maximum number of datasets can be maintained
• Default is 1000
Contd..
– Maximum Cached Reports
• Maximum number of reports to maintain in cache
• Default is 50
• Report Level Parameters
– Cache query results
– Enable document cache
• OracleBIData\cache