1、查询SYS_AUTO_SQL_TUNING_TASK在执行什么任务
select execution_name,status,execution_start,execution_end from dba_advisor_executions where task_name='SYS_AUTO_SQL_TUNING_TASK' order by execution_start desc;
select * from DBA_ADVISOR_SQLSTATS where execution_name='EXEC_9277';
select * from v$sql where sql_id='5y4p06cmta001';
2、关闭及启用SYS_AUTO_SQL_TUNING_TASK
1)检查目前状态
SELECT client_name, status FROM DBA_AUTOTASK_CLIENT;
SELECT * from dba_autotask_window_clients;
2)关闭
BEGIN
dbms_auto_task_admin.disable(
client_name => 'sql tuning advisor',
operation => NULL,
window_name => NULL);
END;
3)开启
BEGIN
dbms_auto_task_admin.enable(
client_name => 'sql tuning advisor',
operation => NULL,
window_name => NULL);
END;