Quo Vadis SQLTXPLAIN

Similar documents
Tuning slow queries after an upgrade

Essential (free) Tools for DBA!

The Oracle SQLT Utility. By Kevin Gilpin, Rolta TUSC Wednesday March 14, 2012

Implement SAML 2.0 SSO in WLS using IDM Federation Services

Oracle Database 11g: SQL Tuning Workshop

Incrementally Updating Backups Tips and Tricks

Big Data analytics in insurance

Infrastructure Consolidation with OCI

Infrastructure at your Service. In-Memory-Pläne für den 12.2-Optimizer: Teuer oder billig?

DOAG 2013 Oracle 12c Backup & Recovery

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

CC13c LifeCycle Management. Infrastructure at your Service.

<Insert Picture Here> DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g

Databases Clone using ACFS. Infrastructure at your Service.

Oracle Database 10g The Self-Managing Database

Oracle 1Z Oracle Database 11g Performance Tuning.

Learning Objectives : This chapter provides an introduction to performance tuning scenarios and its tools.

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

Advanced Oracle Troubleshooting Live Session. Randolf Geist

PERFORMANCE TUNING TRAINING IN BANGALORE

Tuning Oracle SQL with SQLTXPLAIN

Oracle SQL Tuning for Developers Workshop Student Guide - Volume I

Session id: The Self-Managing Database: Guided Application and SQL Tuning

Oracle Database 11g: Performance Tuning DBA Release 2

Performance Problems

Oralogic Education Systems

Under the hood of dynamic and adaptive database features

Top 7 Plan Stability Pitfalls & How to Avoid Them. Neil Chandler Chandler Systems Ltd UK

Oracle 1Z0-417 Exam Questions and Answers (PDF) Oracle 1Z0-417 Exam Questions 1Z0-417 BrainDumps

Advanced Oracle Troubleshooting Live Session

Advanced Oracle SQL Tuning v3.0 by Tanel Poder

Infrastructure at your Service. Oracle over Docker. Oracle over Docker

Dan Hotka Author/Instructor Oracle Ace Director.

Oracle Database 11g : Performance Tuning DBA Release2

Effec%ve Use of Oracle s 12c Database Opera%on Monitor

<Insert Picture Here>

Using Automatic Workload Repository for Database Tuning: Tips for Expert DBAs. Kurt Engeleiter Product Manager

Oracle Database 11g: Performance Tuning DBA Release 2

Oracle and Toad Course Descriptions Instructor: Dan Hotka

EZY Intellect Pte. Ltd., #1 Changi North Street 1, Singapore

Toad as a SQL Tuning Tool. With Dan Hotka - Oracle ACE Director

Manually Create Sql Profile Oracle 10g

Infrastructure at your Service. DOAG Webinar. ODA 12c new features. ODA 12c new features

OpenWorld 2018 SQL Tuning Tips for Cloud Administrators

Katharina Römer Principal Sales Consultant STCC Stuttgart ORACLE Deutschland GmbH

APEX Times Ten Berichte. Tuning DB-Browser Datenmodellierung Schema Copy & Compare Data Grids. Extension Exchange.

Oracle Database 12c: Performance Management and Tuning

SQL Tuning for Expert DBAs

End-to-end Management with Grid Control. John Abrahams Technology Sales Consultant Oracle Nederland B.V.

Toad for Oracle Suite 2017 Functional Matrix

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

What is Real Application Testing?

<Insert Picture Here> Maximizing Database Performance: Performance Tuning with DB Time

Effective MySQL Optimizing SQL Statements (Oracle Press) PDF

Database Performance Analysis Techniques Using Metric Extensions and SPA

Monitoring WebLogic with WLDF

Oracle DB-Tuning Essentials

Oracle Database 11g: SQL Tuning Workshop. Student Guide

TipsandTricks. Jeff Smith Senior Principal Product Database Tools, Oracle Corp

Oracle Compare Two Database Tables Sql Query List All

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

Oracle 1Z0-054 Exam Questions and Answers (PDF) Oracle 1Z0-054 Exam Questions 1Z0-054 BrainDumps

Tuning SQL without the Tuning Pack. John Larkin JP Morgan Chase

1Z Oracle Database Performance and Tuning Essentials 2015 Exam Summary Syllabus Questions

DOAG Conference Edition. Marco Mischke, Experts for database solutions.

Tuna Helper Proven Process for SQL Tuning. Dean Richards Senior DBA, Confio Software

Top 5 Issues that Cannot be Resolved by DBAs (other than missed bind variables)

Demystifying SQL Tuning: Tips and Techniques for SQL Experts

Key to A Successful Exadata POC

Oracle Enterprise Manager 12 c : ASH in 3D

Oracle Database 12c Performance Management and Tuning

Where Do We Go From Here? Why Many IT Staff are Living in the Past

This presentation is for informational purposes only and may not be incorporated into a contract or agreement.

IBM s Integrated Data Management Solutions for the DBA

ORACLE 11gR2 DBA. by Mr. Akal Singh ( Oracle Certified Master ) COURSE CONTENT. INTRODUCTION to ORACLE

"Charting the Course... Oracle 18c DBA I (3 Day) Course Summary

Real-World Performance Training Core Database Performance

And Answers In Oracle Pl Sql

COOL performance optimization using Oracle hints

Oracle Database 11g: Administration Workshop I Release 2

Outsourcing with MyDBA

Oracle Application Express Schema Design Guidelines Presenter: Flavio Casetta, Yocoya.com

Oracle EXAM - 1Z Oracle Database 11g: Performance Tuning. Buy Full Product.

Oracle Database 11g: Self-Managing Database - The Next Generation

October 3, 2017 Vit Spinka Chief Architect

Addressing a performance issue: the drilldown approach

Oracle 10g Self-Management Framework Internals: Exploring the Automatic Workload Repository. Open World September 2005

Resolving Child Cursor Issues Resulting In Mutex Waits

In the Oracle Database 12c: Performance Management and

Oracle Database Security

When should an index be used?

IT100: Oracle Administration

Using Active Session History for Performance Tuning: Advanced Topics in Performance Diagnostics

Oracle SQL*Plus: The Definitive Guide (Definitive Guides) PDF

Practice Manual: How to optimize SQL statement of using DBLINK on Oracle

1 Dulcian, Inc., 2001 All rights reserved. Oracle9i Data Warehouse Review. Agenda

Oracle Pl Sql Tuning Expert Secrets For High Performance Programming Volume 8 Oracle In Focus

Oracle 9i Application Development and Tuning

Identifying Performance Problems in a Multitenant Environment

Manage Change With Confidence: Upgrading to Oracle Database 11g with Oracle Real Application Testing

Transcription:

Quo Vadis SQLTXPLAIN

Who we are Experts At Your Service > Over 50 specialists in IT infrastructure > Certified, experienced, passionate Based In Switzerland > 100% self-financed Swiss company > Over CHF8 mio. Turnover Leading In Infrastructure Services > More than 150 customers in CH, D & F > Over 50 SLAs dbi FlexService contracted Quo Vadis SQLTXPLAIN 22.11.2017 Page 2

About me Clemens Bleile Senior Consultant +41 78 677 51 09 clemens.bleile[at]dbi-services.com Quo Vadis SQLTXPLAIN 22.11.2017 Page 3

SQLTXPLAIN The motivation for the presentation > 12.1.12.1 October 20, 2015 > 12.1.14 December 6, 2015 > 12.1.160429 April 29,2016 > August 2017: 10.2, 11.1, 11.2 and 12.1 download > 12.2.170914 September 14,2017 Hurricane Irma > 12.2.171004 October 4th, 2017 > October 2017: 10.2, 11.1, 11.2, 12.1 and 12.2 download Page 4

Agenda 1.SQL Tuning (according documentation) 2.SQLTXPLAIN 3.SQLd360 4.SQL Tuning 2017 5.Summary Quo vadis? Is a Latin phrase meaning Where are you going? Source: Wikipedia Quo Vadis SQLTXPLAIN 22.11.2017 Page 5

SQL Tuning > According the Oracle Documentation > Manual Tuning Tools 2 4 1 3 5 Quo Vadis SQLTXPLAIN 22.11.2017 Page 6

SQL Tuning According the Oracle Documentation Page 7

SQL Tuning According the Oracle Documentation Page 8

SQL Tuning According the Oracle Documentation Page 9

SQL Tuning According the Oracle Documentation Page 10

SQL Tuning According the Oracle Documentation Automated Tuning Tools > ADDM > SQL Tuning Advisor > SQL Access Advisor > SQL Plan Management > SQL Performance Analyzer Page 11

SQL Tuning According the Oracle Documentation Manual Tuning Tools > Execution Plans > Explain Plan > AUTOTRACE > V$SQL_PLAN > DBMS_XPLAN-Package to view EXPLAIN PLAN, V$SQL_PLAN > Real-Time SQL Monitoring and Real-Time Database Operations > V$SQL_MONITOR > V$SQL_PLAN_MONITOR > Use with other V$-Views like V$ACTIVE_SESSION_HISTORY, V$SESSION > Application Tracing > tkprof, trcsess > Optimizer Hints Page 12

SQL Tuning Manual Tuning Tools > Why is it slow? > To know why something is slow lots of data may need to be reviewed: > Statistics > Table, Index, Partition, Column > History of statistics > Metadata > History of the SQL (good and bad plans) > Bind variables peeked and captured > Optimizer parameters used > Difference between calculated and real cardinality in the plan > Etc. > There is not a single tool within the standard Oracle release to get that ALL Page 13

SQLTXPLAIN > What is SQLTXPLAIN and why using it? > Methods > Main Report > SQLTXPLAIN issues 2 4 1 3 5 Quo Vadis SQLTXPLAIN 22.11.2017 Page 14

SQLTXPLAIN What is SQLTXPLAIN? SQLT (SQLTXPLAIN) is a tool that inputs one SQL statement and outputs a set of comprehensive diagnostic files for SQL performance analysis and tuning. Page 15

SQLTXPLAIN Why SQLTXPLAIN? > First version developed 1999 by Oracle employee Carlos Sierra in the Center of Expertise (CoE) > The tool was used in different environments (e.g. Peoplesoft, Siebel, Ebusiness Suite) to tune SQL > Objective was to get all required data around a SQL-statement (to be able to tune it) > Became THE standard tool to analyze SQL in Oracle Support > SQL tuning issue could be analyzed offline > Time to fix a SQL-tuning-problem was reduced significantly Page 16

SQLTXPLAIN SQLTXPLAIN characteristics > Free download (with MOS access) and use > 9i, 10g, 11g and 12c databases > Unix, Linux and Windows platforms > Unwrapped source (SQL and PL/SQL) > Installs under its own schemas (self-contained) > Small footprint (space and CPU) > Not intrusive (does not expose application data) > Recognizes RAC environments > Helps to expedite a SQL performance analysis and tuning Page 17

SQLTXPLAIN Why SQLTXPLAIN MOS Search: SQLTXPLAIN Page 18

SQLTXPLAIN SQLTXPLAIN main methods > XPLAIN > Stand-alone SQL placed in a flat text file > XTRACT > Memory or AWR resident SQL, identified by its hash_value or sql_id > XECUTE > Stand-alone script that contains one SQL, together with the declaration and values of its bind variables > XTRXEC > XTRACT and XECUTE combined Page 19

SQLTXPLAIN SQLTXPLAIN Output Reports > Main html report > CBO trace 10053 and SQL trace 10046 > Readme text file > TKPROF > Log files Scripts > Metadata > Set CBO Environment > TC SQL > TC Script > TC Builder Page 20

SQLTXPLAIN Main Report See example Main Report Page 21

SQLTXPLAIN SQLTXPLAIN Issues > Data not presented graphically > Heavy HTML-report > Requires installation (2 schemas) > XTRACT (usually used) does not include execution details (computed versus real cardinality) > Requires MOS access to download it Page 22

SQLTXPLAIN SQLTXPLAIN Issues https://carlos-sierra.net/2012/04/03/what-is-sqltxplain/ Page 23

SQLd360 > Why SQLd360 > How to use it? > Main Report 2 4 1 3 5 Quo Vadis SQLTXPLAIN 22.11.2017 Page 24

SQLd360 What is SQLd360 SQLd360 is a free tool that provides a 360-degree overview around a SQL statement. The output is a single zip file that allows offline analysis, trend analysis and detailed root-cause investigations. The content of the zip is a set of small reports, each specific to an area of interest, easy to navigate through an index file. https://mauro-pagano.com/2015/02/16/sqld360-sql-diagnostics-collection-made-faster/ Page 25

SQLd360 Why SQLd360 In comparison to SQLT it provides: > Data graphically > Light HTML-report > Requires no installation > Requires no MOS access Page 26

SQLd360 How to use it? > Download > https://github.com/mauropagano/sqld360/archive/master.zip > Unzip > Run $ unzip sqld360-master.zip $ cd sqld360-master $ sqlplus / as sysdba SQL> @sqld360.sql 0vy6pt4krb3gm T > Check html $ unzip sqld360_233927_7ws837zynp1zv.zip $ firefox 00001_sqld360_233927_7ws837zynp1zv_index.html Page 27

SQLd360 Main Report See an example Main Report Page 28

SQL Tuning 2017 > Some thoughts > Pro s and Con s of the tools > My subjective opinion 2 4 1 3 5 Quo Vadis SQLTXPLAIN 22.11.2017 Page 29

SQL Tuning 2017 Some thoughts Do normal DBAs need all the info provided in SQLT? > SQLTXPLAIN was mainly written for Oracle Support > Do we (DBAs, Developers) need to understand what the optimizer is doing in detail? > If there is a misbehaviour, shouldn t Oracle Support comment on that? How predictive is an execution plan with all adaptive features today? > Especially plans with adaptive statistics are difficult to comprehend Page 30

SQL Tuning 2017 Some thoughts Do normal DBAs need all the info provided in SQLT? > Yes, I think so. Being familiar with SQLT (or SQLd360) allows to fix a SQL-performance issue faster. > We may not fully understand what s going on, but we should be able to fix an issue without Oracle Support. How predictive is an execution plan with all adaptive features today? > In 12.2. the adaptive statistics are switched off by default. > Tools like SQLT or SQLd360 are becoming more important again Adaptive Query Optimization ADAPTIVE PLANS Join Methods Parallel Distribution ADAPTIVE STATISTICS Dynamic Statistics Automatic Reoptimization SQL Plan Directives Page 31

SQL Tuning 2017 Some thoughts SQL Tuning approaches > Tuning by design (Developer): Know the SQL and the data. Provide appropriate access structures and statistics to get the expected plan. Considers data changes (growth, data skew). > Troubleshooting (DBA): Find out where the calculated plan is wrong (difference between computed and real cardinality) and fix the issue. > Mix of above approaches. Things may have to be improved iteratively. Page 32

SQL Tuning 2017 Some thoughts SQL Tuning approaches > To be able to tune a SQL we need to > know all the metadata around a SQL SQLT, SQLd360 > measure runtime statistics SQLTXECUTE, GATHER_PLAN_STATISTICS, 10046-trace, SQL Monitor > know the DB features Concepts, Education, Experience Page 33

SQLTXPLAIN Pro s and Con s ALL Information around a SQLstatement provided Requires 2 schemas in the database. Easy navigation in HTML (Go to top, Drill down, Appropriate topic in context) Useful utilities to fix a plan quickly. Data not presented graphically. Heavy HTML-report. Automatic execution of SQL through XTRXEC possible to get computed versus actual cardinality Page 34

SQLd360 Pro s and Con s Non-intrusive No context sensitive links to related information. Some statistics presented graphically You have to know where to start. Most impacting plan step highlighted graphically No method to see computed versus actual cardinality. Page 35

My subjective opinion SQL Tuning 2017 My subjective opinion: > To tune a SQL quickly a tool like SQLTXPLAIN and/or SQLd360 is still very helpful > Due to my personal experience with the tool and its navigation possibilities in the main report, SQLTXPLAIN is still what I m using today (if possible) > SQLd360 is a possible alternative for SQLTXPLAIN for many DBAs (who e.g. cannot accept SQLTXPLAIN s restrictions) > The utilities provided by SQLTXPLAIN (e.g. coe_xfr_sql_profile.sql) could be very handy in stressful tuning situations Page 36

Summary 1 > SQL Tuning 2017 2 3 4 5 Quo Vadis SQLTXPLAIN 22.11.2017 Page 37

Summary SQL Tuning 2017 > Get all metadata around a SQL using a tool like SQLT or SQLd360 > Measure what happens when running the SQL: > SQLTXECUTE > GATHER_PLAN_STATISTICS with DBMS_XPLAN.DISPLAY_CURSOR(format=> ALLSTATS LAST ) > 10046 trace with a format utility like tkprof > SQL Monitor > SQL_PLAN_LINE_ID in ASH > focus is on > where most time is spent > where we do have a misestimate between calculated and real cardinality > Based on above data make an analysis and fix the issue locally > Verify result Page 38

Summary AI and autonomous DBs? > What about Artificial Intelligence and autonomous DBs? > In my opinion there will always be cases which need manual tuning. > I.e. a tool like SQLTXPLAIN or SQLd360 will have its value also in the future. > SQL Tuning as a service? Page 39

Basel Delémont Zürich Nyon Any questions? Please do ask! We would love to boost your IT-Infrastructure How about you? Quo Vadis SQLTXPLAIN 22.11.2017 Page 40

Let s meet at booth 242