The
DBMS_AUTO_SQLTUNE package is the interface for managing the Automatic SQL Tuning task. Unlike DBMS_SQLTUNE , the DBMS_AUTO_SQLTUNE package requires the DBA role.
The DBMSAUTOSQLTUNE package is the interface to SQL Tuning Advisor (DBMSSQLTUNE) when run within the Autotask framework. The database creates the automated system task SYSAUTOSQLTUNINGTASK as part of the catalog scripts. This task automatically chooses a set of high-load SQL from AWR and runs the SQL Tuning Advisor on this SQL. Dec 20, 2017 Manage SQL Profile in Oracle Database SQL Profile is used by Optimizer for use more efficient execution plan for the SQL Query to make in accepted State. It is found in DBASQLPROFILES view. It used to choose better plan by optimizer if the SQL profile plan is having low cost then optimizer use it.
The chapter contains the following topics:
29.1 DBMS_AUTO_SQLTUNE Overview
The The database creates the automated system task DBMS_AUTO_SQLTUNE package is the interface to SQL Tuning Advisor (DBMS_SQLTUNE ) when run within the Autotask framework.
SYS_AUTO_SQL_TUNING_TASK as part of the catalog scripts. This task automatically chooses a set of high-load SQL from AWR and runs the SQL Tuning Advisor on this SQL. The automated task performs the same comprehensive analysis as any other SQL Tuning task.
The automated task tests any SQL profiles it finds by executing both the old and new query plans. Automatic SQL Tuning differs from manual SQL tuning in one important way. If automatic implementation of SQL profiles is enabled (the default is disabled), then the database implements any SQL profiles that promise a great performance benefit. The implementation occurs at tuning time so that the database can immediately benefit from the new plan. You can enable or disable automatic implementation by using the
SET_AUTO_TUNING_TASK_PARAMETER API to set the ACCEPT_SQL_PROFILES parameter.
In each maintenance window, the automated tuning task stores its results as a new execution. Each execution result has the same task name but a different execution name. Query the
DBA_ADVISOR_EXECUTIONS view for information about task executions. Use the REPORT_AUTO_TUNING_TASK Function to view reports that span multiple executions.
29.2 DBMS_AUTO_SQLTUNE Security Model
This package is available to users with the
DBA role. For other users, you must grant the EXECUTE privilege on the package explicitly. Note that the EXECUTE_AUTO_TUNING_TASK procedure is an exception: only SYS can invoke it.
Users can call APIs in this package to control how the automatic tuning task behaves when it runs, such as enabling automatic SQL profile creation and configuring the total and per-SQL time limits under which the task runs. Because these settings affect the overall performance of the database, it may not be appropriate for all users with the
ADVISOR privilege to have access to this package.
29.3 Summary of DBMS_AUTO_SQLTUNE Subprograms
The
DBMS_AUTO_SQLTUNE package contains EXECUTE , REPORT , and SET subprograms.
Table 29-1 DBMS_AUTO_SQLTUNE Package Subprograms
29.3.1 EXECUTE_AUTO_TUNING_TASK Function and ProcedureDbms_sqltune.create_tuning_task Parameters
This function and procedure executes the Automatic SQL Tuning task (
SYS_AUTO_SQL_TUNING_TASK ).
Both the function and the procedure run in the context of a new task execution. The difference is that the function returns the name of the new execution.
Parameters
Table 29-2 EXECUTE_AUTO_TUNING_TASK Function and Procedure Parameters
Usage Notes
Only
SYS can invoke this subprogram. A tuning task can be executed multiple times without having to reset it.
29.3.2 REPORT_AUTO_TUNING_TASK Function
This procedure displays the results of an Automatic SQL Tuning task.
Parameters
Table 29-3 REPORT_AUTO_TUNING_TASK Function Parameters
Return Values
A
CLOB containing the desired report.
29.3.3 SET_AUTO_TUNING_TASK_PARAMETER Procedures
This procedure updates the value of a SQL tuning parameter of type
VARCHAR2 or NUMBER for SYS_AUTO_SQL_TUNING_TASK .
Parameters
Table 29-4 SET_AUTO_TUNING_TASK_PARAMETER Procedure Parameters
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |