Parameter | Description |
---|---|
ACCEPT_SQL_PROFILE |
Specifies whether to accept SQL profiles automatically. |
EXECUTION_DAYS_TO_EXPIRE |
Specifies the number of days for which to save the task history in the advisor framework schema. By default, the task history is saved for 30 days before it expires. |
MAX_SQL_PROFILES_PER_EXEC |
Specifies the limit of SQL profiles that are accepted for each automatic SQL tuning task. Consider setting the limit of SQL profiles that are accepted for each automatic SQL tuning task based on the acceptable level of changes that can be made to the system on a daily basis. |
MAX_AUTO_SQL_PROFILES |
Specifies the limit of SQL profiles that are accepted in total. |
BEGIN DBMS_AUTO_SQLTUNE.SET_AUTO_TUNING_TASK_PARAMETER( parameter => 'ACCEPT_SQL_PROFILES', value => 'TRUE'); END; /
可通过DBMS_AUTO_SQLTUNE.REPORT_AUTO_TUNING_TASK查看报告
VARIABLE my_rept CLOB;
BEGIN
:my_rept :=DBMS_AUTO_SQLTUNE.REPORT_AUTO_TUNING_TASK(
begin_exec => NULL,
end_exec => NULL,
type => 'TEXT',
level => 'TYPICAL',
section => 'ALL',
object_id => NULL,
result_limit => NULL);
END;
/
什么是SQL Profile A collection of information that enables the query optimizer to create an optimal execution plan for a SQL statement. 可以在不改变sql text的前提下选择更优执行计划,且相比hint/stored outline又不会冻结该计划,当优化器发现更优解时可重新选择;可以通过stage表传输到其他数据库
什么是SQL Tuning Set (STS)
A database object that includes one or more SQL statements along with their execution statistics and execution context.
当生产库遭遇poor sql时,可创建STS并传输到测试库(>=10gR2)进行调优,使用dbms_sqltune创建;
使用CAPTURE_CURSOR_CACHE_SQLSET可定时捕获cursor cache中的所有工作负载,相比之下AWR只捕获top sql
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15480802/viewspace-759561/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/15480802/viewspace-759561/