Step one. Before defining a new SQL workload, select the type of source from which you want to collect SQL. You can instruct SQL Optimizer to gather SQL from one of several different sources.
To select a SQL source and create a new session
Select the type of SQL workload source from which you want to collect SQL. Select from the following:
SQL Workload Source | Description |
---|---|
AWR |
Collect SQL from the Oracle Automatic Workload Repository (AWR). Caution: By default, Oracle installs and enables some features in the database which may not be covered by your existing licenses, such as Automatic Workload Repository (AWR). |
SGA | Collect SQL from the Oracle System Global Area. |
Source Code | Scan and collect SQL statements from source code, a database object, a file, or the clipboard. |
Specify the criteria for collecting a SQL workload. See one of the following topics (based on the source you selected):
Optimize Indexes for AWR Workload
Steps two, three, and four. The Optimize Indexes module allows you to collect SQL statements from the Automatic Workload Repository (AWR) of an Oracle database. Oracle uses the AWR to collect and maintain performance statistics. By default, every hour an Oracle database collects a snapshot of performance data. These snapshots are stored in the AWR. For more information on Oracle shapshots and the AWR, see your Oracle database documentation.
Use Optimize Indexes to define a SQL workload from an Oracle AWR and then search for new indexes to optimize the SQL workload performance.
Step two.
Define a new AWR workload
Enter a SQL workload name and select a database connection from which to collect SQL. The database must have AWR access.
Note: Top N SQL displays the Top N setting for the database—the setting which specifies the number of SQL retained in the AWR for each category. If you want to modify this setting for a database, use the MODIFY_SNAPSHOT_SETTINGS system procedure.
Specify SQL filter criteria. Review the following for additional information:
SQL filter criteria | Description |
---|---|
Date |
Select a date from which to choose snapshots. After you select a date, Optimize Indexes displays all the snapshots available for the selected 24 hour period. |
Select SQL for parsing schema |
You must select a parsing schema before collecting SQL. |
Module, Action |
Use these fields to filter the available SQL before selecting snapshots. Default = All |
Select the SQL snapshots from which you want to collect SQL statements. Click a snapshot in the graph to select it. Click the selected snapshot again to deselect it.
Notes:
You can display additional data in the graph (or in the grid). To do this, select/deselect data options from the group of options at the bottom of the page.
Optimize Indexes immediately asks you to choose a second database connection. Select a database connection to use to retrieve execution plans and evaluate index alternatives.
Note: This step allows you to select an alternate database (other than the one used to collect SQL) to run the index optimization process. In other words, you can collect your SQL from one database, but run the optimize indexes process on a second database. The second database must have the same application environment and data volume statistics as the first.
The Search Process page opens. Proceed with one of the following steps:
Step three.
(Optional) Review collected SQL
Pane / Button | Description |
---|---|
SQL Tuning Set Pane / SQL Workload Pane |
This pane displays the list of SQL in the workload. Include—To include a SQL statement in the optimize indexes process, select the checkbox in the Include column. |
SQL Text Pane | This pane displays the SQL text of the selected SQL statement. |
Parsed Execution Plan Pane |
This pane displays the execution plan of the selected SQL statement. SQL Statistics—Select this tab to display statistics of the selected statement. |
Select to send your SQL to Optimize SQL or Batch Optimize SQL. Click the arrow for more options. |
Notes:
To collect a new SQL workload, return to the SQL Collection page and click Collect SQL again.
Caution: If you click Collect SQL again, your current SQL workload will be lost, as well as any analysis data already gathered for the current session.
Step four.
Specify search process criteria
Search Process Control Pane | Description |
---|---|
Primary goal (minimize) |
Select a primary goal. SQL Optimizer evaluates indexes to optimize the workload based on this primary goal. |
Scheduled to run on |
Click the link to schedule a time to run the optimization process on this workload. Select a start time, end time, duration, and interval. |
Stop condition(s) |
Select criteria to determine when to end the optimization process. You can select one or more conditions. The default setting is When no further improvement found in 1:00:00. Note: If you do not specify a Stop condition or an End date, the optimization process will run indefinitely. |
Advanced options |
Click this link to select the number of columns in a composite index, the maximum number of indexes to recommend, and an index-type time distribution. Recommend function-based indexes—Select this checkbox if you want SQL Optimizer to include function-based indexes. Search time distribution between B-Tree and Bitmap indexes—Select a pre-defined or user-defined time distribution. Determines the percentage of time spent searching for B-Tree vs Bitmap index types. |
Go to Step five. Review Optimize Indexes Results.
Review Optimize Indexes Results
Steps two, three, and four. If you selected the SGA as a workload source, define the new workload and specify the search process criteria.
Step two.
Define a new SGA Workload
Specify SQL filter criteria. To modify filter criteria, click the Edit link beside each filter. The available options display as bars in the graph. Click an option (bar) in the graph to select it. The selected option then displays in the filter criterion field in the top pane. Review the following for additional information:
SQL filter criteria pane | Description |
---|---|
Collect SQL for parsing schema |
You must select a parsing schema before collecting SQL. |
Module, Action |
Use these fields to filter the available SQL statements. Default = All |
Notes:
You can display additional data in the graph (or in the grid). To do this, select/deselect data options from the group of options at the bottom of the page.
Optimize Indexes immediately asks you to choose a second database connection. Select a database connection to use to retrieve execution plans and evaluate index alternatives.
Note: This step allows you to select an alternate database (other than the one used to collect SQL) to run the index optimization process. In other words, you can collect your SQL from one database, but run the optimize indexes process on a second database. The second database must have the same application environment and data volume statistics as the first.
The Search Process page opens. Before specifying search process criteria, you can review and modify your SQL workload.
Step three.
(Optional) Review collected SQL
Pane / Button | Description |
---|---|
SQL Tuning Set Pane / SQL Workload Pane |
This pane displays the list of SQL in the workload. Include—To include a SQL statement in the optimize indexes process, select the checkbox in the Include column. |
SQL Text Pane | This pane displays the SQL text of the selected SQL statement. |
Parsed Execution Plan Pane |
This pane displays the execution plan of the selected SQL statement. SQL Statistics—Select this tab to display statistics of the selected statement. |
Select to send your SQL to Optimize SQL or Batch Optimize SQL. Click the arrow for more options. |
Notes:
To collect a new SQL workload, return to the SQL Collection page and click Collect SQL again.
Caution: If you click Collect SQL again, your current SQL workload will be lost, as well as any analysis data already gathered for the current session.
Step four.
Specify search process criteria
Search Process Control Pane | Description |
---|---|
Primary goal (minimize) |
Select a primary goal. SQL Optimizer evaluates indexes to optimize the workload based on this primary goal. |
Scheduled to run on |
Click the link to schedule a time to run the optimization process on this workload. Select a start time, end time, duration, and interval. |
Stop condition(s) |
Select criteria to determine when to end the optimization process. You can select one or more conditions. The default setting is When no further improvement found in 1:00:00. Note: If you do not specify a Stop condition or an End date, the optimization process will run indefinitely. |
Advanced options |
Click this link to select the number of columns in a composite index, the maximum number of indexes to recommend, and an index-type time distribution. Recommend function-based indexes—Select this checkbox if you want SQL Optimizer to include function-based indexes. Search time distribution between B-Tree and Bitmap indexes—Select a pre-defined or user-defined time distribution. Determines the percentage of time spent searching for B-Tree vs Bitmap index types. |
Go to Step five. Review Optimize Indexes Results.
If you selected to scan code for the SQL workload, collect workload SQL and specify the search process criteria using the following steps.
Step two.
Scan code for a new workload
After the SQL is scanned, the SQL Selector dialog opens displaying the list of scanned SQL. Select the checkbox to the left of each listed SQL to include it in your workload. Click on a scanned SQL in the left pane to highlight its SQL text in the right pane.
Note: Enter a value in the REF (Relative Execution Frequency) column for each SQL. The REF will be used as an approximation of the number of times a SQL statement is executed relative to the other statements.
Click OK to close the dialog. The Scan Code window now displays the list of SQL statements in your workload. To add additional SQL, select an additional method and source.
Note: Click Remove to remove a selected SQL from the workload.
Optimize Indexes immediately asks you to choose a second database connection. Select a database connection to use to retrieve execution plans and evaluate index alternatives.
Note: This step allows you to select an alternate database (other than the one used to collect SQL) to run the index optimization process. In other words, you can collect your SQL from one database, but run the optimize indexes process on a second database. The second database must have the same application environment and data volume statistics as the first.
The Search Process page opens. Proceed with one of the following steps:
Step three.
(Optional) Review collected SQL
Pane / Button | Description |
---|---|
SQL Tuning Set Pane / SQL Workload Pane |
This pane displays the list of SQL in the workload. Include—To include a SQL statement in the optimize indexes process, select the checkbox in the Include column. |
SQL Text Pane | This pane displays the SQL text of the selected SQL statement. |
Parsed Execution Plan Pane |
This pane displays the execution plan of the selected SQL statement. SQL Statistics—Select this tab to display statistics of the selected statement. |
Select to send your SQL to Optimize SQL or Batch Optimize SQL. Click the arrow for more options. |
Notes:
To collect a new SQL workload, return to the SQL Collection page and click Collect SQL again.
Caution: If you click Collect SQL again, your current SQL workload will be lost, as well as any analysis data already gathered for the current session.
Step four.
Specify search process criteria
Search Process Control Pane | Description |
---|---|
Primary goal (minimize) |
Select a primary goal. SQL Optimizer evaluates indexes to optimize the workload based on this primary goal. |
Scheduled to run on |
Click the link to schedule a time to run the optimization process on this workload. Select a start time, end time, duration, and interval. |
Stop condition(s) |
Select criteria to determine when to end the optimization process. You can select one or more conditions. The default setting is When no further improvement found in 1:00:00. Note: If you do not specify a Stop condition or an End date, the optimization process will run indefinitely. |
Advanced options |
Click this link to select the number of columns in a composite index, the maximum number of indexes to recommend, and an index-type time distribution. Recommend function-based indexes—Select this checkbox if you want SQL Optimizer to include function-based indexes. Search time distribution between B-Tree and Bitmap indexes—Select a pre-defined or user-defined time distribution. Determines the percentage of time spent searching for B-Tree vs Bitmap index types. |
Go to Step five. Review Optimize Indexes Results.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center