Simplified SQL Performance Management in Oracle Database 11g Pete Belknap.

Slides:



Advertisements
Similar presentations
Oracle Enterprise Manager Grid Control: Day in the Life of An Admin Wilson N. López – Solution Specialist.
Advertisements

DB-Time-based Oracle Performance Tuning: Theory and Practice
Presentation Date Top Down Performance Management with OEM Grid Control Or how I learned to stop worrying and love OEM Grid Control 10/1/2010 John Darrah.
Kurt Engeleiter Product Manager Database Manageability
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.
1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Using the Optimizer to Generate an Effective Regression Suite: A First Step Murali M. Krishna Presented by Harumi Kuno HP.
Royal London Group A group of specialist businesses where the bottom line is always financial sense Oracle Statistics – with a little bit extra on top.
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any.
A Fast Growing Market. Interesting New Players Lyzasoft.
A Java Architecture for the Internet of Things Noel Poore, Architect Pete St. Pierre, Product Manager Java Platform Group, Internet of Things September.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
12 Copyright © 2005, Oracle. All rights reserved. Proactive Maintenance.
The Self-managing Database: Automatic Performance Diagnosis Graham Wood Kyle Hailey Oracle Corporation Session id:
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer What’s New in Version 4.1 Jeff Smith
Oracle 10g Database Administrator: Implementation and Administration Chapter 14 Proactive Maintenance.
1 How to improve SQL Performance with new Health Check Tool? Carlos Sierra Consulting Technical Advisor © 2012 Oracle Corporation – Proprietary and Confidential.
Best Practices for Supporting Oracle Hyperion EPM and Business Intelligence Solutions Mitra Veluri Senior Principal Technical Support Engineer David Valociek.
Oracle 10g Database Administrator: Implementation and Administration
LEARN. NETWORK. DISCOVER. | #QADexplore Implementing Business Process Management: Steps to Success WCUG – November 18, 2014.
Oracle 11g Real Application Testing: Avoiding Performance Regressions with SQL Performance Analyzer Khaled Yagoub, Pete Belknap, Benoit Dageville, Karl.
Enterprise Asset Management
Application Express 4.1 New Features Hilary Farrell, Principal Member of Technical Staff, Oracle.
QAD's Customer Engagement Dan Blake Consultancy Development Director, QAD QAD Explore 2012.
12 Copyright © 2004, Oracle. All rights reserved. Automatic Management.
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.
1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Reporting from Contract.
15 Copyright © 2004, Oracle. All rights reserved. Proactive Maintenance.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
Oracle E-Business Suite Order Management: Presenting the HTML and Mobile User Experience Durgaprasad Bodapati Director, Product Management Bhavana Sharma.
DBA’s New Best Friend: Oracle Database 10g and 11g SQL Performance Analyzer Prabhaker Gongloor (GP) Khaled Yagoub Pete Belknap Database Manageability.
5 Database Features Every DBA Needs to Know About THT11267 Doug Chamberlain - Principal Product Manger, Oracle Copyright © 2014, Oracle and/or its affiliates.
Oracle Patching and Maintenance A practical guide for System Administrators October 2009.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 8 Contract Management.
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:
RBO RIP George Lumpkin Director Product Management Oracle Corporation Session id:
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
SQL Tuning made much easier with SQLTXPLAIN (SQLT) Mauro Pagano Senior Principal Technical Support Engineer Oracle Confidential – Internal/Restricted/Highly.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JD Edwards Summit Preview the Plans for JD Edwards World A9.4 Release David Greiner,
Quick Tips for Database Performance Tuning Sergey Koltakov Kurt Engeleiter Product Manager.
1. S318417: OAUG SysAdmin SIG Angelo Rosado, Oracle Senior Product Manager Kenneth Baxter, Oracle Strategy Product Manager Biju Mohan, Oracle Principal.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
1 Chapter 13 Parallel SQL. 2 Understanding Parallel SQL Enables a SQL statement to be: – Split into multiple threads – Each thread processed simultaneously.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
20 Copyright © 2008, Oracle. All rights reserved. Cache Management.
1 Chapter 8 Execution Plan Management. 2 Overview of Execution Plan Management Review techniques to – override optimizer – Improve optimizer’s decisions.
An overview of AWR, ASH and ADDM. Learning About AWR Real-World Performance Day with Tom Kyte The Independent Oracle Users Groups presents “A Day of Real-World.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
Closing the Query Processing Loop in Oracle 11g Allison Lee, Mohamed Zait.
Session Name Pelin ATICI SQL Premier Field Engineer.
Using Stored Outlines & Profiles
SQL Server Monitoring Overview
Introduction.
Database Performance Tuning and Query Optimization
Get Verified Oracle 1z0-062 Study Material - Oracle 1z0-062 Exam Dumps PDF Realexamdumps.com
SQL Server 2016 Query Data Store
Managing Performance by SQL Tuning
Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Chapter 11 Database Performance Tuning and Query Optimization
Presentation transcript:

Simplified SQL Performance Management in Oracle Database 11g Pete Belknap

The following is intended to outline our general product direction The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Agenda SQL Tuning Challenges Oracle Database 11g Solutions Q & A Automatic SQL Tuning Improvements to SQL Tuning Advisor Fully automating SQL tuning Real-time SQL Monitoring Track high response-time SQL Find the most expensive plan operation Q & A

SQL Tuning Challenges Oracle Database 10g introduced SQL advisors to simplify application and SQL tuning Remaining challenges SQL Tuning still reactive Painful to find and investigate long-running SQL Oracle Database 11g solutions Automatic SQL Tuning Real-time SQL Monitoring

<Insert Picture Here> Automatic SQL Tuning <Insert Picture Here> The Self-Managing Database

Challenges of Manual SQL Tuning Requires expertise in several domains SQL optimization: adjust the execution plan Access design: provide fast data access SQL design: use appropriate SQL constructs Time consuming Plans are complicated Each SQL statement is unique and each execution can be different Potentially large number of statements to tune Testing proposed changes is labor-intensive Many possible ways to a solution Never ending task SQL workload always evolving Plan regressions

Simplifying SQL Tuning SQL Tuning Advisor, since Oracle Database 10g Recommendations Automatic Tuning Optimizer SQL Tuning Advisor Statistics Analysis Gather Missing or Stale Statistics SQL Profiling Create a SQL Profile DBA Access Path Analysis Add Missing Indexes SQL Structure Analysis Modify SQL Constructs

SQL Profiling Technology Transparent SQL tuning No SQL Profile SQL Profiling Use SQL Profile (future executions) SQL Profile use ? ? ? Plan 3 Plan 2 Plan 1 Search Space add ? ? ? ? ? Plan 3 ? Search Space Plan 3 Plan 1 Plan 2 Plan 1 Plan 2 Validates estimates using dynamic sampling and partial execution Validates only relevant estimates

SQL Profiling Technology (2) Trying alternative plans (new in 11g) Profile Selection (3) (1) Estimate Correction Correction Factors Alternative Plan Analysis Corrections + O_F_E 10.2.0.3 Corrections + O_F_E 10.1.0.4 (2) Corrections + O_F_E 8.1.7 Alternate Plan Set Try some interesting alternatives: plans from old releases Feed correction factors into alternative plan selection But which is the best?

Testing SQL Profiles (1) Measuring actual benefit with test-execution (new in 11g) Naïve: Execute in Order P1 P2 Finish, P2 wins! But what if P1 never completes? Timeout! P1 It would be great to run them concurrently…. P1 P2 P2 wins, kill P1! But then I take 2 CPUs, and N in the general case…

Testing SQL Profiles (2) Measuring actual benefit with test-execution Solution: Tournament Execution P1 P2 Round 1: 15 sec P1 P2 Round 2: 30 sec 16 sec Your winner, with a knockout in the second round, P2!

Testing SQL Profiles (3) Choosing appropriate metrics, comparison strategy “Winner” and “Loser” depends on your point of view Need a statistic that is repeatable and comprehensive. ELAPSED_TIME: comprehensive, but includes row lock waits; I/O time depends on buffer cache state. Not repeatable. CPU_TIME: very repeatable, but not comprehensive for I/O. BUFFER_GETS: very repeatable, but ignores CPU expense; overly pessimistic for some plans Combine the best elements of each CPU_TIME should improve (most reliable statistic) Benefit Reported: ratio of CPU_TIME + BUFFER_GETS*10ms Conservatively consider every buffer get to be an I/O, but allow large CPU improvements to overrule small buffer gets regressions

Improvements in Oracle Database 11g Better SQL Profiling SQL Tuning Recommendations Automatic Tuning Optimizer SQL Tuning Advisor Gather Missing or Stale Statistics Statistics Analysis SQL Profiling Create a SQL Profile show verified benefit Fix potential regression after upgrade Verify benefit through test-execution DBA Access Path Analysis Add Missing Indexes SQL Structure Analysis Modify SQL Constructs

Agenda SQL Tuning Challenges Oracle Database 11g Solutions Q & A Automatic SQL Tuning Improvements to SQL Tuning Advisor Fully automating SQL tuning Real-time SQL Monitoring Track high response-time SQL Find the most expensive plan operation Q & A

SQL Tuning in Oracle Database 10g End-to-end Workflow Evaluate Recommendations DBA Implement DBA Workload Generate Recommendations SQL Tuning Advisor SQL Tuning Candidates DBA Invoke Advisor ADDM one hour AWR A good end-to-end solution, but manual intervention is required

Improvements in Oracle Database 11g Fully-Automated Tuning Workflow Implement SQL Profiles Test SQL Profiles Workload Generate Recommendations SQL Tuning Candidates Choose Candidate SQL one week AWR It’s Automatic! DBA View Reports / Control Process

Picking Candidate SQL (1) S4, 1 minute Week’s Top SQL, Ordered by DB Time S3, 5 minutes S2, 8 minutes S1, 10 minutes I could just pick from the top down… AWR But I will miss SQLs with important hotspots! AWR Average Exec Hourly Daily Weekly Let’s try a more balanced approach: OK, but where do I start?

Picking Candidate SQL (2) AWR Weekly Average Exec Daily Hourly Candidate List 20% 10% 65% 5% Eventually we need one list to tune from: merge the buckets. All buckets are not created equal: focus on the week, but don’t forget about the others. Focus on the SQLs we have not seen recently: Don’t re-tune SQLs if nothing has changed!

Tuning Flow Tuning activities per SQL Candidate SQLs Store reporting data Fetch next SQL Accept Profile Tune SQL If < 3X benefit, recommend for DBA consideration Fix potential regressions Look for indexes, statistics, as with standard tuning Require 3X benefit Both CPU and I/O times must improve Evaluate Profile Tournament competition

Focus on SQL Profiles First step in automating SQL tuning Auto-testing/implementing is limited to profiles because: No lengthy, expensive set-up process (building an index takes time) Private to the current compilation No change to user SQL (does not change semantics) SQL-level recommendation, can be effectively tested Easily reversed by the DBA Testing is done for regular SQL Tuning Advisor tasks as well!

Automatic SQL Tuning Defaults Sensible defaults with flexible configurations Out-of-the-box defaults: Runs in each maintenance window (MAINTENANCE_WINDOW_GROUP) SQL profiles are tested but not implemented DBA can configure using EM: Whether / When / How long it runs Resources it uses Whether it implements profiles How many profiles it implements

Automatic SQL Tuning Task

Automatic SQL Tuning Configuration

Automatic SQL Tuning Result Summary

Automatic SQL Tuning Result Recommendations

Automatically Tuned SQL Details Drilldown

Conclusions Manual SQL tuning is painful even for the experts Oracle 10g SQL Tuning Advisor quickly gives DBA good choices Oracle 11g Automatic SQL Tuning automates the process by making the easy decisions DBA can control as much of the process as he wants

Q & A

Real-Time SQL Monitoring <Insert Picture Here> Shining new light on SQL Performance

Problem: Managing High Response-Time SQLs Monitoring: tracking high response-time SQL What is that expensive SQL (ETL, DDL, batch, report, …) I started up to? Do I have any high response-time SQL running on my OLTP system? Any SQL executing parallel? Investigating: why is this execution so expensive? Plan has hundreds of operations -- where is the time being spent? Why is a particular operation so expensive? SQL runs parallel, is DOP appropriate? is there a skew?  What is going on inside a SQL execution??? Single SQL Execution

Solution: Real-time SQL Monitoring Looking inside the SQL Enabled out-of-the-box with no performance impact Automatically monitors SQL executions that: consume more than 5 seconds of CPU or I/O time are running parallel: PQ, PDML, PDDL Monitors each execution independently Exposes monitoring statistics at multiple levels Global execution level Plan operation level (Plan Tuning) Parallel Execution level (PX Tuning) Guides your tuning efforts Single SQL Execution

How does it work? t = 5 t = 6 t = 7 PGA SGA Update execution statistics in PGA continuously After 5 seconds for serial / immediately for parallel, target for monitoring (reserve SGA space) Push statistics to SGA every second Separate entries for each Parallel Execution Server Each execution of each SQL identifiable in ASH via execution key PX Servers share an execution key, but have a different Session ID Statistics available for at least 5 minutes Not vulnerable to cursor age-outs

New Statistics Exposed For each SQL Execution (V$SQL_MONITOR): Resource Consumption: ELAPSED_TIME, CPU_TIME, FETCHES, BUFFER_GETS, DISK_READS, DIRECT_WRITES, APPLICATION/CONCURRENCY/CLUSTER/USER_IO_WAIT_TIME, PLSQL/JAVA_EXEC_TIME For each Plan Operation (V$SQL_PLAN_MONITOR): Production: STARTS (#executions), OUTPUT_ROWS Memory/Temp usage: WORKAREA_MEM, WORKAREA_TEMPSEG For each second of session activity (V$ACTIVE_SESSION_HISTORY): SQL Execution Key: SQL_ID, SQL_EXEC_START, SQL_EXEC_ID Row source information: SQL_PLAN_LINE_ID/OPERATION/OPTIONS

V$ Additions New V$ Views added; existing views supplemented V$ACTIVE_SESSION_HISTORY (SAMPLE_TIME, SESSION_ID, SESSION_SERIAL#) With Execution Key, Plan Line ID/Operation DBA_HIST_ACTIVE_SESS_HISTORY (DBID, SNAP_ID, INSTANCE_NUMBER, SAMPLE_TIME, SESSION_ID, SESSION_SERIAL#) V$SESSION (SID, SERIAL#) With Execution Key V$SQL_MONITOR (SQL_ID, SQL_EXEC_START, SQL_EXEC_ID) V$SESSION_LONGOPS (SID, SERIAL#, OPNAME) With Execution Key, Plan Line ID/Operation V$SQL_PLAN_MONITOR (SQL_ID, SQL_EXEC_START, SQL_EXEC_ID, PLAN_LINE_ID) V$SQL_PLAN (SQL_ID, CHILD_NUMBER, PLAN_HASH_VALUE, ID)

How do I use it? 11g Enterprise Manager Grid Control (11.1.0.7 DB Control) Additional reporting (available today): DBMS_SQLTUNE.REPORT_SQL_MONITOR Get reports in HTML, XML, or Text

Enterprise Manager Flow (1) SQL Details Monitoring Details Top Activity Session Details

Enterprise Manager Flow (2) Monitoring List Monitoring Details

SQL Monitoring List

SQL Monitoring Details Core concepts

SQL Monitoring Details Core concepts

SQL Monitoring Details Core concepts

SQL Monitoring Details Core concepts

SQL Monitoring Details (Parallelism) Core concepts

SQL Monitoring Details (Parallelism) Core concepts

SQL Monitoring Details (Parallelism) Core concepts

SQL Monitoring Details Big Plans

SQL Monitoring Details Big Plans

SQL Monitoring Details Big Plans

SQL Monitoring Details Big Plans

SQL Monitoring Details Big Plans

SQL Monitoring Details Poor Indexing

SQL Monitoring Details Partially Parallelized

SQL Monitoring Details Partially Parallelized

SQL Monitoring Details Partially Parallelized

SQL Monitoring Details FORCE PARALLEL QUERY PARALLEL 4

SQL Monitoring Details FORCE PARALLEL QUERY PARALLEL 4

SQL Monitoring Details Advanced PQ Skews

SQL Monitoring Details Advanced PQ Skews

SQL Monitoring Details Advanced PQ Skews

SQL Monitoring Details Advanced PQ Skews

Conclusion Real-Time SQL Monitoring is Monitoring and tuning for high response-time SQLs New, fine-grained SQL statistics tracked automatically updated while the SQL runs highly visible and accessible at no cost to your production system The only way to know what’s happening inside single SQL execution The quickest way to the root cause of a performance problem: If you can find the problem, you can fix it!

Q & A