SQL	
 Ā Tuning	
 Ā Tools	
 Ā of	
 Ā the	
 Ā Trade	
 Ā 
Carlos	
 Ā Sierra	
 Ā 
Carlos	
 Ā Sierra	
 Ā 
•  SQLTXPLAIN	
 Ā +	
 Ā SQL	
 Ā Health-­‐Check	
 Ā SQLHC	
 Ā +	
 Ā 
•  Consultant/Developer/DBA/Design/+	
 Ā 
•  Oracle	
 Ā Performance	
 Ā +	
 Ā SQL	
 Ā Tuning	
 Ā 
•  Oracle	
 Ā Database	
 Ā Health-­‐Check	
 Ā 
•  Tools	
 Ā +	
 Ā Scripts	
 Ā 
•  Speaker	
 Ā 
Enkitec	
 Ā (c)	
 Ā 2014	
 Ā  2	
 Ā 
SQL	
 Ā Tuning	
 Ā Tools	
 Ā of	
 Ā the	
 Ā Trade	
 Ā 
•  Stand-­‐alone	
 Ā Scripts	
 Ā 
•  SQLHC	
 Ā 
•  SQLTXPLAIN	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  3	
 Ā 
CommonaliQes	
 Ā 
•  Input	
 Ā one	
 Ā SQL	
 Ā statement	
 Ā 
– SQL_ID	
 Ā 
•  Output	
 Ā one	
 Ā or	
 Ā more	
 Ā diagnosQcs	
  files	
 Ā 
– Used	
 Ā mainly	
 Ā for	
 Ā SQL	
 Ā Tuning	
 Ā 
•  Make	
 Ā use	
 Ā of	
 Ā some	
 Ā Oracle	
 Ā licensed	
 Ā features	
 Ā 
– DiagnosQcs	
 Ā and/or	
 Ā Tuning	
 Ā Packs	
 Ā 	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  4	
 Ā 
CapabiliQes	
 Ā Compare	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  5	
 Ā 
Stand-­‐alone	
 Ā Scripts	
 Ā  	
 Ā SQLHC 	
 Ā SQLTXPLAIN	
 Ā 
Footprint	
 Ā Compare	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  6	
 Ā 
Stand-­‐alone	
 Ā Scripts	
 Ā  	
 Ā SQLHC
	
 Ā SQLTXPLAIN	
 Ā 
Stand-­‐alone	
 Ā Scripts	
 Ā 
•  Specialized	
 Ā diagnosQcs	
 Ā for	
 Ā SQL	
 Ā Tuning	
 Ā 
– planx.sql:	
 Ā ExecuQon	
 Ā Plans	
 Ā from	
 Ā Memory	
 Ā and	
 Ā RAC	
 Ā 
– sqlmon.sql:	
 Ā SQL	
 Ā Monitor	
 Ā Report	
 Ā 
– sqlash.sql:	
 Ā AcQve	
 Ā Session	
 Ā History	
 Ā (ASH)	
 Ā 
– mystat.sql:	
 Ā Performance	
 Ā StaQsQcs	
 Ā (counters)	
 Ā 
•  Install	
 Ā nothing	
 Ā on	
 Ā the	
 Ā database	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  7	
 Ā 
SQLHC	
 Ā 
•  Provides	
 Ā most	
 Ā common	
 Ā diagnosQcs	
 Ā needed	
 Ā 
for	
 Ā SQL	
 Ā Tuning	
 Ā 
•  Installs	
 Ā nothing	
 Ā on	
 Ā the	
 Ā database	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  8	
 Ā 
SQLTXPLAIN	
 Ā 
•  Provides	
 Ā about	
 Ā everything	
 Ā that	
 Ā is	
 Ā ever	
 Ā need	
 Ā 
for	
 Ā SQL	
 Ā Tuning	
 Ā 
– Robust	
 Ā set	
 Ā of	
 Ā diagnosQcs	
 Ā reports	
 Ā 
– AutomaQc	
 Ā extracQon	
 Ā of	
 Ā Test	
 Ā Case	
 Ā 
•  Installs	
 Ā two	
 Ā self-­‐contained	
 Ā schemas	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  9	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  10	
 Ā 
References	
 Ā 
•  Stand-­‐alone	
 Ā Scripts	
 Ā 
– carlos-­‐sierra.net	
 Ā 
•  SQLHC	
 Ā 
– MOS	
 Ā 1366133.1	
 Ā 
•  SQLTXPLAIN	
 Ā 
– MOS	
 Ā 215187.1	
 Ā 
6/21/14	
 Ā  Enkitec	
 Ā Ā©	
 Ā  11	
 Ā 
Contact	
 Ā InformaQon	
 Ā 
•  carlos.sierra@enkitec.com	
 Ā 
•  carlos-­‐sierra.net	
 Ā 
•  @csierra_usa	
 Ā 
Enkitec	
 Ā (c)	
 Ā 2014	
 Ā  12	
 Ā 

SQL Tuning Tools of the Trade

  • 1.
    SQL Ā Tuning Ā Tools Ā of Ā the Ā Trade Ā  Carlos Ā Sierra Ā 
  • 2.
    Carlos Ā Sierra Ā  • SQLTXPLAIN Ā + Ā SQL Ā Health-­‐Check Ā SQLHC Ā + Ā  •  Consultant/Developer/DBA/Design/+ Ā  •  Oracle Ā Performance Ā + Ā SQL Ā Tuning Ā  •  Oracle Ā Database Ā Health-­‐Check Ā  •  Tools Ā + Ā Scripts Ā  •  Speaker Ā  Enkitec Ā (c) Ā 2014 Ā  2 Ā 
  • 3.
    SQL Ā Tuning Ā Tools Ā of Ā the Ā Trade Ā  •  Stand-­‐alone Ā Scripts Ā  •  SQLHC Ā  •  SQLTXPLAIN Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  3 Ā 
  • 4.
    CommonaliQes Ā  •  Input Ā one Ā SQL Ā statement Ā  – SQL_ID Ā  •  Output Ā one Ā or Ā more Ā diagnosQcs  files Ā  – Used Ā mainly Ā for Ā SQL Ā Tuning Ā  •  Make Ā use Ā of Ā some Ā Oracle Ā licensed Ā features Ā  – DiagnosQcs Ā and/or Ā Tuning Ā Packs Ā  Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  4 Ā 
  • 5.
    CapabiliQes Ā Compare Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  5 Ā  Stand-­‐alone Ā Scripts Ā  Ā SQLHC Ā SQLTXPLAIN Ā 
  • 6.
    Footprint Ā Compare Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  6 Ā  Stand-­‐alone Ā Scripts Ā  Ā SQLHC Ā SQLTXPLAIN Ā 
  • 7.
    Stand-­‐alone Ā Scripts Ā  • Specialized Ā diagnosQcs Ā for Ā SQL Ā Tuning Ā  – planx.sql: Ā ExecuQon Ā Plans Ā from Ā Memory Ā and Ā RAC Ā  – sqlmon.sql: Ā SQL Ā Monitor Ā Report Ā  – sqlash.sql: Ā AcQve Ā Session Ā History Ā (ASH) Ā  – mystat.sql: Ā Performance Ā StaQsQcs Ā (counters) Ā  •  Install Ā nothing Ā on Ā the Ā database Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  7 Ā 
  • 8.
    SQLHC Ā  •  Provides Ā most Ā common Ā diagnosQcs Ā needed Ā  for Ā SQL Ā Tuning Ā  •  Installs Ā nothing Ā on Ā the Ā database Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  8 Ā 
  • 9.
    SQLTXPLAIN Ā  •  Provides Ā about Ā everything Ā that Ā is Ā ever Ā need Ā  for Ā SQL Ā Tuning Ā  – Robust Ā set Ā of Ā diagnosQcs Ā reports Ā  – AutomaQc Ā extracQon Ā of Ā Test Ā Case Ā  •  Installs Ā two Ā self-­‐contained Ā schemas Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  9 Ā 
  • 10.
    6/21/14 Ā  Enkitec Ā Ā© Ā  10 Ā 
  • 11.
    References Ā  •  Stand-­‐alone Ā Scripts Ā  – carlos-­‐sierra.net Ā  •  SQLHC Ā  – MOS Ā 1366133.1 Ā  •  SQLTXPLAIN Ā  – MOS Ā 215187.1 Ā  6/21/14 Ā  Enkitec Ā Ā© Ā  11 Ā 
  • 12.
    Contact Ā InformaQon Ā  • carlos.sierra@enkitec.com Ā  •  carlos-­‐sierra.net Ā  •  @csierra_usa Ā  Enkitec Ā (c) Ā 2014 Ā  12 Ā