Kurt Engeleiter Product Manager Database Manageability

Slides:



Advertisements
Similar presentations
Using the SQL Access Advisor
Advertisements

Look Before You Leap! Oracle 11g Real Application Testing
Sameer Marwa – Infogig Consulting Khaled Yagoub – Oracle Development
1. 2 SQL Tuning for Smarties, Dummies and Everyone in Between Jagan Athreya Director, Database Manageability, Oracle Arup Nanda Senior Director, Database.
Copyright © SoftTree Technologies, Inc. DB Tuning Expert.
Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
QA practitioners viewpoint
Performance Testing - Kanwalpreet Singh.
Copyright © 2011 by the Commonwealth of Pennsylvania. All Rights Reserved. Load Test Report.
1.
Application Express Test Drive Unconference OOW 2008 H.Tonguç Yılmaz Turkcell Technology, İstanbul-Türkiye.
Upgrading the Oracle Applications: Going Beyond the Technical Upgrade Atlanta OAUG March 19, 1999 Robert Cooney.
Exadata Distinctives Brown Bag New features for tuning Oracle database applications.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.
Test Case Management and Results Tracking System October 2008 D E L I V E R I N G Q U A L I T Y (Short Version)
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
Oracle Database 11g Real Application Testing. 2 What is Real Application Testing? New database option available with EE only Includes two new features.
Test Automation An Approach to Automated Software Regression Testing Presented by Adnet, Inc Feb 2015.
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Managing Change with Real Application Testing and Snapshot Standby Barry Hodges Senior Solution Architect, Sales Consulting, Oracle NZ.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
Chapter 6: Database Evolution Title: AutoAdmin “What-if” Index Analysis Utility Authors: Surajit Chaudhuri, Vivek Narasayya ACM SIGMOD 1998.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 2 Hidden Gems of APEX David Gale Software Engineer Oracle Application Express November,
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Oracle 11g Real Application Testing: Avoiding Performance Regressions with SQL Performance Analyzer Khaled Yagoub, Pete Belknap, Benoit Dageville, Karl.
Avoiding SQL Performance Regressions – New Techniques for Solving an Old Problem Prabhaker Gongloor, Oracle Corporation Andrea Ngan, Sameer Marwa, DIRECTV.
Copyright © 2007 Quest Software The Changing Role of SQL Server DBA’s Bryan Oliver SQL Server Domain Expert Quest Software.
Convergence /20/2017 © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Reinventing Upgrades, Platform Changes, RAC and More with Database Replay
Overview of the Database Development Process
Database Advisors Automatic Database Diagnostic Monitor ( ADDM )
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
12 Copyright © 2007, Oracle. All rights reserved. Database Maintenance.
Copyright 2003 Accenture. All rights reserved. Accenture, its logo, and Accenture Innovation Delivered are trademarks of Accenture. Data Migration in Oracle.
15 Copyright © 2004, Oracle. All rights reserved. Proactive Maintenance.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
DBA’s New Best Friend: Oracle Database 10g and 11g SQL Performance Analyzer Prabhaker Gongloor (GP) Khaled Yagoub Pete Belknap Database Manageability.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
The Self-Managing Database: Guided Application and SQL Tuning Mohamed Ziauddin Consulting Member of Technical Staff Oracle Corporation Session id:
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Quick Tips for Database Performance Tuning Sergey Koltakov Kurt Engeleiter Product Manager.
Continuous DB integration testing with RAT „RATCOIN”
1 Oracle Enterprise Manager Slides from Dominic Gélinas CIS
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
Database Performance Eric Grancher - Nilo Segura Oracle Support Team IT/DES.
1 Chapter 8 Execution Plan Management. 2 Overview of Execution Plan Management Review techniques to – override optimizer – Improve optimizer’s decisions.
Level 1-2 Trigger Data Base development Current status and overview Myron Campbell, Alexei Varganov, Stephen Miller University of Michigan August 17, 2000.
Presented By: Carlos Colón| February 27, Woodland Center Blvd. Tampa, Florida | Phone: | PLANNING.
Getting the Most outof EPM Converting FDM to FDMEE – What’s it all about? March 16, 2016 Joe Mizerk
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
HPHC - PERFORMANCE TESTING Dec 15, 2015 Natarajan Mahalingam.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
Session Name Pelin ATICI SQL Premier Field Engineer.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
Others Talk, We Listen. Managing Database Projects in Visual Studio 2013.
How To Pass Oracle 1z0-060 Exam In First Attempt?
Michael Mast Senior Architect
Introduction of Week 6 Assignment Discussion
Get Verified Oracle 1z0-062 Study Material - Oracle 1z0-062 Exam Dumps PDF Realexamdumps.com
SQL Server 2016 Query Data Store
Course: Module: Lesson # & Name Instructional Material 1 of 32 Lesson Delivery Mode: Lesson Duration: Document Name: 1. Professional Diploma in ERP Systems.
Managing Performance by SQL Tuning
Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Presentation transcript:

Kurt Engeleiter Product Manager Database Manageability DBA’s New Best Friend: Oracle Database 10g and 11g SQL Performance Analyzer Kurt Engeleiter Product Manager Database Manageability

SQL Performance Analyzer (SPA) – Introduction Outline SQL Performance Analyzer (SPA) – Introduction Recommended Testing Methodology Usage Scenarios Evaluating Changes on Production System 10.2  11g DB Upgrade SPA Enhancements in Oracle Database 11g Release 2 SPA Exadata Simulation Conclusion

SPA Motivation Businesses need to adapt to changes to stay competitive, compliant and evolve DB upgrades, schema, optimizer statistics refresh SQL performance regressions: #1 cause of poor system perf. Current testing landscape and limitations Expensive capture, partial workload, non-production optimizer context, binds Large workloads (100Ks SQL stmts are common) Manual and time consuming testing and regression tuning No end-to-end testing solution Test In Production is not too uncommon SQL Performance Analyzer (SPA) Proactively detects ALL SQL regressions, BEFORE actual change is deployed Integrated comprehensive solution for end-to-end SQL workload testing

SPA Overview Helps users predict the impact of system changes on SQL workload response time Low overhead capture of SQL workload to SQL Tuning Set (STS) on production system Build different SQL trials (experiments) of SQL statements performance by test execution Analyzes performance differences Offers fine-grained performance analysis on individual SQL Integrated with STS, SQL Plan Baselines, & SQL Tuning Advisor to form an end-to-end solution SQL Workload STS SQL plans + stats SQL plans + stats Pre-change Trial Post-change Trial Compare SQL Performance Analysis Report

SQL Trials SQL Trials capture execution performance (plans and statistics) of the STS under a given environment SPA Trials handle the SELECTS and query part of DML, DDL is skipped There are 3 methods to build SQL Trials: Execute SQL Locally or Remotely Test execute statements in actual environment For remote execution, database link needs to be specified Generate Plans Locally or Remotely Generated execution plans have bind visibility, so better than vanilla “explain” Quick way to check if wide-spread changes to SQL plans Build from STS Convert STS to SQL Trial Use for SQL centric analysis with DB Replay or other testing tools Use for 9i/10.1 upgrade to higher releases SPA Trials do not alter the data. Therefore, SPA is amenable for testing some changes in production

SPA: Common Usage Scenarios Database upgrades and patch-set releases 9.2/10.1 10.2 or 11g releases 10.2.0.x 10.2.0.y or 11g releases Optimizer statistics refresh Database parameter changes Database schema changes (e.g., add/drop indexes) Implementation of tuning recommendations I/O subsystem changes (e.g., ASM, Exadata) SPA can be used for: any change that affects SQL execution plan & performance in production as well as test environments Information for use cases on OTN/ML Note: 560977.1

SPA: Enterprise Manager Interface Rich GUI through Enterprise Manager – New workflows added! DBMS_SQLPA package PL/SQL API New Workflows !

Recommended Testing Methodology

Real Application Testing: Recommended Methodology 1. USE SPA FOR SQL RESPONSE TIME / UNIT TESTING DONE? No Yes 2. USE DB REPLAY FOR LOAD / CONCURRENCY TESTING DONE? No Yes DEPLOY CHANGE & TUNING

Recommended Testing Methodology with SPA 1. CAPTURE REPRESENTATIVE SQL WORKLOAD TO STS Use Production or identical Test System Test one change at a time to understand causality 2. ESTABLISH BASELINE (SQL TRIAL-1) WITHOUT CHANGE Reports show deviations from production 3. MAKE CHANGE, ESTABLISH SQL TRIAL-N Compare Baseline to Trial-N in the same environment For incremental tuning: Compare Trial N-1 to Trial-N 4. COMPARE TRIALS & REVIEW SPA REPORT, REMEDIATE 5. Deploy Change & Tuning to PROD OR further testing thru DB Replay Yes DONE? No

Usage Scenario: Evaluating Changes On Production

Using SPA For Changes in Production: Example +Add indexes And so on… Parameter change was bad in this case 1. Fix Regression thru SPM +Index Unusable +Parameter Change +New Stats Change +Validate Tuning +Partitioning Fix Regression SQL Profile +SQL Profile Bubble following the arrow indicates the delta change on Production SPA is used for testing every change

How to Minimize Impact on Production? Generate Plan Vs Test Execute Use Generate Plan Trial Method to subset SQL with plan changes Only test execute SQL with plan changes Limit testing scope to private session or schema where possible Use alter session set <parameter> = <value>; (Vs system) Example usage for SQL Profiles: alter session set sqltune_category= ‘TEST’; Implement SQL Profiles and test Only sessions with “TEST” sqltune_category see these Profiles - private scope!! alter session set sqltune_category= ‘DEFAULT’; -- Now SQL Profiles visible globally to all sessions Similarly for Invisible Indexes, Pending Stats Use SPA time limit to control resource usage Test during maintenance window or non-peak activity when spare resources are available

Using SPA on Production: Evaluating Optimizer Statistics Refresh and other changes Scenario: Can I use SPA to check if any SQL statements regressed due to optimizer statistics refresh on my 10.2/11g production databases? If so, how? Goal: Assess impact of optimizer statistics gathering on SQL workload performance on production system using SPA & make sure are no negative effects of the change

Evaluating Optimizer Statistics Refresh Assumptions Statistics refreshed periodically through custom jobs No test system available, so evaluation is done on production Should impact end-users minimally Test using optimizer pending statistics feature Use SPA remote trials capability (generate plan and test execute) to evaluate statistics refresh on 10.2/11g production database Analyze SPA report and take appropriate action Overall improvement but few SQL regressions Solution: Use SQL Profiles or Plan Management No improvement and many regressions Solution: Revert to old statistics: Use optimizer statistics retention/history feature. Alternatively, configure optimizer statistics appropriately* For Oracle Database 11g, “publish pending” statistics after evaluation of statistics OBE Tutorial on OTN: Gathering and Publishing Stats Independently

Using SPA on Production: Evaluating Optimizer Statistics Refresh Production Database (10.2/11g) No Test Database Used!! 11g SPA System Prod: Before Stats No app schema/data necessary Not Mandatory for 11g db Repository for many tests! Remotely Build SQL Trials Evaluate Opt Statistics Refresh Prod: Stats Refreshed Capture SQL workload to STS 2. Import STS 3. Gather Pending Stats Use SPA to detect performance changes 5. Publish Pending Stats and Remediate Regressions

Evaluating Optimizer Statistics Refresh Tips! On production, first use SPA to generate execution plans only, then test-execute SQLs with changed plans If you’re creating remote trials, you will need a logon trigger to set optimizer_use_pending_statistics = TRUE private to the second trial (SPA establishes the connection itself, over db link, so you cannot run alter session yourself) To test-execute only those SQLs with changed plans, subset your STS after doing trial 2, then do a new SPA experiment on that STS Script to subset STS is on Notes slide Note: this matches the script for subsetting an STS found in the Performance Tuning Guide, Chap 11, except that here we select SQLs with changed plans (‘8’ bit) rather than regressed SQLs (‘2’ bit) DECLARE tname varchar2(100); exec_name varchar2(100); dest_sts varchar2(100); sqlset_cur DBMS_SQLTUNE.SQLSET_CURSOR; src_sts varchar2(100); src_sts_own varchar2(100); BEGIN tname := 'SPA_TASK1'; exec_name := 'COMP'; dest_sts := 'SUB_STS1'; src_sts := 'FULL_STS'; src_sts_own := 'IMMCHAN'; DBMS_SQLTUNE.CREATE_SQLSET(dest_sts, 'test purpose');

Usage Scenario: End-to-End Case Study for 10.2  11g Upgrade

10. 2 11g DB Upgrade Using Enterprise Manager Grid Control (EMGC) 10 Scenario: I want to upgrade from 10.2 to 11g database release to benefit from 11g functionality. How can I best accomplish the upgrade? Goal: Assess impact of upgrade on SQL workload performance using SPA so that there are no surprises after upgrade. Once migrated to 11g new features can be enabled one at a time. Use EMGC 10.2.0.5 for this purpose…

10.2  11g DB Upgrade Upgrade Send SQL for Remote Execution Production Database Test Database Prod DB (10.2) Test DB (11g) Upgrade Collect execution stats 3. Establish 10.2 and 11g Trials 4. Compare performance and generate SPA report Send SQL for Remote Execution Upgrade Test DB (10.2) 2. Transport STS Capture SQL workload to STS 11g SPA System 5. Deploy Tuning and Change to Prod

10.2  11g DB Upgrade (1) Capture Workload to STS Steps 1: Capture workload into STS through Incremental Capture Workload into STS: Preferred method Other sources for STS also possible: Top SQL in AWR / AWR Baseline

10.2  11g DB Upgrade (1) Capture Workload to STS

10.2  11g Upgrade Capture SQL workload to STS 2. Transport STS 3. Establish 10.2 and 11g Trials 4. Compare performance and Generate SPA report 5. Deploy Tuning and Change to Prod

10.2  11g DB Upgrade (2) Transport STS Step 2: Copy STS to SPA system Setup Test DB (Copy of Prod) – 10.2 Upgrade Test DB from 10.2 to 11g

10.2  11g DB Upgrade Capture SQL workload to STS 2. Transport STS 3. Establish 10.2 and 11g Trials 4. Compare performance and Generate SPA report 5. Deploy Tuning and Change to Prod

10.2  11g DB Upgrade (3) Establish 10.2 and 11g Trials

10.2  11g Upgrade Capture SQL workload to STS 2. Transport STS 3. Establish 10.2 and 11g Trials 4. Compare Performance, Generate SPA Report 5. Tune Regressions, Deploy Tuning and Change to Prod

10.2  11g DB Upgrade (4) Compare Performance and Generate Report 3 Note tuning/regression fix is done on remote test system that is being upgraded 2 5* 1 4

SPA Report Regressed SQL Statements

10.2 11g Upgrade Capture SQL workload to STS 2. Transport STS 3. Establish 10.2 and 11g Trials 4. Compare performance and Generate SPA report 5. Tune Regressions, Deploy Tuning and Change to Prod

10.2  11g DB Upgrade (5) Regression Remediation If SPA system has application data/schema, tuning can be done locally on the same DB If a separate SPA system is used, manually* subset SQL into a separate STS and then use EM to transport it to remote DB Create SQL Plan Baselines: Helps revert to previously known, stable plans SQL Tuning Advisor: Helps explore better execution plans All regressed SQL are targeted automatically for remediation * Code snippet in Real Application Testing Users Guide (11.2), Chapter 11 Page 23

10.2  11g DB Upgrade (5) Regression Remediation

10.2  11g DB Upgrade (5) Deploy Tuning and Change in Production

10.2  11g Upgrade Capture SQL workload to STS 2. Transport STS 3. Establish 10.2 and 11g Trials 4. Compare performance and Generate SPA report 5. Tune Regressions, Deploy Tuning and Change to Prod

Demo SPA

SPA Enhancements in Oracle Database 11g Release 2

SPA Enhancements: Oracle Database 11g Release 2 Multiple test executes for better trial accuracy – first execution ignored, averaged stats Alternate Plans: New recommendation added for regression remediation If a better execution plan was noticed in AWR or baseline SQL Trial then a SQL Plan Baseline can be created from it Active Reports New interactive, offline reports based on Adobe Flash Player UI Customers can share reports internally or with Oracle Support Save, email, View Reports Support can diagnose problems more efficiently Get EM UI without installing EM – useful for packaged apps and internal development teams SPA Active Report Example

SPA Enhancements: Oracle Database 11g Release 2 Using SPA With Other Testing Tools – Build Trials from STS Allows comparing two different STS and generate SPA report Eliminates re-executing SQL for trial data Performance statistics picked up from the STS Multiple plans even those with different binds/env picked up for comparison Use cases: Perform SQL-centric analysis Database Replay SQL workload capture into STS-1 during Database Replay - Workload Capture STS-2 during Database Replay – Workload Replay Use SPA to build trials from STS-1 and STS-2 and generate report Similarly with Oracle Application Testing Suite or home-grown scripts Reporting: SPA Report + Additional information Common SQL, Missing/New SQL, Plan Changes Overall Workload and Individual SQL Statistics Available in 11.2 database release, API only

SPA Exadata Simulation: Estimating Exadata Server Performance Gains

Predicting performance gains with SPA Existing SPA and Database Replay functionality can be used to compare non-Exadata to Exadata configurations SPA: Unit test to find SQL response time gains DB Replay: Stress test with concurrency to find throughput gains Measure improvements for your workload This approach requires you to provision Exadata HW Oracle Database Release 11.1.0.7: Adds SPA functionality to simulate Exadata on existing hardware to predict gains Oracle Database Release 11.2: Adds SPA GUI support Simulation measures reduction in I/O interconnect usage that will in turn, reduce IO and CPU consumed on the DB server 40

SPA Exadata Simulation Workflow SPA Exadata Simulation builds two SQL Trials: Trial 1: Current configuration with No Exadata Trial 2: Current configuration with Exadata simulation Comparison metric – I/O Interconnect Bytes Trial 1 value = I/O Interconnect (disk) bytes Trial 2 value is reduced depending on SQL operation eligibility (for full table scans, index full scans, etc.) Plans will not change between trials 41

SPA Exadata Simulation Workflow

SPA Exadata Simulation: Report

SPA Report: SQL Details

Conclusion SPA provides comprehensive and easy-to-use solution for SQL workload testing SPA can be used for many changes both test and production environments Helps adopt technology faster by significantly cutting down testing costs and production deployment risk With SPA and Real Application Testing businesses can be stay competitive and improve profitability

Oracle Database Manageability Important Resources Oracle Database Manageability http://www.oracle.com/technology/products/manageability/database/index.html Oracle Database 2-Day DBA Guide http://download.oracle.com/docs/cd/E11882_01/server.112/e10897/toc.htm Oracle Real Application Testing User’s Guide http://download.oracle.com/docs/cd/E11882_01/server.112/e12254/toc.htm SPA Active Reports http://www.oracle.com/technology/products/manageability/database/sqlpa.html