Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL Tuning made much easier with SQLTXPLAIN (SQLT) Mauro Pagano Senior Principal Technical Support Engineer Oracle Confidential – Internal/Restricted/Highly.

Similar presentations


Presentation on theme: "SQL Tuning made much easier with SQLTXPLAIN (SQLT) Mauro Pagano Senior Principal Technical Support Engineer Oracle Confidential – Internal/Restricted/Highly."— Presentation transcript:

1

2 SQL Tuning made much easier with SQLTXPLAIN (SQLT) Mauro Pagano Senior Principal Technical Support Engineer Oracle Confidential – Internal/Restricted/Highly RestrictedCopyright © 2014, Oracle and/or its affiliates. All rights reserved. |

3 Safe Harbor Statement 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. Oracle Confidential – Internal/Restricted/Highly Restricted3

4 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Main Methods Main HTML Diagnostic Report Summary Q&A 1 2 3 4 5 Oracle Confidential – Internal/Restricted/Highly Restricted4

5 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Main Methods Main HTML Diagnostic Report Summary Q&A 1 2 3 4 5 Oracle Confidential – Internal/Restricted/Highly Restricted5

6 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | What is SQLTXPLAIN (SQLT)? Add-on (available at MOS 215187.1) Free to download and use Works on 12c,11g,10g Linux, UNIX, Windows Single instance, RAC, Exadata, In-Memory Easy to install and execute Tool to diagnose SQL statements performing poorly

7 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SQLTXPLAIN (SQLT) origins SQL Tuning diagnostics gathering – time consuming and time sensitive manual process – not straightforward, need to know what to extract and how – more info/diag release after release Avoid reinventing the wheel, quickly spot known issues / concerns Several RDBMS features provide insights but often overlooked Why do I need a tool to collect diagnostics?

8 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SQLTXPLAIN (SQLT) benefits Collect SQL tuning diagnostics for one SQL statement Over a hundred health-checks (HC) around the SQL statement If Oracle Tuning or Diagnostics Pack are properly licensed – Invokes SQL Tuning Advisor (STA) – Includes Active Session History (ASH) and SQL Monitor Report – Includes Automatic Workload Repository (AWR) Automatic SQL tuning test case (TC) extraction SQLT helps to expedite SQL tuning process What is in it for me?

9 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SQLTXPLAIN (SQLT) mechanics Install once, execute many 3 + 4 main methods to analyze one SQL statement Inputs one SQL statement and outputs one zip file Output contains a main html report and other files – AWR, ADDM, ASH, SQL Mon, 10053, 10046, TKPROF, etc. Exports SQL tuning test cases – SQLT TC and TCX plus 11g Test Case Builder (TCB) SQLT installs its own two schemas, does not pollute the application! How does it work?

10 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Main Methods Main HTML Diagnostic Report Summary Q&A 1 2 3 4 5 Oracle Confidential – Internal/Restricted/Highly Restricted10

11 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SQLT Main Methods SQLT XTRACT SQLT XECUTE SQLT XTRXEC SQLT XPLAIN SQLT XTRSBY SQLT XPREXT SQLT XPREXC All 3 + 2 + 2 act on one SQL statement

12 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Using SQLT Main Methods

13 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |  XTRXEC includes XTRACT and XECUTE XPLAIN XTRSBY Common XTRACT XECUTE SQLT Output Overlap

14 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Main Methods Main HTML Diagnostic Report Summary Q&A 1 2 3 4 5 Oracle Confidential – Internal/Restricted/Highly Restricted14

15 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | What is included in Main Report? Health-checks SQL text Parameters Cursor sharing SQL Tuning Advisor (STA) report Execution plans Partial list of contents (1/3)

16 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | What is included in Main Report? Plan stability Active Session History (ASH) SQL performance metrics SQL Monitor Segment and session statistics Tables Partial list of contents (2/3)

17 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | What is included in Main Report? Indexes CBO statistics Objects and dependencies Policies Metadata Partial list of contents (3/3)

18 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Navigating the SQLT Main Report 1.SQL Text 2.Plans Summary 3.Observations 4.Branch as per findings Typical Navigation

19 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration Main Report Navigation SQLT XECUTE

20 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

21 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

22 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstrantion

23 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

24 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

25 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

26 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

27 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

28 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

29 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

30 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

31 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

32 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration Same SQL in 12c uses an Adaptive Plan, SQLT helps making it more readable

33 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration If we want to force this plan in another db we can just grab these hints

34 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

35 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration SQLT provides info about the performance history for the SQL (from AWR)

36 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration SQLT extract info from ASH to help identify where time was spent

37 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

38 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Demonstration

39 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SQLT Additional Methods COMPARE – Compares everything that surrounds a SQL (object definition, statistics, parameters, execution plan, etc) across two systems XPLORE – Evaluates the impact of every CBO parameter / fix on the execution plan – Automates hundreds on tests in single operation What else can I do with SQLT?

40 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Main Methods Main HTML Diagnostic Report Summary Q&A 1 2 3 4 5 Oracle Confidential – Internal/Restricted/Highly Restricted40

41 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | SQL Tuning made easier with SQLTXPLAIN Full collection of SQL tuning diagnostics – Consolidated into an easy-to-navigate html report – Consistent view – Allow offline expert analysis Over a hundred health-checks around the SQL statement – Some with pointers to particular notes or bugs Automatic SQL tuning test case (TC) extraction – Allow WHAT-IF evaluations on a test environment Dynamic readme with commands for further diagnostics How is that?

42 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Want to master SQLTXPLAIN? Book: Oracle SQL Tuning with Oracle SQLTXPLAIN  Author: Stelios Charalambides  Released: March 20, 2013  Level: Intermediate  Available  Apress  Amazon  Barnes&Noble

43 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Important Support Resources Discover more about Get Proactive: http://www.oracle.com/goto/proactivesupport MOS Notes: 215187.1 SQLTXPLAIN (SQLT) Tool Download 1454160.1 SQLTXPLAIN (SQLT) FAQ MOS Community: SQLTXPLAIN (SQLT): General Discussion What if I want to know more?

44 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Program Agenda Introduction Main Methods Main HTML Diagnostic Report Summary Q&A 1 2 3 4 5 Oracle Confidential – Internal/Restricted/Highly Restricted44

45 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |Oracle Confidential – Internal/Restricted/Highly Restricted45

46


Download ppt "SQL Tuning made much easier with SQLTXPLAIN (SQLT) Mauro Pagano Senior Principal Technical Support Engineer Oracle Confidential – Internal/Restricted/Highly."

Similar presentations


Ads by Google