Previous |
Next |
SQL plan management is a preventative mechanism that records and evaluates execution plans of SQL statements over time. The database builds SQL plan baselines consisting of a set of existing plans known to be efficient. If the same SQL statement runs repeatedly, and if the optimizer generates a new plan differing from the baseline, then the database compares the plan with the baseline and chooses the best one.
SQL plan management avoids SQL performance regression. Events such as new optimizer statistics, changes to initialization parameters, database upgrades, and so on can cause changes to execution plans. These changes can cause SQL performance regressions that are difficult and time-consuming to fix manually. SQL plan baselines preserve performance of SQL statements, regardless of changes in the database.
To load SQL execution plans:
From the Database Home page, click Server.
The Server page appears.
Under Query Optimizer, click SQL Plan Control.
The SQL Profile subpage of the SQL Plan Control page appears.
Click SQL Plan Baseline.
The SQL Plan Baseline subpage appears.
Under Settings, click the link next to Capture SQL Plan Baselines.
The Initialization Parameters page appears.
In the Value column of the table, select TRUE and then click OK.
You are returned to the SQL Plan Baseline subpage, which now shows Capture SQL Baselines set to TRUE.
Because you configured baselines to be captured, the database automatically keeps a history of execution plans for all SQL statements executed more than once.
Click Load.
The SQL Plan Control page appears.
Select the SQL plan baselines to be loaded by completing the following steps:
Under Load SQL Plan Baselines, select Load plans from SQL Tuning Set (STS).
In Job Name, enter a name for the job. For example, enter SPM_LOAD_TEST
.
Under Schedule, select Immediately.
Click OK.
The SQL Profile subpage of the SQL Plan Control page appears.
The table displays a list of SQL plans that are stored as SQL plan baselines.
Optionally, fix the execution plan of a baseline to prevent the database from using an alternative SQL plan baseline. Complete the following steps:
Select a SQL plan baseline that is not fixed.
Select Fixed - Yes from the list preceding the baseline table.
Click Go.
The table is refreshed to show the SQL execution plan with the value YES
in the Fixed column of the table.
Oracle Database Performance Tuning Guide to learn how to use SQL plan management