11g nf sql_anlz

8

description

Oracle11g SQL

Transcript of 11g nf sql_anlz

Page 1: 11g nf sql_anlz
Page 2: 11g nf sql_anlz

SQL Performance Analyzer

forecast the impact of a potential change on the performance of a SQL query workload.

• Database upgrades• Implementation of tuning recommendations• Schema changes• Statistics gathering• Database parameter changes• OS/hardware changes

might be

reported for as a Tuning Result

WHEN?

Page 3: 11g nf sql_anlz

SQL Performance Analyzer

Extract STS(SQL Tuning Set) from production

FROM Cursor Cache– SQL Text– Bind variables– Execution plans– Execution statistics

What’s inside?

- Incremental capture over a time period

- filtering and ranking capabilities filters out undesirable SQL

FILTERINGAlways all? No!

Page 4: 11g nf sql_anlz

SQL Performance Analyzer

Transport to a test system (STS COPY)

SQL Performance = execution plans + execution statistics

• 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

변 경 전 변 경 후

Execute Re-Execute

Page 5: 11g nf sql_anlz

SQL Performance Analyzer

SQL Performance = execution plans + execution statistics

And nextDetect - improvements - regressions - unchanged performance - changes in execution plans

Tune - regressed SQLs - index

Choose - SQL Plan Management baseline

XO?

Page 6: 11g nf sql_anlz

SQL Performance Analyzer

SQL Performance = execution plans + execution statistics

DoCreating a SQL Tuning Set (Capturing the SQL Workload) Sources - Cursor Cache - AWR Snapshots, Baselines - User-defined Workload (sql_text, parsing_schema_name col-umns)

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

Page 7: 11g nf sql_anlz

SQL Performance Analyzer

SQL Performance = execution plans + execution statistics

Do DoCollect SQL Performance

Compare SQL Performance

Analysis Results - before vs after

Using EM

Page 8: 11g nf sql_anlz

SQL Performance Analyzer

SQL Performance = execution plans + execution statistics

Do Do DoDBMS_SQLTUNE

- CREATE_TUNING_TASK

- EXECUTE_TUNING_TASK

- REPORT_TUNING_TASK

- etc………………

To be continued………………