Innovative Consulting, Inc., 2002 intelligent solutions for your business Use Oracle9i Summary Advisor to Better Manage Your Data Warehouse IOUG Live! 2003 Jeffrey Chan Session 417
Dec 02, 2014
Innovative Consulting, Inc., 2002intelligent solutions for your businessintelligent solutions for your business
Use Oracle9i Summary Advisor to Better Manage Your Data Warehouse
IOUG Live! 2003 Jeffrey ChanSession 417
Innovative Consulting, Inc., 2002
Agenda
• Background on Summary• Overview of Summary Management• Functionalities of Summary Advisor• Summary Advisor Basics• Invoking the DBMS_OLAP Package• Using the Summary Advisor Wizard• Interpret the Recommendations• Conclusion• Q&A
Innovative Consulting, Inc., 2002
Background on Summary
• Needs for Summary– Speed up analytic queries
• Implementations of Summary– Prior to Oracle8i: Snapshot– Since Oracle8i: Materialized view and query
rewrite
• Benefits of Materialized Views– Improve queries performance– Transparency
• Costs of Materialized Views– Storage– Processing power (creation and refresh)
Innovative Consulting, Inc., 2002
Overview of Summary Management
DimensionsDefines hierarchical relationships among columns in dimension tables
Materialized ViewsDisplays the properties of existing materialized views
Materialized View LogEnables incremental refresh of materialized views
Refresh GroupSets up a group of materialized views and schedules the refresh
Summary AdvisorRecommends which materialized views to create, retain, or drop
Innovative Consulting, Inc., 2002
Functionalities of Summary Advisor
• Challenge– Running hundreds of reports, ad hoc
queries– Materialized views vary in size and
benefit
• Functionalities– Provide recommendations– Evaluate existing materialized views– Estimate size of materialized views– Generate DDL scripts to implement the
recommendations
Innovative Consulting, Inc., 2002
User Scenarios
• Converting snapshots to materialized views– Generate a base line
• Implementing a new data warehouse or data mart– Be proactive about performance
• Ongoing support and maintenance– Look for improvements periodically
Innovative Consulting, Inc., 2002
Summary Advisor Basics
DBMS_OLAPPackage
DBMS_OLAPPackage
RepositoryRepository
Summary Advisor Wizard
Summary Advisor Wizard
Structural StatisticsWorkload StatisticsOther Prerequisites
Structural StatisticsWorkload StatisticsOther Prerequisites
Recommendations
ReportsDDL Scripts
Recommendations
ReportsDDL Scripts
Innovative Consulting, Inc., 2002
Prerequisites
• Structural Statistics– Fact tables, dimension tables, and materialized
views– Use the DBMS_STAT package
• Workload Statistics– SQL Cache– User Defined– Oracle Trace
• Other Prerequisites– Dimensional model– Dimension objects
Innovative Consulting, Inc., 2002
DBMS_OLAP Package
• Validation– VALIDATE_DIMENSION– VALIDATE_WORKLOAD_CACHE– VALIDATE_WORKLOAD_USER– VALIDATE_WORKLOAD_TRACE
• Workload management– LOAD_WORKLOAD_CACHE– LOAD_WORKLOAD_USER– LOAD_WORKLOAD_TRACE
• Filter management– ADD_FILTER_ITEM
Innovative Consulting, Inc., 2002
DBMS_OLAP Package
• Materialized view strategy recommendation– RECOMMEND_MVIEW_STRATEGY
• Reporting and script generation– GENERATE_MVIEW_REPORT– GENERATE_MVIEW_SCRIPT
• Estimating size of materialized view– ESTIMATE_MVIEW_SIZE
Innovative Consulting, Inc., 2002
DBMS_OLAP Package
• Materialized view strategy evaluation– EVALUATE_MVIEW_STRATEGY
• Repository management– PURGE_WORKLOAD– PURGE_FILTER– PURGE_RESULTS
Innovative Consulting, Inc., 2002
Summary Advisor Steps
1. Load a workload2. Apply a filter to a workload3. Select fact tables4. Specify materialized view retention list or
percentage5. Specify storage6. Run recommendation process7. Generate reports and DDL scripts8. Implement the recommendations9. Evaluate existing materialized views
Innovative Consulting, Inc., 2002
Invoking the DBMS_OLAP Package
• Make sure prerequisites are met• Create Identifiers
VARIABLE workload_id NUMBER;
EXECUTE DBMS_OLAP.CREATE_ID(:workload_id);
VARIABLE filter_id NUMBER;
EXECUTE DBMS_OLAP.CREATE_ID(:filter_id);
VARIABLE run_id NUMBER;
EXECUTE DBMS_OLAP.CREATE_ID(:run_id);
Innovative Consulting, Inc., 2002
Invoking the DBMS_OLAP Package
• Load a User Defined Workload– Create a table for user defined workload
data– Insert user defined workload
INSERT INTO user_workload VALUES (
'SELECT SUM(s.quantity_sold) FROM sales s, products p
WHERE s.prod_id = p.prod_id and p.prod_category = ''Boys''
GROUP BY p.prod_category', 'SH', 'app1', 10, NULL, 5, NULL, NULL);
– Load user defined workload into the repositoryEXECUTE DBMS_OLAP.LOAD_WORKLOAD_USER
(:workload_id,DBMS_OLAP.WORKLOAD_NEW,DBMS_OLAP.FILTER_NONE, 'SH', 'USER_WORKLOAD');
Innovative Consulting, Inc., 2002
Invoking the DBMS_OLAP Package
• Loading a SQL Cache Workload– The SQL cache can be cleared (as
needed)ALTER SYSTEM FLUSH SHARED_POOL;
– Run reports and ad hoc queries to populate the SQL cacheSELECT SUM(s.quantity_sold)
FROM sales s, products p
WHERE s.prod_id = p.prod_id
GROUP BY p.prod_category;
– Load SQL cache workload into the repositoryEXECUTE DBMS_OLAP.LOAD_WORKLOAD_CACHE
(:WORKLOAD_ID, DBMS_OLAP.WORKLOAD_NEW, DBMS_OLAP.FILTER_NONE, NULL, 1);
Innovative Consulting, Inc., 2002
Invoking the DBMS_OLAP Package
• Using FiltersEXECUTE DBMS_OLAP.ADD_FILTER_ITEM
(:filter_id, 'FREQUENCY', NULL, 5, 10, NULL, NULL);
• Running the Recommendation ProcessEXECUTE DBMS_OLAP.RECOMMEND_MVIEW_STRATEGY
(:run_id, :workload_id, :filter_id, 100000, 50, NULL, NULL);
Innovative Consulting, Inc., 2002
Invoking the DBMS_OLAP Package
• Creating Summary Advisor ReportEXECUTE DBMS_OLAP.GENERATE_MVIEW_REPORT
('C:\summary\demo.html', :run_id, DBMS_OLAP.RPT_RECOMMENDATION);
• Generating SQL ScriptEXECUTE DBMS_OLAP.GENERATE_MVIEW_SCRIPT
('C:\summary\demo.sql', :run_id, 'EXAMPLE');
• Maintaining the RepositoryEXECUTE DBMS_OLAP.PURGE_RESULTS(:run_id);
EXECUTE DBMS_OLAP.PURGE_FILTER(:filter_id);
EXECUTE DBMS_OLAP.PURGE_WORKLOAD(:workload_id);
Innovative Consulting, Inc., 2002
Summary Advisor Report
• Table of Contents
Innovative Consulting, Inc., 2002
Summary Advisor Report
• Materialized View Recommendations
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• Welcome Screen
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• Specify workload
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• Select fact tables
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• Retain summaries (as needed)
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• Specify storage
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• View/Modify Recommendations
Innovative Consulting, Inc., 2002
Using the Summary
• View/Modify Recommendations
Innovative Consulting, Inc., 2002
Using the Summary Advisor Wizard
• Finish
Innovative Consulting, Inc., 2002
Interpret the Recommendations
• Key items to look for in the outputs– Recommended actions– Performance gain– Storage cost– Benefit-to-cost ratio
• Use the procedure EVALUATE_MVIEW_STRATEGY to measure the utilization
Innovative Consulting, Inc., 2002
Conclusion
• Background on Summary• Overview of Summary Management• Summary Advisor
– Functionalities– How it works– How to run it– How to interpret the recommendations
Innovative Consulting, Inc., 2002intelligent solutions for your businessintelligent solutions for your business
Use Oracle9i Summary Advisor to Better Manage Your Data Warehouse
IOUG Live! 2003Session 417
ThanksThanks
Jeffrey ChanTechnology ConsultantInnovative [email protected]
Jeffrey ChanTechnology ConsultantInnovative [email protected]