How to check progress of a long running statistics gathering job

If you have a long-running statistics job running, you can check it from v$session_longops:

For example, you execute:

SQL> EXECUTE dbms_stats.gather_dictionary_stats;

PL/SQL procedure successfully completed.

Check progress with:

col message for a65
col units for a10
col "remaining time hrs"  for 999

select sofar, totalwork,units,start_time,message,CEIL(time_remaining/60/60) "remaining time hrs"  from v$session_longops where opname = 'gather_dictionary_stats';