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