--查看统计信息的状态
col client_name for a60
select client_name,status from DBA_AUTOTASK_CLIENT;
CLIENT_NAME STATUS
------------------------------------------------------------ ----------------
auto optimizer stats collection ENABLED
auto space advisor ENABLED
sql tuning advisor ENABLED
--关闭统计信息收集
begin
DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => 'auto optimizer stats collection',
operation => NULL,
window_name => NULL);
end;
/
PL/SQL procedure successfully completed.
--检查统计信息的状态
select client_name,status from DBA_AUTOTASK_CLIENT;
CLIENT_NAME STATUS
------------------------------------------------------------ ----------------
auto optimizer stats collection DISABLED
auto space advisor ENABLED
sql tuning advisor ENABLED
SQL>
--启用统计信息收集
begin
DBMS_AUTO_TASK_ADMIN.ENABLE(client_name => 'auto optimizer stats collection',
operation => NULL,
window_name => NULL);
end;
/
PL/SQL procedure successfully completed.
--检查统计信息的状态
select client_name,status from DBA_AUTOTASK_CLIENT;
CLIENT_NAME STATUS
------------------------------------------------------------ ----------------
auto optimizer stats collection ENABLED
auto space advisor ENABLED
sql tuning advisor ENABLED
SQL>
|