Survey of some free Tools to enhance your SQL Tuning and Performance Diagnostics skills Carlos Sierra What is Performance Tuning? Tuning and Performance Diagnostics SQL Tuning Database Performance Tuning and Performance Diagnostics • • • • • • SQL Tuning One Page One Report One Program One Process One Query One DML • • • • • Database Performance Whole Database Several Users Multiple Transactions Certain Times Everything is slow! Tools SQL Tuning Database Performance Tools • • • • • • • • SQL Tuning SQL Trace AUTOTRACE EXPLAIN PLAN FOR DBMS_XPLAN SQL Monitor Snapper SQLTXPLAIN a.k.a. SQLT SQLd360 • • • • • • • Database Performance Enterprise Manager – OEM AWR Active Session History – ASH Statspack Snapper TUNAs360 eDB360 Cool Free Tools • • • • • Snapper TUNAs360 SQLT SQLd360 eDB360 Cool Free Scripts • • • • planx sqlash sqlmon sqlpch Snapper Snapper • • • • • • By Tanel Poder Installs nothing 10g to 12c No dependencies on Diagnostics or Tuning Packs Mimics ASH by sampling gv$session Samples also – gv$sesstat, gv$sess_time_model, gv$session_event Parameters • • • • Seconds between snaps (i.e. 5) Number of snaps (i.e. 12) Session IDs to snap Many other options – @snapper ash 5 1 144 – ASH mode, 5 seconds between snaps, one snap only, on session 144 TUNAs360 TUNAs360 • • • • • • • (TUN)ing with (A)ctive (s)essions By Mauro Pagano Installs nothing 10g to 12c No dependencies on Diagnostics or Tuning Packs No execution parameters Outputs HTML reports and Google Charts SQLT • • • • • • • By Carlos Sierra, Mauro Pagano and Abel Macias Oracle Support standard Installs two schemas and several objects 10g to 12c Inputs one SQL_ID Outputs one large HTML report Better output having Diagnostics or Tuning Packs SQLd360 • • • • • • By Mauro Pagano Installs nothing 10g to 12c Inputs one SQL_ID Outputs small HTML reports and Google Charts Better output having Diagnostics or Tuning Pack eDB360 • • • • • • By Carlos Sierra Installs nothing 10g to 12c 360-degree view of an entire Oracle Database Outputs small HTML reports and Google Charts Better output having Diagnostics or Tuning Packs eDB360 • • • • • • Configuration Resources DBA stuff Storage ASM Backup and Recovery • • • • • • Plan Stability CBO Stats OS Metrics Sessions ASH AWR planx • Inputs one SQL_ID • Outputs – SQL Performance – DBMS_XPLAN – ASH aggregates – Indexes – CBO statistics sqlash • Inputs one SQL_ID • Outputs ASH report sqlmon • Inputs one SQL_ID • Outputs – SQL Monitor reports list – Active SQL Monitor report (one per execution) – Text SQL Monitor report for all executions sqlpch • Inputs SQL_ID and list of CBO Hints – MONITOR, BIND_AWARE, GATHER_PLAN_STATISTICS • Outputs a SQL Patch Size Tool • • • • SQLT eDB360 SQLd360 TUNAs360 Script 6.8 MB 4.4 MB 1.4 MB 0.6 MB • • • • • snapper planx sqlpch sqlash sqlmon 165 KB 50 KB 7 KB 6 KB 5 KB SQL Tuning Tools - Ranking 1. 2. 3. 4. 5. 6. 7. SQLd360 SQLT Snapper planx sqlmon sqlpch sqlash Performance Diagnostics Tools - Ranking 1. eDB360 2. TUNAs360 3. Snapper Summary • Diagnose one SQL statement – Use SQLd360, else SQLT • Diagnose an entire Oracle Database – Use eDB360, else TUNAs360 • Diagnose one session or set of sessions (or all) – Use snapper • Use stand-alone scripts for special or small cases Questions References • Snapper – http://blog.tanelpoder.com • TUNAs360 and SQLd360 – https://mauro-pagano.com • SQLTXPLAIN a.k.a. SQLT: MOS 215187.1 • eDB360 and stand-alone scripts – https://carlos-sierra.net