Statistics for All Tables Getting Stale With No Data Change in 12.2
(Doc ID 2448781.1)
Last updated on JULY 20, 2024
Applies to:
Oracle Database - Enterprise Edition - Version 12.2.0.1 and laterGen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Information in this document applies to any platform.
Symptoms
- Data has not changed but many objects have stale statistics
- Noticed that SYS.GATHER_STATS_PROG (Schedule Name ORA$AT_xxxx_OS) started running at that exact time
- METHOD_OPT is specified to disable histogram creation
- Histogram is automatically created on some columns
- The table is partitioned
- Following testcase shows this:
Testcase in 12.2:
SQL> select count(*) from dba_tab_statistics where stale_stats = 'YES';
COUNT(*)
----------
125SQL> EXEC SYS.DBMS_STATS.GATHER_DICTIONARY_STATS (no_invalidate => FALSE);
PL/SQL procedure successfully completed.
SQL> EXEC SYS.DBMS_STATS.GATHER_FIXED_OBJECTS_STATS (no_invalidate => FALSE);
PL/SQL procedure successfully completed.
SQL> select count(*) from dba_tab_statistics where stale_stats = 'YES';
COUNT(*)
----------
19After 2 hours, even after no changes done in database.
SQL> select count(*) from dba_tab_statistics where stale_stats = 'YES';
COUNT(*)
----------
47
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Cause |
Solution |
References |