There are two 'standard' windows for this job, one is a weekday window
which starts at 10pm and closes at 6am with the condition that the job
stops at the time the window closes. There is also a weekend window,
starting at 6AM on Saturday and running, essentially, until 6am on
Monday morning. The job is set to GATHER AUTO, which gathers stale
and empty statistics. The behaviour you're seeing is due to the
window closing at 6am on weekdays; the job finishes the statistics
that are running but starts no more objects, leaving the remainder to
be worked on at the next window. The weekend window allows the stats
job to 'catch up', if you will, by opening a 48 hour window during the
usual 'off hours'.
You can use the following query to return objects queued for
processing by the automatic statistics job:
set serveroutput on size 1000000 verify off
--
-- Auto stats candidates
--
declare
m_object_list dbms_stats.objecttab;
begin
dbms_stats.gather_schema_stats(
ownname => upper('&schema'),
options => 'LIST AUTO',
objlist => m_object_list
);
dbms_output.put_line(chr(10)||'GATHER AUTO will analyze '||
m_object_list.count||' objects'||chr(10));
dbms_output.put_line('OWNER TYPE OBJECT
NAME
PARTITION
SUBPARTITION CONF');
dbms_output.put_line('========= =====
=======================================
========================================
====================================== ====');
for i in 1..m_object_list.count loop
dbms_output.put_line(
rpad(m_object_list(i).ownname,10) ||
rpad(m_object_list(i).objtype, 6) ||
rpad(m_object_list(i).objname,40) ||
rpad(nvl(m_object_list(i).partname, ' '),40) ||
rpad(nvl(m_object_list(i).subpartname,' '),40) ||
lpad(m_object_list(i).confidence,4)
);
end loop;
end;
/
This will run in 10gR2 and earlier releases; for 11g the confidence
'column' no longer exists so that can either be removed from the query
or replaced with an optimiztic '100' to indicate the likelihood of
having statistics gathered on the object.
David Fitzjarrell