自动统计信息收集情况
--1)查看统计信息是否被收集
--oracle 10g
select t.job_name,t.program_name,t.state,t.enabled
from dba_scheduler_jobs t
where job_name='GATHER_STATS_JOB';
--oracle 11g
select * from dba_autotask_client
where CLIENT_NAME ='auto optimizer stats collection';
--2) 检查哪些统计未被收集或很久没收集
select owner,
table_name,
t.last_analyzed,
t.num_rows,
t.blocks,
t.object_type
from dba_tab_statistics t
where owner='JINRILOG'
and (t.last_analyzed is not null or t.last_analyzed<=sysdate-14)
order by t.last_analyzed nulls first;
--3)查看数量 
select count(*) from dba_tab_statistics t
where owner ='JINRILOG'
and (t.last_analyzed is not null or t.last_analyzed<=sysdate-14)
;