手动收集
DBMS_STATS.GATHER_TABLE_STATS (
ownname =>'CMS',
tabname =>'T_FULLWHT',
cascade =>true);
自动收集可查询如下表:
dba_scheduler_windows
SELECT owner,job_name,state,last_start_date,last_run_duration,failure_count
FROM dba_scheduler_jobs WHERE job_name = 'GATHER_STATS_JOB';
SELECT log_id, job_name, status,
TO_CHAR (log_date, 'yyyy-mm-dd hh24:mi:ss') log_date
FROM dba_scheduler_job_run_details
WHERE job_name = 'GATHER_STATS_JOB' order by 4;
自动收集信息的任务是每天都会运行,但只有数据变化量大于10%时才会收集.