Apologies, I’m a database type.....Quest is best known for toad, but we also have enterprise monitoring across all levels of the stackIn Melbourne, SQL Navigator + the spotlights. It’s not a complete co-incidence about the star trek theme.
Detecting break outs <br />V$SQL & V$SQL_PLAN<br />Find SQLs with high resource costs <br />EXPLAIN PLAN & DBMS_STAT<br />Determine the execution plan <br />SQL Trace/Tkprof<br />Best drilldown at the session level <br />
SQL Trace & tkprof<br />Trace in current session: DBMS_SESSION<br />In other session: DBMS_MONITOR<br />Session_trace_enable – specific session <br />Serv_mod_act_trace_enable – service, module or action name<br />Analyze with tkprof<br />Or third party tools (Toad, Spotlight, others)<br />
The best laid plans of Mice and Oracle....<br />
Returning to captivity – changing the plan <br />Options for improving the plan:<br />Indexing<br />Configuration changes (esp. Memory)<br />Stored outlines (stability)<br />SQL Tuning sets and profiles <br />11g SQL Baselines (flexibility)<br />Hints and re-writes (last resort)<br />
Use hints with extreme caution<br />Hints reduce optimizer flexibility and can lead to bad plans<br />Eg: USE_NL can force a nested loops join without an index<br />USE_NL_WITH_INDEX is safer..<br />
Memory and sorting<br />Nothing matters as much as PGA to sort operations<br />Automatic work area management restricts you to a subset of PGA<br />For big sorts, “opt out” of automatic work area management<br />ALTER SESSION SET workarea_size_policy = manual;<br />ALTER SESSION SET sort_area_size = 524288000;<br />
Conclusion<br />Maximizing optimizer accuracy provides the best return on investment<br />Sub-optimal optimizations are unfortunately inevitable<br />Key SQL tuning skills are therefore:<br />Configuring Oracle to maximize optimizer effectiveness<br />Detection of sub-optimal SQLs<br />Techniques for coercing SQLs to acceptable performance<br />