2. SQL Performance Analyzer forecast the impact of a potential change on the performance of a SQL query workload. WHEN? • Database upgrades • Implementation of tuning recommendations • Schema changes • Statistics gathering • Database parameter changes • OS/hardware changes might be reported for as a Tuning Result
3. SQL Performance Analyzer Extract STS(SQL Tuning Set) from production What’s inside? FROM Cursor Cache – SQL Text – Bind variables – Execution plans – Execution statistics - Incremental capture over a time period - filtering and ranking capabilities filters out undesirable SQL FILTERING Always all? No!
4. SQL Performance Analyzer Transport to a test system (STS COPY) 변 경 전 변 경 후 Execute Re-Execute • Test-Execute SQL – produce execution plans and statistics – execute SQL serially – every SQL is executed only once • Explain plan SQL in SQL tuning set to generate SQL plans only SQL Performance = execution plans + execution statistics
5. SQL Performance Analyzer And next Detect - improvements - regressions - unchanged performance - changes in execution plans Tune - regressed SQLs - index Choose - SQL Plan Management baseline X O ? SQL Performance = execution plans + execution statistics
6. SQL Performance Analyzer Do Creating a SQL Tuning Set (Capturing the SQL Workload) Sources - Cursor Cache - AWR Snapshots, Baselines - User-defined Workload (sql_text, parsing_schema_name columns) Exporting the SQL Workload - choose to export the selected STS - load a STS on the test system for comparison purposes Collect SQL Performance Change - parameter - index - hint SQL Performance = execution plans + execution statistics
7. SQL Performance Analyzer Do Do Collect SQL Performance Compare SQL Performance Analysis Results - before vs after Using EM SQL Performance = execution plans + execution statistics
8. SQL Performance Analyzer Do DoDo DBMS_SQLTUNE - CREATE_TUNING_TASK - EXECUTE_TUNING_TASK - REPORT_TUNING_TASK - etc……………… To be continued……………… SQL Performance = execution plans + execution statistics