EXECUTE DBMS_AUTO_TASK_ADMIN.DISABLE;
EXECUTE DBMS_AUTO_TASK_ADMIN.ENABLE;
col window_name for a20
select window_name,autotask_status from dba_autotask_window_clients;
exec dbms_auto_task_admin.enable(client_name=>'auto space advisor',operation=> NULL,window_name=>NULL);
col last_change for a40
select client_name,status,last_change from dba_autotask_client;
sql tuning advisor ENABLED
auto optimizer stats collection ENABLED
auto space advisor ENABLED
select autotask_status, optimizer_stats, segment_advisor, sql_tune_advisor
from dba_autotask_window_clients where window_name='MONDAY_WINDOW';
--https://zhuanlan.zhihu.com/p/658891291
select task_name, parameter_name, parameter_value FROM DBA_ADVISOR_PARAMETERS;
###AUTO_STATS_ADVISOR_TASK
-- The task runs as part of the automatic optimizer statistics collection client.
COL EXECUTION_NAME FORMAT a14
SELECT EXECUTION_NAME, EXECUTION_END, STATUS
FROM DBA_ADVISOR_EXECUTIONS
WHERE TASK_NAME = 'AUTO_STATS_ADVISOR_TASK'
ORDER BY 2;
<<<<< auto optimizer stats collection (子任务)
set line 300 pages 999
col client_name for a32
col window_name for a18
col window_start_time for a40
col window_duration for a28
col window_end_time for a40
select * from dba_autotask_client_history where window_start_time > sysdate -7
order by window_start_time ;
SYS_AUTO_SPM_EVOLVE_TASK
//
No separate scheduler client exists for the Automatic SPM Evolve Advisor task.
One client controls both Automatic SQL Tuning Advisor and Automatic SPM Evolve Advisor. Thus, the same task enables or disables both.
Enabling and Disabling the Automatic SPM Evolve Advisor Task
SELECT TASK_NAME, EXECUTION_NAME, STATUS
FROM DBA_ADVISOR_EXECUTIONS
WHERE TASK_NAME LIKE '%SPM%'; <<<<sql tuning advisor
SELECT TASK_NAME,count(*)
FROM DBA_ADVISOR_EXECUTIONS WHERE TASK_NAME NOT LIKE 'ADDM%' group by TASK_NAME;
select task_name, status from dba_advisor_tasks WHERE TASK_NAME NOT LIKE 'ADDM%';